[PATCH v3 16/16] ASoC: rich-graph-card-sample.dtsi: add Codec2Codec sample (Multi)

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Fri Sep 10 03:23:22 CEST 2021


From: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>

This patch adds Codec2Codec-Multi sample to rich-graph-card-sample.dtsi.
Because it can use very basic connection only for now,
it can use only

	- 2channels
	- S32_LE format

Test-Component driver has "IN" and "OUT" widget. Thus the route is

	+--+    +-+
	|  |    | |- Codec8 <- IN
	|  | <- | |- Codec9 <- IN
	|  |    +-+
	|  |
	|  |    +-+
	|  | -> | |- Codec10 -> OUT
	|  |    | |- Codec11 -> OUT
	+--+    +-+

One note here is that it will start works when it boot.
In other words we can't stop it so far.
We need to update driver for it in the future.

	...
	asoc-rich-graph-card rich-graph-card-sample: multicodec <-> multicpu mapping ok
	test-component test_codec: test_dai_startup() : test_codec.9
	test-component test_codec: test_dai_startup() : test_codec.8
	test-component test_codec: test_dai_startup() : test_codec.11
	test-component test_codec: test_dai_startup() : test_codec.10
	...

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
---
 sound/soc/generic/rich-graph-card-sample.dtsi | 43 ++++++++++++++++++-
 1 file changed, 42 insertions(+), 1 deletion(-)

diff --git a/sound/soc/generic/rich-graph-card-sample.dtsi b/sound/soc/generic/rich-graph-card-sample.dtsi
index f67adae0322c..902642e61882 100644
--- a/sound/soc/generic/rich-graph-card-sample.dtsi
+++ b/sound/soc/generic/rich-graph-card-sample.dtsi
@@ -53,6 +53,20 @@ / {
 	 *			   +- at -> codec6
 	 *			   |
 	 *			   +---> codec7
+	 *
+	 * [Codec2Codec-Multi]
+	 *
+	 * --NOTE--
+	 * Multi connect N:M is not supported by ASoC.
+	 *
+	 *				+-+
+	 *			   +- at ->| |-> codec8
+	 *			   |	| |-> codec9
+	 *			   |	+-+
+	 *			   |	+-+
+	 *			   +--->| |-> codec10
+	 *				| |-> codec11
+	 *				+-+
 	 */
 	rich-graph-card-sample {
 		/*
@@ -80,13 +94,19 @@ rich-graph-card-sample {
 			  "DAI6 Capture",	"TC DAI5 Capture",
 			/* for [Codec2Codec] */
 			  "TC OUT",		"TC DAI7 Playback",
-			  "TC DAI6 Capture",	"TC IN";
+			  "TC DAI6 Capture",	"TC IN",
+			/* for [Codec2Codec-Multi] */
+			  "TC OUT",		"TC DAI10 Playback",
+			  "TC DAI8 Capture",	"TC IN",
+			  "TC OUT",		"TC DAI11 Playback",
+			  "TC DAI9 Capture",	"TC IN";
 
 		links = <&cpu0			/* normal: cpu side only */
 			 &mcpu0			/* multi:  cpu side only */
 			 &fe00 &fe01 &be0	/* dpcm:   both FE / BE  */
 			 &fe10 &fe11 &be1	/* dpcm-m: both FE / BE  */
 			 &c2c			/* c2c:    cpu side only */
+			 &c2c_m			/* c2c:    cpu side only */
 		>;
 
 		multi {
@@ -105,6 +125,16 @@ ports at 2 {
 				port at 1 { mbe1_ep: endpoint { remote-endpoint = <&codec4_ep>; }; };
 				port at 2 { mbe2_ep: endpoint { remote-endpoint = <&codec5_ep>; }; };
 			};
+			ports at 3 {
+				port at 0 { mc2c0_ep:  endpoint { remote-endpoint = <&c2cmf_ep>;  }; };
+				port at 1 { mc2c00_ep: endpoint { remote-endpoint = <&codec8_ep>; }; };
+				port at 2 { mc2c01_ep: endpoint { remote-endpoint = <&codec9_ep>; }; };
+			};
+			ports at 4 {
+				port at 0 { mc2c1_ep:  endpoint { remote-endpoint = <&c2cmb_ep>;  }; };
+				port at 1 { mc2c10_ep: endpoint { remote-endpoint = <&codec10_ep>; }; };
+				port at 2 { mc2c11_ep: endpoint { remote-endpoint = <&codec11_ep>; }; };
+			};
 		};
 
 		dpcm {
@@ -128,6 +158,11 @@ ports at 0 {
 			c2c:	port at 0 { c2cf_ep: endpoint { remote-endpoint = <&codec6_ep>; }; };
 				port at 1 { c2cb_ep: endpoint { remote-endpoint = <&codec7_ep>; }; };
 			};
+			ports at 1 {
+				rate = <48000>;
+			c2c_m:	port at 0 { c2cmf_ep: endpoint { remote-endpoint = <&mc2c0_ep>; }; };
+				port at 1 { c2cmb_ep: endpoint { remote-endpoint = <&mc2c1_ep>; }; };
+			};
 		};
 	};
 
@@ -179,6 +214,12 @@ ports {
 				  frame-master;
 				  codec6_ep:  endpoint { remote-endpoint = <&c2cf_ep>; }; };
 			port at 7  { codec7_ep:  endpoint { remote-endpoint = <&c2cb_ep>; }; };
+			port at 8  { bitclock-master;
+				  frame-master;
+				  codec8_ep:  endpoint { remote-endpoint = <&mc2c00_ep>; }; };
+			port at 9  { codec9_ep:  endpoint { remote-endpoint = <&mc2c01_ep>; }; };
+			port at 10 { codec10_ep: endpoint { remote-endpoint = <&mc2c10_ep>; }; };
+			port at 11 { codec11_ep: endpoint { remote-endpoint = <&mc2c11_ep>; }; };
 		};
 	};
 };
-- 
2.25.1



More information about the Alsa-devel mailing list