diff mbox series

[5/5] arm64: dts: rockchip: enable rk809 audio codec on the NanoPi R5 series

Message ID 20230315160228.2362-6-cnsztl@gmail.com (mailing list archive)
State New, archived
Headers show
Series arm64: dts: rockchip: improve support for NanoPi R5 series | expand

Commit Message

Tianling Shen March 15, 2023, 4:02 p.m. UTC
Enable the Rockchip RK809 audio codec on the NanoPi R5 series.

Signed-off-by: Tianling Shen <cnsztl@gmail.com>
---
 .../boot/dts/rockchip/rk3568-nanopi-r5s.dtsi      | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

Comments

Vasily Khoruzhick March 15, 2023, 11:54 p.m. UTC | #1
On Wed, Mar 15, 2023 at 9:03 AM Tianling Shen <cnsztl@gmail.com> wrote:

Hi Tianling,

> +       rk809-sound {

There is no audio jack on my R5S, see [1] and I don't see it on R5C
either, see [2]. I don't see audio output on the pin header either.
How is it supposed to work?

> +               compatible = "simple-audio-card";
> +               simple-audio-card,format = "i2s";
> +               simple-audio-card,name = "Analog RK809";
> +               simple-audio-card,mclk-fs = <256>;
> +
> +               simple-audio-card,cpu {
> +                       sound-dai = <&i2s1_8ch>;
> +               };
> +
> +               simple-audio-card,codec {
> +                       sound-dai = <&rk809>;

It looks like rk809 doesn't have #sound-dai-cells property and it
results in a warning:

arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dtsi:48.27-50.5:
Warning (sound_dai_property): /rk809-sound/simple-audio-card,codec:
Missing property '#sound-dai-cells' in node /i2c@fdd40000/pmic@20 or
bad phandle (referred from sound-dai[0])

Regards,
Vasily

[1] https://wiki.friendlyelec.com/wiki/index.php/NanoPi_R5S
[2] https://wiki.friendlyelec.com/wiki/index.php/NanoPi_R5C
Tianling Shen March 16, 2023, 6:25 a.m. UTC | #2
Hi,

On Thu, Mar 16, 2023 at 7:54 AM Vasily Khoruzhick <anarsoul@gmail.com> wrote:
>
> On Wed, Mar 15, 2023 at 9:03 AM Tianling Shen <cnsztl@gmail.com> wrote:
>
> Hi Tianling,
>
> > +       rk809-sound {
>
> There is no audio jack on my R5S, see [1] and I don't see it on R5C
> either, see [2]. I don't see audio output on the pin header either.
> How is it supposed to work?

I was confused by the vendor dts. I found them enabled rk809 audio
codec [1],but also disabled
the I2S1 TDM audio controller. I'm not sure what they want to do.

But from my side I agree this should not be added. And the i2s1_8ch
node in current dts
should be removed as well.

Thanks,
Tianling.

1. https://github.com/friendlyarm/kernel-rockchip/blob/2b22fccccb0c6ff18a6c952fe81e13ba4c9ba6a1/arch/arm64/boot/dts/rockchip/rk3568-nanopi5-common.dtsi#L125-L138
2. https://github.com/friendlyarm/kernel-rockchip/blob/2b22fccccb0c6ff18a6c952fe81e13ba4c9ba6a1/arch/arm64/boot/dts/rockchip/rk3568-nanopi5-common.dtsi#L592-L600

>
> > +               compatible = "simple-audio-card";
> > +               simple-audio-card,format = "i2s";
> > +               simple-audio-card,name = "Analog RK809";
> > +               simple-audio-card,mclk-fs = <256>;
> > +
> > +               simple-audio-card,cpu {
> > +                       sound-dai = <&i2s1_8ch>;
> > +               };
> > +
> > +               simple-audio-card,codec {
> > +                       sound-dai = <&rk809>;
>
> It looks like rk809 doesn't have #sound-dai-cells property and it
> results in a warning:
>
> arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dtsi:48.27-50.5:
> Warning (sound_dai_property): /rk809-sound/simple-audio-card,codec:
> Missing property '#sound-dai-cells' in node /i2c@fdd40000/pmic@20 or
> bad phandle (referred from sound-dai[0])

Yeah, I did miss some properties here. There are some minor differences between
vendor bindings and upstream ones.

>
> Regards,
> Vasily
>
> [1] https://wiki.friendlyelec.com/wiki/index.php/NanoPi_R5S
> [2] https://wiki.friendlyelec.com/wiki/index.php/NanoPi_R5C
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dtsi b/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dtsi
index dd9a7907a1c5..8e1a118ae2e3 100644
--- a/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dtsi
@@ -35,6 +35,21 @@ 
 		};
 	};
 
+	rk809-sound {
+		compatible = "simple-audio-card";
+		simple-audio-card,format = "i2s";
+		simple-audio-card,name = "Analog RK809";
+		simple-audio-card,mclk-fs = <256>;
+
+		simple-audio-card,cpu {
+			sound-dai = <&i2s1_8ch>;
+		};
+
+		simple-audio-card,codec {
+			sound-dai = <&rk809>;
+		};
+	};
+
 	vdd_usbc: vdd-usbc-regulator {
 		compatible = "regulator-fixed";
 		regulator-name = "vdd_usbc";