Skip to contentSkip to conversation

arm64: dts: renesas: use multi Component for ULCB/KF

PATCH Superseded Kuninori Morimoto 2 participants 3 messages Sep 20, 2023

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 arm64: dts: renesas: use multi Component for ULCB/KF

	+-- ULCB -------------------+
	|+--------+       +--------+|
	||    SSI0| <---> |ak4613  ||
	||    SSI1| <---> |        ||
	||        |       +--------+|
	||        |       +--------+|
	||    SSI2| <---> |HDMI    ||
	||        |       +--------+|
	||    SSI3| <--+            |
	||    SSI4| <-+|            |
	|+--------+   ||            |
	+-------------||------------+
	+-- Kingfisher -------------+
	|             ||  +--------+|
	|             |+->|pcm3168a||
	|             +-->|        ||
	|                 +--------+|
	+---------------------------+

On UCLB/KF, we intuitively think we want to handle these as "2 Sound Cards".

	card0,0: 1st sound of ULCB (SSI0 - ak4613)
	card0,1: 2nd sound of ULCB (SSI2 - HDMI)
	card1,0: 1st sound of KF   (SSI3 - pcm3168a)
	    ^ ^

But, we needed to handle it as "1 big Sound Card", because of ASoC Component vs Card framwork limitation.

	card0,0: 1st sound of ULCB/KF (SSI0 - ak4613)
	card0,1: 2nd sound of ULCB/KF (SSI2 - HDMI)
	card0,2: 3rd sound of ULCB/KF (SSI3 - pcm3168a)
	    ^ ^

Now ASoC support multi Component which allow us to handle "2 Sound Cards" such as "ULCB Sound Card" and "Kingfisher Sound Card".

This patch updates all ULCB/KF Audio dtsi.
One note is that Sound Card specification method from userland will be changed, especially for Kingfisher Sound.

---
v1 -> v2

- "ulcb" uses "port@0"
- "ulcb" has #address-cells / #size-cells

 .../ulcb-audio-graph-card-mix+split.dtsi      |  16 +-
 .../dts/renesas/ulcb-audio-graph-card.dtsi    |  17 +-
 .../ulcb-audio-graph-card2-mix+split.dtsi     |  13 +-
 .../dts/renesas/ulcb-audio-graph-card2.dtsi   |   4 +-
 .../ulcb-kf-audio-graph-card-mix+split.dtsi   |  57 +++----
 .../dts/renesas/ulcb-kf-audio-graph-card.dtsi |  27 +--
 .../ulcb-kf-audio-graph-card2-mix+split.dtsi  | 108 ++++++------
 .../renesas/ulcb-kf-audio-graph-card2.dtsi    |  14 +-
 .../ulcb-kf-simple-audio-card-mix+split.dtsi  | 155 +++++++++---------
 .../renesas/ulcb-kf-simple-audio-card.dtsi    |  78 +++++----
 .../ulcb-simple-audio-card-mix+split.dtsi     |   2 +-
 .../dts/renesas/ulcb-simple-audio-card.dtsi   |   2 +-
 12 files changed, 265 insertions(+), 228 deletions(-)
arch/arm64/boot/dts/renesas/ulcb-audio-graph-card-mix+split.dtsi +10 -6
index 672b0a224ef9..be6d7a035739 100644
@@ -21,14 +21,14 @@
 / {
 	sound_card: sound {
 		compatible = "audio-graph-scu-card";
-		label = "rcar-sound";
+		label = "snd-ulcb-mix";
 
 		routing = "ak4613 Playback", "DAI0 Playback",
 			  "ak4613 Playback", "DAI1 Playback",
 			  "DAI0 Capture",    "ak4613 Capture";
 
-		dais = <&rsnd_port0 /* (A) CPU0 */
-			&rsnd_port1 /* (B) CPU1 */
+		dais = <&snd_ulcb1 /* (A) CPU0 */
+			&snd_ulcb2 /* (B) CPU1 */
 		>;
 	};
 };
@@ -58,14 +58,18 @@ ak4613_ep2: endpoint@1 {
 };
 
 &rcar_sound {
-	ports {
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	ports@0 {
 		#address-cells = <1>;
 		#size-cells = <0>;
+		reg = <0>;
 
 		/*
 		 * (A) CPU0
 		 */
-		rsnd_port0: port@0 {
+		snd_ulcb1: port@0 {
 			reg = <0>;
 			rsnd_for_ak4613_1: endpoint {
 				remote-endpoint = <&ak4613_ep1>;
@@ -78,7 +82,7 @@ rsnd_for_ak4613_1: endpoint {
 		/*
 		 * (B) CPU1
 		 */
-		rsnd_port1: port@1 {
+		snd_ulcb2: port@1 {
 			reg = <1>;
 			rsnd_for_ak4613_2: endpoint {
 				remote-endpoint = <&ak4613_ep2>;
arch/arm64/boot/dts/renesas/ulcb-audio-graph-card.dtsi +11 -6
index 3be54df645e6..3f1df6ee17ea 100644
@@ -18,10 +18,10 @@
 / {
 	sound_card: sound {
 		compatible = "audio-graph-card";
-		label = "rcar-sound";
+		label = "snd-ulcb";
 
-		dais = <&rsnd_port0 /* (A) CPU0 <-> ak4613 */
-			&rsnd_port1 /* (B) CPU1  -> HDMI   */
+		dais = <&snd_ulcb1 /* (A) CPU0 <-> ak4613 */
+			&snd_ulcb2 /* (B) CPU1  -> HDMI   */
 		>;
 	};
 };
@@ -53,10 +53,15 @@ dw_hdmi0_snd_in: endpoint {
 };
 
 &rcar_sound {
-	ports {
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	ports@0 {
 		#address-cells = <1>;
 		#size-cells = <0>;
-		rsnd_port0: port@0 {
+		reg = <0>;
+
+		snd_ulcb1: port@0 {
 			/*
 			 * (A) CPU0 <-> ak4613
 			 */
@@ -69,7 +74,7 @@ rsnd_for_ak4613: endpoint {
 				capture  = <&ssi1>, <&src1>, <&dvc1>;
 			};
 		};
-		rsnd_port1: port@1 {
+		snd_ulcb2: port@1 {
 			/*
 			 * (B) CPU1 -> HDMI
 			 */
arch/arm64/boot/dts/renesas/ulcb-audio-graph-card2-mix+split.dtsi +7 -6
index 75b024e3fef1..8966e6a7d28b 100644
@@ -20,13 +20,12 @@
 / {
 	sound_card: sound {
 		compatible = "audio-graph-card2";
-		label = "rcar-sound";
+		label = "snd-ulcb-mix";
 
 		routing = "ak4613 Playback", "DAI0 Playback",
 			  "ak4613 Playback", "DAI1 Playback",
 			  "DAI0 Capture",    "ak4613 Capture";
 
-		/delete-property/ dais;
 		links = <&fe_a		/* (A) CPU0   */
 			 &fe_b		/* (B) CPU1   */
 			 &be_x		/* (X) ak4613 */
@@ -50,14 +49,12 @@ ports@0 {
 			};
 
 			ports@1 {
-				#address-cells = <1>;
-				#size-cells = <0>;
 				reg = <1>;
 				/*
 				 * BE
 				 * (X) ak4613
 				 */
-				be_x: port@0 { reg = <0>; be_x_ep: endpoint { remote-endpoint = <&ak4613_x_ep>; }; };
+				be_x: port { be_x_ep: endpoint { remote-endpoint = <&ak4613_x_ep>; }; };
 			};
 		};
 	};
@@ -78,9 +75,13 @@ ak4613_x_ep: endpoint {
 };
 
 &rcar_sound {
-	ports {
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	ports@0 {
 		#address-cells = <1>;
 		#size-cells = <0>;
+		reg = <0>;
 
 		/*
 		 * (A) CPU0
arch/arm64/boot/dts/renesas/ulcb-audio-graph-card2.dtsi +2 -2
index 5ebec1235843..19fa6e102995 100644
@@ -20,7 +20,7 @@ &sound_card {
 	compatible = "audio-graph-card2";
 
 	/delete-property/ dais;
-	links = <&rsnd_port0	/* (A) CPU0 <-> ak4613 */
-		 &rsnd_port1	/* (B) CPU1  -> HDMI   */
+	links = <&snd_ulcb1	/* (A) CPU0 <-> ak4613 */
+		 &snd_ulcb2	/* (B) CPU1  -> HDMI   */
 		>;
 };
arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card-mix+split.dtsi +29 -28

102 lines not on this page · raw message

arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card.dtsi +16 -11
index 1db99b7608f0..5fbd4ca83e20 100644
@@ -13,18 +13,20 @@
  *
  *	(A) aplay   -D plughw:0,0 xxx.wav
  *	(B) aplay   -D plughw:0,1 xxx.wav
- *	(C) aplay   -D plughw:0,2 xxx.wav
+ *	(C) aplay   -D plughw:1,0 xxx.wav
  *
  *	(A) arecord -D plughw:0,0 xxx.wav
- *	(D) arecord -D plughw:0,3 xxx.wav
+ *	(D) arecord -D plughw:1,1 xxx.wav
  */
+/ {
+	sound_card_kf: expand-sound {
+		compatible = "audio-graph-card";
+		label = "snd-kf";
 
-&sound_card {
-	dais = <&rsnd_port0 /* (A) CPU0 <-> ak4613 */
-		&rsnd_port1 /* (B) CPU1  -> HDMI   */
-		&rsnd_port2 /* (C) CPU2  -> PCM3168A-p */
-		&rsnd_port3 /* (D) CPU3 <-  PCM3168A-c */
+		dais = <&snd_kf1 /* (C) CPU2  -> PCM3168A-p */
+			&snd_kf2 /* (D) CPU3 <-  PCM3168A-c */
 		>;
+	};
 };
 
 &pcm3168a {
@@ -56,12 +58,15 @@ pcm3168a_endpoint_c: endpoint {
 };
 
 &rcar_sound {
-	ports {
-		/* rsnd_port0/1 are defined in ulcb.dtsi */
+	ports@1 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		reg = <1>;
+
 		/*
 		 * (C) CPU2 -> PCM3168A-p
 		 */
-		rsnd_port2: port@2 {
+		snd_kf1: port@2 {
 			reg = <2>;
 			rsnd_for_pcm3168a_play: endpoint {
 				remote-endpoint = <&pcm3168a_endpoint_p>;
@@ -74,7 +79,7 @@ rsnd_for_pcm3168a_play: endpoint {
 		/*
 		 * (D) CPU3 <- PCM3168A-c
 		 */
-		rsnd_port3: port@3 {
+		snd_kf2: port@3 {
 			reg = <3>;
 			rsnd_for_pcm3168a_capture: endpoint {
 				remote-endpoint = <&pcm3168a_endpoint_c>;
arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card2-mix+split.dtsi +57 -51

126 lines not on this page · raw message

arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card2.dtsi +7 -7
index c30e056538e4..4fc229418dd7 100644
@@ -13,18 +13,18 @@
  *
  *	(A) aplay   -D plughw:0,0 xxx.wav
  *	(B) aplay   -D plughw:0,1 xxx.wav
- *	(C) aplay   -D plughw:0,2 xxx.wav
+ *	(C) aplay   -D plughw:1,0 xxx.wav
  *
  *	(A) arecord -D plughw:0,0 xxx.wav
- *	(D) arecord -D plughw:0,3 xxx.wav
+ *	(D) arecord -D plughw:1,1 xxx.wav
  */
 #include "ulcb-kf-audio-graph-card.dtsi"
 
-&sound_card {
+&sound_card_kf {
+	compatible = "audio-graph-card2";
+
 	/delete-property/ dais;
-	links = <&rsnd_port0	/* (A) CPU0 <-> ak4613 */
-		 &rsnd_port1	/* (B) CPU1  -> HDMI   */
-		 &rsnd_port2	/* (C) CPU2  -> PCM3168A-p */
-		 &rsnd_port3	/* (D) CPU3 <-  PCM3168A-c */
+	links = <&snd_kf1 /* (C) CPU2  -> PCM3168A-p */
+		 &snd_kf2 /* (D) CPU3 <-  PCM3168A-c */
 		>;
 };
arch/arm64/boot/dts/renesas/ulcb-kf-simple-audio-card-mix+split.dtsi +81 -74

177 lines not on this page · raw message

arch/arm64/boot/dts/renesas/ulcb-kf-simple-audio-card.dtsi +43 -35

97 lines not on this page · raw message

arch/arm64/boot/dts/renesas/ulcb-simple-audio-card-mix+split.dtsi +1 -1
index 217d89019845..d98624e22126 100644
@@ -24,7 +24,7 @@ sound_card: sound {
 		#size-cells = <0>;
 
 		compatible = "simple-scu-audio-card";
-		label = "rcar-sound";
+		label = "snd-ulcb-mix";
 
 		simple-audio-card,prefix  = "ak4613";
 		simple-audio-card,routing = "ak4613 Playback", "DAI0 Playback",
arch/arm64/boot/dts/renesas/ulcb-simple-audio-card.dtsi +1 -1
index 751cfd8c5257..44a6584ca7d7 100644
@@ -18,7 +18,7 @@
 / {
 	sound_card: sound {
 		compatible = "simple-audio-card";
-		label = "rcar-sound";
+		label = "snd-ulcb";
 
 		#address-cells = <1>;
 		#size-cells = <0>;
Signature · 1 line
2.25.1
#1 lore raw

Hi Morimoto-san,

Quoted 43 lines · Kuninori Morimoto
        +-- ULCB -------------------+
        |+--------+       +--------+|
        ||    SSI0| <---> |ak4613  ||
        ||    SSI1| <---> |        ||
        ||        |       +--------+|
        ||        |       +--------+|
        ||    SSI2| <---> |HDMI    ||
        ||        |       +--------+|
        ||    SSI3| <--+            |
        ||    SSI4| <-+|            |
        |+--------+   ||            |
        +-------------||------------+
        +-- Kingfisher -------------+
        |             ||  +--------+|
        |             |+->|pcm3168a||
        |             +-->|        ||
        |                 +--------+|
        +---------------------------+

On UCLB/KF, we intuitively think we want to handle these as "2 Sound Cards".

        card0,0: 1st sound of ULCB (SSI0 - ak4613)
        card0,1: 2nd sound of ULCB (SSI2 - HDMI)
        card1,0: 1st sound of KF   (SSI3 - pcm3168a)
            ^ ^

But, we needed to handle it as "1 big Sound Card", because of ASoC Component vs Card framwork limitation.

        card0,0: 1st sound of ULCB/KF (SSI0 - ak4613)
        card0,1: 2nd sound of ULCB/KF (SSI2 - HDMI)
        card0,2: 3rd sound of ULCB/KF (SSI3 - pcm3168a)
            ^ ^

Now ASoC support multi Component which allow us to handle "2 Sound Cards" such as "ULCB Sound Card" and "Kingfisher Sound Card".

This patch updates all ULCB/KF Audio dtsi.
One note is that Sound Card specification method from userland will be changed, especially for Kingfisher Sound.

Quoted 6 lines

---
v1 -> v2

- "ulcb" uses "port@0"
- "ulcb" has #address-cells / #size-cells

Thanks for the update!
It looks much better now (I hope it still works?)

arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card2-mix+split.dtsi line 78

Quoted 10 lines
arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card2-mix+split.dtsi +7 -0
 
+                       ports@1 {
+                               reg = <1>;
+                               /*
+                               * BE
+                               *
+                               * (Y) PCM3168A-p
+                               */

checkpath: WARNING: Block comments should align the * on each line

Quoted 9 lines
arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card2-mix+split.dtsi +2 -0
+                       be_y:   port { be_y_ep: endpoint { remote-endpoint = <&pcm3168a_y_ep>; }; };
+                       };
                };
        };
 };

arch/arm64/boot/dts/renesas/ulcb-kf-simple-audio-card-mix+split.dtsi &pcm3168a { · line 125

Quoted 9 lines
arch/arm64/boot/dts/renesas/ulcb-kf-simple-audio-card-mix+split.dtsi +5 -1
@@ -115,7 +118,11 @@ &pcm3168a {
 };
 
 &rcar_sound {
-       rcar_sound,dai {
+       #address-cells = <1>;
+       #size-cells = <0>;
+
+       rcar_sound,dai@1 {
+               reg = <1>;

Can you please make a similar change for "rcar_sound,dai", i.e. use "rcar_sound,dai@0" and add #{address,size}-cells in the ULCB DTS files?

arch/arm64/boot/dts/renesas/ulcb-kf-simple-audio-card-mix+split.dtsi &pcm3168a { · line 128

Quoted 3 lines
arch/arm64/boot/dts/renesas/ulcb-kf-simple-audio-card-mix+split.dtsi +0 -0
                /* dai0-1 are defined in ulcb.dtsi */
 

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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
#2 lore raw

Hi Geert

Quoted 1 line

It looks much better now (I hope it still works?)

I hope so :)

Quoted 9 lines

arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card2-mix+split.dtsi line 78

Quoted 7 lines
arch/arm64/boot/dts/renesas/ulcb-kf-audio-graph-card2-mix+split.dtsi +7 -0
+                       ports@1 {
+                               reg = <1>;
+                               /*
+                               * BE
+                               *
+                               * (Y) PCM3168A-p
+                               */

checkpath: WARNING: Block comments should align the * on each line

Oops, will fix

Quoted 10 lines

arch/arm64/boot/dts/renesas/ulcb-kf-simple-audio-card-mix+split.dtsi &pcm3168a { · line 125

Quoted 7 lines

&rcar_sound {

arch/arm64/boot/dts/renesas/ulcb-kf-simple-audio-card-mix+split.dtsi +5 -1
-       rcar_sound,dai {
+       #address-cells = <1>;
+       #size-cells = <0>;
+
+       rcar_sound,dai@1 {
+               reg = <1>;

Can you please make a similar change for "rcar_sound,dai", i.e. use "rcar_sound,dai@0" and add #{address,size}-cells in the ULCB DTS files?

will fix

Thank you for your help !!

Best regards
---
Kuninori Morimoto