Re: [PATCH v2] arm64: dts: allwinner: a64: olinuxino: Enable audio

146 views
Skip to first unread message

Jernej Škrabec

unread,
Nov 28, 2021, 11:14:27 AM11/28/21
to Maxime Ripard, Chen-Yu Tsai, linux-ar...@lists.infradead.org, linux...@googlegroups.com, Philip Rinn
Hi Philip!

Dne nedelja, 28. november 2021 ob 16:19:34 CET je Philip Rinn napisal(a):
> Enable the audio hardware on the Olimex A64-OLinuXino board family.
> Tested on the A64-OLinuXino-2Ge8G-IND variant.
>
> Signed-off-by: Philip Rinn <ri...@inventati.org>
>
> ---

You should put changelog here when you send new version of the patch.

>
> .../dts/allwinner/sun50i-a64-olinuxino.dts | 51 +++++++++++++++++++
>
> 1 file changed, 51 insertions(+)
>
>
>
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts
> b/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts
>
> index ec7e2c0e82c1..e2f518c5854a 100644
>
> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts
>
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts
>
> @@ -32,6 +32,22 @@ hdmi_con_in: endpoint {
>
> };
>
> };
>
>
>
> + hdmi-sound {
>
> + compatible = "simple-audio-card";
>
> + simple-audio-card,format = "i2s";
>
> + simple-audio-card,name = "allwinner,hdmi";
>
> + simple-audio-card,mclk-fs = <256>;
>
> + status = "okay";
>
> +
>
> + simple-audio-card,codec {
>
> + sound-dai = <&hdmi>;
>
> + };

Drop everything related to hdmi audio. There was quite a few e-mails regarding
how to best approach hdmi audio implementation on A64 and other SoCs with DW
HDMI core. Agreement is that we should introduce HDMI audio card driver
instead of simple audio card. I have this almost implemented, but I didn't find
time to polish it. Another thing is that there is nothing board specific about
HDMI audio, so nodes should reside in SoC DTSI file anyway.

Best regards,
Jernej

>
> +
>
> + simple-audio-card,cpu {
>
> + sound-dai = <&i2s2>;
>
> + };
>
> + };
>
> +
>
> leds {
>
> compatible = "gpio-leds";
>
>
>
> @@ -58,6 +74,15 @@ wifi_pwrseq: wifi_pwrseq {
>
> };
>
> };
>
>
>
> +&codec {
>
> + status = "okay";
>
> +};
>
> +
>
> +&codec_analog {
>
> + cpvdd-supply = <&reg_eldo1>;
>
> + status = "okay";
>
> +};
>
> +
>
> &cpu0 {
>
> cpu-supply = <&reg_dcdc2>;
>
> };
>
> @@ -74,6 +99,10 @@ &cpu3 {
>
> cpu-supply = <&reg_dcdc2>;
>
> };
>
>
>
> +&dai {
>
> + status = "okay";
>
> +};
>
> +
>
> &de {
>
> status = "okay";
>
> };
>
> @@ -97,6 +126,7 @@ &emac {
>
> };
>
>
>
> &hdmi {
>
> + #sound-dai-cells = <0>;
>
> hvcc-supply = <&reg_dldo1>;
>
> status = "okay";
>
> };
>
> @@ -107,6 +137,10 @@ hdmi_out_con: endpoint {
>
> };
>
> };
>
>
>
> +&i2s2 {
>
> + status = "okay";
>
> +};
>
> +
>
> &mdio {
>
> ext_rgmii_phy: ethernet-phy@1 {
>
> compatible = "ethernet-phy-ieee802.3-c22";
>
> @@ -328,6 +362,23 @@ &simplefb_hdmi {
>
> vcc-hdmi-supply = <&reg_dldo1>;
>
> };
>
>
>
> +&sound {
>
> + simple-audio-card,aux-devs = <&codec_analog>;
>
> + simple-audio-card,widgets = "Microphone", "Microphone Jack Left",
>
> + "Microphone", "Microphone Jack Right",
>
> + "Headphone", "Headphone Jack";
>
> + simple-audio-card,routing = "Left DAC", "DACL",
>
> + "Right DAC", "DACR",
>
> + "Headphone Jack", "HP",
>
> + "ADCL", "Left ADC",
>
> + "ADCR", "Right ADC",
>
> + "Microphone Jack Left", "MBIAS",
>
> + "MIC1", "Microphone Jack Left",
>
> + "Microphone Jack Left", "HBIAS",
>
> + "MIC2", "Microphone Jack Right";
>
> + status = "okay";
>
> +};
>
> +
>
> &uart0 {
>
> pinctrl-names = "default";
>
> pinctrl-0 = <&uart0_pb_pins>;
>
> --
>
> 2.33.0
>




Philip Rinn

unread,
Nov 28, 2021, 11:47:31 AM11/28/21
to Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec, linux-ar...@lists.infradead.org, linux...@googlegroups.com
Enable the audio hardware on the Olimex A64-OLinuXino board family.
Tested on the A64-OLinuXino-2Ge8G-IND variant.

Signed-off-by: Philip Rinn <ri...@inventati.org>

---



Changes in v2: added missing &sound {...} part

Changes in v3: removed HDMI audio part as requested by Jernej Škrabec



.../dts/allwinner/sun50i-a64-olinuxino.dts | 30 +++++++++++++++++++

1 file changed, 30 insertions(+)



diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts
b/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts

index ec7e2c0e82c1..6f2674bb1b7f 100644

--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts

+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts

@@ -58,6 +58,15 @@ wifi_pwrseq: wifi_pwrseq {

};

};



+&codec {

+ status = "okay";

+};

+

+&codec_analog {

+ cpvdd-supply = <&reg_eldo1>;

+ status = "okay";

+};

+

&cpu0 {

cpu-supply = <&reg_dcdc2>;

};

@@ -74,6 +83,10 @@ &cpu3 {

cpu-supply = <&reg_dcdc2>;

};



+&dai {

+ status = "okay";

+};

+

&de {

status = "okay";

};

@@ -328,6 +341,23 @@ &simplefb_hdmi {

Philip Rinn

unread,
Nov 28, 2021, 11:47:31 AM11/28/21
to Jernej Škrabec, Maxime Ripard, Chen-Yu Tsai, linux-ar...@lists.infradead.org, linux...@googlegroups.com
Hi Jernej,

On 28.11.21 at 17:14, Jernej Škrabec wrote:
> Drop everything related to hdmi audio. There was quite a few e-mails regarding
> how to best approach hdmi audio implementation on A64 and other SoCs with DW
> HDMI core. Agreement is that we should introduce HDMI audio card driver
> instead of simple audio card. I have this almost implemented, but I didn't find
> time to polish it. Another thing is that there is nothing board specific about
> HDMI audio, so nodes should reside in SoC DTSI file anyway.

OK, I did this in v3 of the patch, I'll send it in a minute.

Best regards,
Philip
OpenPGP_signature

Philip Rinn

unread,
Jan 11, 2022, 3:08:28 PM1/11/22
to Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec, linux-ar...@lists.infradead.org, linux...@googlegroups.com
Enable the audio hardware on the Olimex A64-OLinuXino board family.
Tested on the A64-OLinuXino-2Ge8G-IND variant.

Signed-off-by: Philip Rinn <ri...@inventati.org>

---


Changes in v2: added missing &sound {...} part
Changes in v3: removed HDMI audio part as requested by Jernej Škrabec

arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts | 30 +++++++++++++++++++
2.34.1


OpenPGP_signature

Maxime Ripard

unread,
Jan 12, 2022, 3:48:38 AM1/12/22
to Philip Rinn, Chen-Yu Tsai, Jernej Skrabec, linux-ar...@lists.infradead.org, linux...@googlegroups.com
Hi,

On Tue, Jan 11, 2022 at 09:08:23PM +0100, Philip Rinn wrote:
> Enable the audio hardware on the Olimex A64-OLinuXino board family.
> Tested on the A64-OLinuXino-2Ge8G-IND variant.
>
> Signed-off-by: Philip Rinn <ri...@inventati.org>
>
> ---
>
>
> Changes in v2: added missing &sound {...} part
> Changes in v3: removed HDMI audio part as requested by Jernej Škrabec
>
> arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts | 30 +++++++++++++++++++
>
> 1 file changed, 30 insertions(+)
>
>
>
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts
>
> index ec7e2c0e82c1..6f2674bb1b7f 100644
>
> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts
>
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts

Your mailer scrambled the patch completely, please use git send-email

Maxime
signature.asc

Priit Laes

unread,
Jan 12, 2022, 4:10:00 AM1/12/22
to ri...@inventati.org, Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec, linux-ar...@lists.infradead.org, linux...@googlegroups.com
On Tue, Jan 11, 2022 at 09:08:23PM +0100, 'Philip Rinn' via linux-sunxi wrote:
> Enable the audio hardware on the Olimex A64-OLinuXino board family.
> Tested on the A64-OLinuXino-2Ge8G-IND variant.

I have similar patch in one of my "long forgotten branches", but I'm not 100%
sure whether the cpvdd-supply is required for codec_analog. IIRC, sound worked
for me without the issues on A64-Olinuxino board (Rev D).

'cpvdd-supply = <&reg_eldo1>' for codec_analog

And we also need to enable these configuration options in the defconfig:

+CONFIG_SND_SUN8I_CODEC=m
+CONFIG_SND_SUN50I_CODEC_ANALOG=m
> --
> You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/linux-sunxi/87654fd3-6007-6067-1851-7bc4b6de2f05%40inventati.org.



Philip Rinn

unread,
Jan 12, 2022, 10:29:57 AM1/12/22
to pl...@plaes.org, Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec, linux-ar...@lists.infradead.org, linux...@googlegroups.com
Hi,

On 12.01.22 at 10:09, Priit Laes wrote:
> On Tue, Jan 11, 2022 at 09:08:23PM +0100, 'Philip Rinn' via linux-sunxi wrote:
>> Enable the audio hardware on the Olimex A64-OLinuXino board family.
>> Tested on the A64-OLinuXino-2Ge8G-IND variant.
>
> I have similar patch in one of my "long forgotten branches", but I'm not 100%
> sure whether the cpvdd-supply is required for codec_analog. IIRC, sound worked
> for me without the issues on A64-Olinuxino board (Rev D).
>
> 'cpvdd-supply = <&reg_eldo1>' for codec_analog

I didn't test it without but as it is present for all other a64 board with audio and also in Olimex' tree I think it is needed.

> And we also need to enable these configuration options in the defconfig:
>
> +CONFIG_SND_SUN8I_CODEC=m
> +CONFIG_SND_SUN50I_CODEC_ANALOG=m

Hm, probably, but why wasn't it added when audio was added for the other a64 boards? Or are we talking about different defconfigs here?

Best regards
Philip
OpenPGP_signature

Philip Rinn

unread,
Jan 12, 2022, 10:50:56 AM1/12/22
to max...@cerno.tech, jernej....@gmail.com, linux-ar...@lists.infradead.org, linux...@googlegroups.com, ri...@inventati.org, we...@csie.org
Enable the audio hardware on the Olimex A64-OLinuXino board family.
Tested on the A64-OLinuXino-2Ge8G-IND variant.

Signed-off-by: Philip Rinn <ri...@inventati.org>
---

Changes in v2: added missing &sound {...} part
Changes in v3: removed HDMI audio part as requested by Jernej Škrabec

arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts | 30 +++++++++++++++++++
1 file changed, 30 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts
index ec7e2c0e82c1..6f2674bb1b7f 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts

Jernej Škrabec

unread,
Jan 13, 2022, 1:59:58 AM1/13/22
to pl...@plaes.org, Philip Rinn, Maxime Ripard, Chen-Yu Tsai, linux-ar...@lists.infradead.org, linux...@googlegroups.com
Hi,

Dne sreda, 12. januar 2022 ob 16:29:51 CET je Philip Rinn napisal(a):
> Hi,
>
> On 12.01.22 at 10:09, Priit Laes wrote:
>
> > On Tue, Jan 11, 2022 at 09:08:23PM +0100, 'Philip Rinn' via linux-sunxi
> > wrote:
>
> >> Enable the audio hardware on the Olimex A64-OLinuXino board family.
> >> Tested on the A64-OLinuXino-2Ge8G-IND variant.
> >
> >
> > I have similar patch in one of my "long forgotten branches", but I'm not
> > 100%
sure whether the cpvdd-supply is required for codec_analog. IIRC,
> > sound worked for me without the issues on A64-Olinuxino board (Rev D).
> >
> > 'cpvdd-supply = <&reg_eldo1>' for codec_analog
>
>
> I didn't test it without but as it is present for all other a64 board with
> audio and also in Olimex' tree I think it is needed.

It's not question if it works with or without it, nor if other boards have it
or not. Only deciding factor is board design. On schematic it can be seen that
cpvdd is connected to eldo1, so having this property is correct, mandatory
even.

Best regards,
Jernej

Philip Rinn

unread,
Jan 13, 2022, 11:37:32 AM1/13/22
to Jernej Škrabec, pl...@plaes.org, Maxime Ripard, Chen-Yu Tsai, linux-ar...@lists.infradead.org, linux...@googlegroups.com
Hi,

On 13.01.22 at 07:59, Jernej Škrabec wrote:
> Hi,
>
> Dne sreda, 12. januar 2022 ob 16:29:51 CET je Philip Rinn napisal(a):
>> Hi,
>>
>> On 12.01.22 at 10:09, Priit Laes wrote:
>>
>>> On Tue, Jan 11, 2022 at 09:08:23PM +0100, 'Philip Rinn' via linux-sunxi
>>> wrote:
>>
>>>> Enable the audio hardware on the Olimex A64-OLinuXino board family.
>>>> Tested on the A64-OLinuXino-2Ge8G-IND variant.
>>>
>>>
>>> I have similar patch in one of my "long forgotten branches", but I'm not
>>> 100%
>>> sure whether the cpvdd-supply is required for codec_analog. IIRC,
>>> sound worked for me without the issues on A64-Olinuxino board (Rev D).
>>>
>>> 'cpvdd-supply = <&reg_eldo1>' for codec_analog
>>
>>
>> I didn't test it without but as it is present for all other a64 board with
>> audio and also in Olimex' tree I think it is needed.
>
> It's not question if it works with or without it, nor if other boards have it
> or not. Only deciding factor is board design. On schematic it can be seen that
> cpvdd is connected to eldo1, so having this property is correct, mandatory
> even.

Very true and it's easy to verify with the schematic available: https://raw.githubusercontent.com/OLIMEX/OLINUXINO/master/HARDWARE/A64-OLinuXino/1.%20Latest%20hardware%20revision/A64-OLinuXino%20hardware%20revision%20E/A64-OlinuXino_Rev_E.pdf

So from my point of view the patch is correct.

Best regards
Philip
OpenPGP_signature

Philip Rinn

unread,
Mar 24, 2022, 12:28:55 PM3/24/22
to max...@cerno.tech, jernej....@gmail.com, linux-ar...@lists.infradead.org, linux...@googlegroups.com, we...@csie.org
Hi,

any chance this patch get applied? It seems it will not make it into
5.18 ... what did I miss?

Best regards
Philip

Jernej Škrabec

unread,
Mar 26, 2022, 2:45:39 AM3/26/22
to max...@cerno.tech, linux-ar...@lists.infradead.org, linux...@googlegroups.com, we...@csie.org, Philip Rinn
Hi,

Dne četrtek, 24. marec 2022 ob 17:28:50 CET je Philip Rinn napisal(a):
> Hi,
>
> any chance this patch get applied? It seems it will not make it into
> 5.18 ... what did I miss?

Not much, sometimes patches are overlooked. I'll review it again, and if
everthing is fine, it will be applied for 5.19 once 5.18-rc1 is out.

Sorry for taking it so long.

Best regards,
Jernej

Samuel Holland

unread,
Apr 6, 2022, 10:49:12 PM4/6/22
to Philip Rinn, jernej....@gmail.com, max...@cerno.tech, linux-ar...@lists.infradead.org, linux...@googlegroups.com, we...@csie.org
According to the schematic, both sides of the microphone jack are biased to
MBIAS. Otherwise, this patch looks good to me.

Regards,
Samuel

Jernej Škrabec

unread,
Apr 7, 2022, 1:02:54 AM4/7/22
to Philip Rinn, Samuel Holland, max...@cerno.tech, linux-ar...@lists.infradead.org, linux...@googlegroups.com, we...@csie.org
Dne četrtek, 07. april 2022 ob 04:49:03 CEST je Samuel Holland napisal(a):
> On 1/12/22 9:49 AM, Philip Rinn wrote:
> > Enable the audio hardware on the Olimex A64-OLinuXino board family.
> > Tested on the A64-OLinuXino-2Ge8G-IND variant.

Please also update recipients, there were some maintainer changes recently and
you're missing official linux-sunxi ML (not google groups). scripts/
get_maintainer.pl is your friend here.

Best regards,
Jernej
Reply all
Reply to author
Forward
0 new messages