Commit d70be079 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Geert Uytterhoeven
Browse files

arm64: dts: renesas: ulcb/kf: Use multi Component sound



	+-- 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)
	    ^ ^

However, because of ASoC Component vs. Card framework limitations, we
needed to handle this as "1 big Sound Card":

	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 supports multi Component, which allows us to handle "2 Sound
Cards" such as "ULCB Sound Card" and "Kingfisher Sound Card", all
ULCB/KF Audio dtsi can be updated.

Note that this changes the Sound Card specification method from
userland, especially for Kingfisher Sound.

Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/87fs382yhk.wl-kuninori.morimoto.gx@renesas.com


Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
parent 98537eb7
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -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>;
+11 −6
Original line number Diff line number Diff line
@@ -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>;
		rsnd_port0: port@0 {

	ports@0 {
		#address-cells = <1>;
		#size-cells = <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
			 */
+7 −6
Original line number Diff line number Diff line
@@ -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,10 +75,14 @@ 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
		 */
+2 −2
Original line number Diff line number Diff line
@@ -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   */
		>;
};
+29 −28
Original line number Diff line number Diff line
@@ -19,33 +19,32 @@
 *
 *	(A) aplay   -D plughw:0,0 xxx.wav (MIX-0)
 *	(B) aplay   -D plughw:0,1 xxx.wav (MIX-1)
 *	(C) aplay   -D plughw:0,2 xxx.wav (TDM-0)
 *	(D) aplay   -D plughw:0,3 xxx.wav (TDM-1)
 *	(E) aplay   -D plughw:0,4 xxx.wav (TDM-2)
 *	(F) aplay   -D plughw:0,5 xxx.wav (TDM-3)
 *	(C) aplay   -D plughw:1,0 xxx.wav (TDM-0)
 *	(D) aplay   -D plughw:1,1 xxx.wav (TDM-1)
 *	(E) aplay   -D plughw:1,2 xxx.wav (TDM-2)
 *	(F) aplay   -D plughw:1,3 xxx.wav (TDM-3)
 *
 *	(A) arecord -D plughw:0,0 xxx.wav
 *	(G) arecord -D plughw:0,6 xxx.wav
 *	(G) arecord -D plughw:1,4 xxx.wav
 */
/ {
	sound_card_kf: expand-sound {
		compatible = "audio-graph-scu-card";
		label = "snd-kf-split";

&sound_card {
	routing = "ak4613 Playback",   "DAI0 Playback",
		  "ak4613 Playback",   "DAI1 Playback",
		  "DAI0 Capture",      "ak4613 Capture",
		  "pcm3168a Playback", "DAI2 Playback",
		routing = "pcm3168a Playback", "DAI2 Playback",
			  "pcm3168a Playback", "DAI3 Playback",
			  "pcm3168a Playback", "DAI4 Playback",
			  "pcm3168a Playback", "DAI5 Playback";

	dais = <&rsnd_port0 /* (A) CPU0 */
		&rsnd_port1 /* (B) CPU1 */
		&rsnd_port2 /* (C) CPU2 */
		&rsnd_port3 /* (D) CPU3 */
		&rsnd_port4 /* (E) CPU4 */
		&rsnd_port5 /* (F) CPU5 */
		&rsnd_port6 /* (G) GPU6 */
		dais = <&snd_kf1 /* (C) CPU2 */
			&snd_kf2 /* (D) CPU3 */
			&snd_kf3 /* (E) CPU4 */
			&snd_kf4 /* (F) CPU5 */
			&snd_kf5 /* (G) GPU6 */
		>;
	};
};

&pcm3168a {
	ports {
@@ -103,13 +102,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
		 */
		rsnd_port2: port@2 {
		snd_kf1: port@2 {
			reg = <2>;
			rsnd_for_pcm3168a_play1: endpoint {
				remote-endpoint = <&pcm3168a_endpoint_p1>;
@@ -121,7 +122,7 @@ rsnd_for_pcm3168a_play1: endpoint {
		/*
		 * (D) CPU3
		 */
		rsnd_port3: port@3 {
		snd_kf2: port@3 {
			reg = <3>;
			rsnd_for_pcm3168a_play2: endpoint {
				remote-endpoint = <&pcm3168a_endpoint_p2>;
@@ -133,7 +134,7 @@ rsnd_for_pcm3168a_play2: endpoint {
		/*
		 * (E) CPU4
		 */
		rsnd_port4: port@4 {
		snd_kf3: port@4 {
			reg = <4>;
			rsnd_for_pcm3168a_play3: endpoint {
				remote-endpoint = <&pcm3168a_endpoint_p3>;
@@ -145,7 +146,7 @@ rsnd_for_pcm3168a_play3: endpoint {
		/*
		 * (F) CPU5
		 */
		rsnd_port5: port@5 {
		snd_kf4: port@5 {
			reg = <5>;
			rsnd_for_pcm3168a_play4: endpoint {
				remote-endpoint = <&pcm3168a_endpoint_p4>;
@@ -157,7 +158,7 @@ rsnd_for_pcm3168a_play4: endpoint {
		/*
		 * (G) CPU6
		 */
		rsnd_port6: port@6 {
		snd_kf5: port@6 {
			reg = <6>;
			rsnd_for_pcm3168a_capture: endpoint {
				remote-endpoint = <&pcm3168a_endpoint_c>;
Loading