diff mbox series

[2/3] arm64: dts: renesas: rzg2l-smarc: Enable HDMI audio

Message ID 20240725084559.13127-3-biju.das.jz@bp.renesas.com (mailing list archive)
State New, archived
Headers show
Series Add HDMI Audio support | expand

Commit Message

Biju Das July 25, 2024, 8:45 a.m. UTC
Enable HDMI audio on RZ/{G2L,V2L} SMARC EVK.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
 .../dts/renesas/rzg2l-smarc-pinfunction.dtsi  |  7 +++++
 arch/arm64/boot/dts/renesas/rzg2l-smarc.dtsi  | 30 +++++++++++++++++++
 2 files changed, 37 insertions(+)

Comments

Geert Uytterhoeven Aug. 23, 2024, 9:59 a.m. UTC | #1
Hi Biju,

On Thu, Jul 25, 2024 at 10:46 AM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> Enable HDMI audio on RZ/{G2L,V2L} SMARC EVK.
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>

Thanks for your patch!

> --- a/arch/arm64/boot/dts/renesas/rzg2l-smarc-pinfunction.dtsi
> +++ b/arch/arm64/boot/dts/renesas/rzg2l-smarc-pinfunction.dtsi
> @@ -143,6 +143,13 @@ ssi0_pins: ssi0 {
>                          <RZG2L_PORT_PINMUX(45, 3, 1)>; /* RXD */
>         };
>
> +       ssi1_pins: ssi1 {
> +               pinmux = <RZG2L_PORT_PINMUX(46, 0, 1)>, /* BCK */
> +                        <RZG2L_PORT_PINMUX(46, 1, 1)>, /* RCK */
> +                        <RZG2L_PORT_PINMUX(46, 2, 1)>, /* TXD */
> +                        <RZG2L_PORT_PINMUX(46, 3, 1)>; /* RXD */

RXD/I2S2_SDIN is not wired on the carrier board.
OK to drop it?

The rest LGTM (but I'm no audio bindings expert).

Gr{oetje,eeting}s,

                        Geert


--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Biju Das Aug. 23, 2024, 10:38 a.m. UTC | #2
Hi Geert,

Thanks for the feedback.

> -----Original Message-----
> From: Geert Uytterhoeven <geert@linux-m68k.org>
> Sent: Friday, August 23, 2024 10:59 AM
> Subject: Re: [PATCH 2/3] arm64: dts: renesas: rzg2l-smarc: Enable HDMI audio
> 
> Hi Biju,
> 
> On Thu, Jul 25, 2024 at 10:46 AM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > Enable HDMI audio on RZ/{G2L,V2L} SMARC EVK.
> >
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> 
> Thanks for your patch!
> 
> > --- a/arch/arm64/boot/dts/renesas/rzg2l-smarc-pinfunction.dtsi
> > +++ b/arch/arm64/boot/dts/renesas/rzg2l-smarc-pinfunction.dtsi
> > @@ -143,6 +143,13 @@ ssi0_pins: ssi0 {
> >                          <RZG2L_PORT_PINMUX(45, 3, 1)>; /* RXD */
> >         };
> >
> > +       ssi1_pins: ssi1 {
> > +               pinmux = <RZG2L_PORT_PINMUX(46, 0, 1)>, /* BCK */
> > +                        <RZG2L_PORT_PINMUX(46, 1, 1)>, /* RCK */
> > +                        <RZG2L_PORT_PINMUX(46, 2, 1)>, /* TXD */
> > +                        <RZG2L_PORT_PINMUX(46, 3, 1)>; /* RXD */
> 
> RXD/I2S2_SDIN is not wired on the carrier board.
> OK to drop it?

Yes, it can be dropped as it is not wired on the Carrier.
I will send a patch dropping this.

Cheers,
Biju
Biju Das Aug. 23, 2024, 10:51 a.m. UTC | #3
Hi All,

> -----Original Message-----
> From: Geert Uytterhoeven <geert@linux-m68k.org>
> Sent: Friday, August 23, 2024 10:59 AM
> Subject: Re: [PATCH 2/3] arm64: dts: renesas: rzg2l-smarc: Enable HDMI audio
> 
> Hi Biju,
> 
> On Thu, Jul 25, 2024 at 10:46 AM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > Enable HDMI audio on RZ/{G2L,V2L} SMARC EVK.
> >
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> 
> Thanks for your patch!
> 
> > --- a/arch/arm64/boot/dts/renesas/rzg2l-smarc-pinfunction.dtsi
> > +++ b/arch/arm64/boot/dts/renesas/rzg2l-smarc-pinfunction.dtsi
> > @@ -143,6 +143,13 @@ ssi0_pins: ssi0 {
> >                          <RZG2L_PORT_PINMUX(45, 3, 1)>; /* RXD */
> >         };
> >
> > +       ssi1_pins: ssi1 {
> > +               pinmux = <RZG2L_PORT_PINMUX(46, 0, 1)>, /* BCK */
> > +                        <RZG2L_PORT_PINMUX(46, 1, 1)>, /* RCK */
> > +                        <RZG2L_PORT_PINMUX(46, 2, 1)>, /* TXD */
> > +                        <RZG2L_PORT_PINMUX(46, 3, 1)>; /* RXD */
> 
> RXD/I2S2_SDIN is not wired on the carrier board.
> OK to drop it?
> 
> The rest LGTM (but I'm no audio bindings expert).

Is dt binding check allows conditional macros?

Based on switch position audio signal ssi0 is routed to Audio codec
Or ssi1 is routed to HDMI audio port

The former one does not use graph where as latter one uses audio graph
How do I describe this in bindings?

like dts, something like below supported in dt bindings??

#if X
Audio codec
#else
HDMI Audio
#endif

Cheers,
Biju
Biju Das Aug. 23, 2024, 11:04 a.m. UTC | #4
> -----Original Message-----
> From: Biju Das <biju.das.jz@bp.renesas.com>
> Sent: Friday, August 23, 2024 11:51 AM
> To: Geert Uytterhoeven <geert@linux-m68k.org>; Rob Herring <robh@kernel.org>; Krzysztof Kozlowski
> <krzk+dt@kernel.org>; Conor Dooley <conor+dt@kernel.org>
> Cc: Liam Girdwood <lgirdwood@gmail.com>; Mark Brown <broonie@kernel.org>; Magnus Damm
> <magnus.damm@gmail.com>; linux-sound@vger.kernel.org; devicetree@vger.kernel.org; linux-renesas-
> soc@vger.kernel.org; Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>; biju.das.au
> <biju.das.au@gmail.com>
> Subject: RE: [PATCH 2/3] arm64: dts: renesas: rzg2l-smarc: Enable HDMI audio
> 
> Hi All,
> 
> > -----Original Message-----
> > From: Geert Uytterhoeven <geert@linux-m68k.org>
> > Sent: Friday, August 23, 2024 10:59 AM
> > Subject: Re: [PATCH 2/3] arm64: dts: renesas: rzg2l-smarc: Enable HDMI
> > audio
> >
> > Hi Biju,
> >
> > On Thu, Jul 25, 2024 at 10:46 AM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > > Enable HDMI audio on RZ/{G2L,V2L} SMARC EVK.
> > >
> > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> >
> > Thanks for your patch!
> >
> > > --- a/arch/arm64/boot/dts/renesas/rzg2l-smarc-pinfunction.dtsi
> > > +++ b/arch/arm64/boot/dts/renesas/rzg2l-smarc-pinfunction.dtsi
> > > @@ -143,6 +143,13 @@ ssi0_pins: ssi0 {
> > >                          <RZG2L_PORT_PINMUX(45, 3, 1)>; /* RXD */
> > >         };
> > >
> > > +       ssi1_pins: ssi1 {
> > > +               pinmux = <RZG2L_PORT_PINMUX(46, 0, 1)>, /* BCK */
> > > +                        <RZG2L_PORT_PINMUX(46, 1, 1)>, /* RCK */
> > > +                        <RZG2L_PORT_PINMUX(46, 2, 1)>, /* TXD */
> > > +                        <RZG2L_PORT_PINMUX(46, 3, 1)>; /* RXD */
> >
> > RXD/I2S2_SDIN is not wired on the carrier board.
> > OK to drop it?
> >
> > The rest LGTM (but I'm no audio bindings expert).
> 

The below comment is for RZ/G2LC SoC, where switch postion determines whether ssi0 signal is connected to
Audio codec or to the HDMI audio.

> Is dt binding check allows conditional macros?
> 
> Based on switch position audio signal ssi0 is routed to Audio codec Or routed to HDMI audio
> port
> 
> The former one does not use graph where as latter one uses audio graph How do I describe this in
> bindings?
> 
> like dts, something like below supported in dt bindings??
> 
> #if X
> Audio codec
> #else
> HDMI Audio
> #endif
> 
> Cheers,
> Biju
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/renesas/rzg2l-smarc-pinfunction.dtsi b/arch/arm64/boot/dts/renesas/rzg2l-smarc-pinfunction.dtsi
index 18c526c7a4cf..8c80bd0df5da 100644
--- a/arch/arm64/boot/dts/renesas/rzg2l-smarc-pinfunction.dtsi
+++ b/arch/arm64/boot/dts/renesas/rzg2l-smarc-pinfunction.dtsi
@@ -143,6 +143,13 @@  ssi0_pins: ssi0 {
 			 <RZG2L_PORT_PINMUX(45, 3, 1)>; /* RXD */
 	};
 
+	ssi1_pins: ssi1 {
+		pinmux = <RZG2L_PORT_PINMUX(46, 0, 1)>, /* BCK */
+			 <RZG2L_PORT_PINMUX(46, 1, 1)>, /* RCK */
+			 <RZG2L_PORT_PINMUX(46, 2, 1)>, /* TXD */
+			 <RZG2L_PORT_PINMUX(46, 3, 1)>; /* RXD */
+	};
+
 	usb0_pins: usb0 {
 		pinmux = <RZG2L_PORT_PINMUX(4, 0, 1)>, /* VBUS */
 			 <RZG2L_PORT_PINMUX(5, 0, 1)>, /* OVC */
diff --git a/arch/arm64/boot/dts/renesas/rzg2l-smarc.dtsi b/arch/arm64/boot/dts/renesas/rzg2l-smarc.dtsi
index 887dffe14910..ee3d96fdb616 100644
--- a/arch/arm64/boot/dts/renesas/rzg2l-smarc.dtsi
+++ b/arch/arm64/boot/dts/renesas/rzg2l-smarc.dtsi
@@ -30,6 +30,12 @@  hdmi_con_out: endpoint {
 			};
 		};
 	};
+
+	sound_card {
+		compatible = "audio-graph-card";
+		label = "HDMI-Audio";
+		dais = <&i2s2_port>;
+	};
 };
 
 &cpu_dai {
@@ -88,6 +94,13 @@  adv7535_out: endpoint {
 					remote-endpoint = <&hdmi_con_out>;
 				};
 			};
+
+			port@2 {
+				reg = <2>;
+				codec_endpoint: endpoint {
+					remote-endpoint = <&i2s2_cpu_endpoint>;
+				};
+			};
 		};
 	};
 };
@@ -170,6 +183,23 @@  &ssi0 {
 	status = "okay";
 };
 
+&ssi1 {
+	pinctrl-0 = <&ssi1_pins>;
+	pinctrl-names = "default";
+
+	status = "okay";
+
+	i2s2_port: port {
+		i2s2_cpu_endpoint: endpoint {
+			remote-endpoint = <&codec_endpoint>;
+			dai-format = "i2s";
+
+			bitclock-master = <&i2s2_cpu_endpoint>;
+			frame-master = <&i2s2_cpu_endpoint>;
+		};
+	};
+};
+
 &vccq_sdhi1 {
 	gpios = <&pinctrl RZG2L_GPIO(39, 1) GPIO_ACTIVE_HIGH>;
 };