ASoC: audio-graph-card2-custom-sample.dtsi: add Codec2Codec sample (Multi)
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 12 Oct 2021 04:56:35 +0000 (13:56 +0900)
committerMark Brown <broonie@kernel.org>
Fri, 15 Oct 2021 15:10:49 +0000 (16:10 +0100)
This patch adds Codec2Codec-Multi sample to audio-graph-card2-custom-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-audio-graph-card2-custom-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@renesas.com>
Link: https://lore.kernel.org/r/87mtnelu2k.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/generic/audio-graph-card2-custom-sample.dtsi

index f416dea..8eee7b8 100644 (file)
         *                         +-@-> codec6
         *                         |
         *                         +---> codec7
+        *
+        * [Codec2Codec-Multi]
+        *
+        * --NOTE--
+        * Multi connect N:M is not supported by ASoC.
+        *
+        *                              +-+
+        *                         +-@->| |-> codec8
+        *                         |    | |-> codec9
+        *                         |    +-+
+        *                         |    +-+
+        *                         +--->| |-> codec10
+        *                              | |-> codec11
+        *                              +-+
         */
        audio-graph-card2-custom-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 {
                                port@1 { mbe1_ep: endpoint { remote-endpoint = <&codec4_ep>; }; };
                                port@2 { mbe2_ep: endpoint { remote-endpoint = <&codec5_ep>; }; };
                        };
+                       ports@3 {
+                               port@0 { mc2c0_ep:  endpoint { remote-endpoint = <&c2cmf_ep>;  }; };
+                               port@1 { mc2c00_ep: endpoint { remote-endpoint = <&codec8_ep>; }; };
+                               port@2 { mc2c01_ep: endpoint { remote-endpoint = <&codec9_ep>; }; };
+                       };
+                       ports@4 {
+                               port@0 { mc2c1_ep:  endpoint { remote-endpoint = <&c2cmb_ep>;  }; };
+                               port@1 { mc2c10_ep: endpoint { remote-endpoint = <&codec10_ep>; }; };
+                               port@2 { mc2c11_ep: endpoint { remote-endpoint = <&codec11_ep>; }; };
+                       };
                };
 
                dpcm {
                        c2c:    port@0 { c2cf_ep: endpoint { remote-endpoint = <&codec6_ep>; }; };
                                port@1 { c2cb_ep: endpoint { remote-endpoint = <&codec7_ep>; }; };
                        };
+                       ports@1 {
+                               rate = <48000>;
+                       c2c_m:  port@0 { c2cmf_ep: endpoint { remote-endpoint = <&mc2c0_ep>; }; };
+                               port@1 { c2cmb_ep: endpoint { remote-endpoint = <&mc2c1_ep>; }; };
+                       };
                };
        };
 
                                  frame-master;
                                  codec6_ep:  endpoint { remote-endpoint = <&c2cf_ep>; }; };
                        port@7  { codec7_ep:  endpoint { remote-endpoint = <&c2cb_ep>; }; };
+                       port@8  { bitclock-master;
+                                 frame-master;
+                                 codec8_ep:  endpoint { remote-endpoint = <&mc2c00_ep>; }; };
+                       port@9  { codec9_ep:  endpoint { remote-endpoint = <&mc2c01_ep>; }; };
+                       port@10 { codec10_ep: endpoint { remote-endpoint = <&mc2c10_ep>; }; };
+                       port@11 { codec11_ep: endpoint { remote-endpoint = <&mc2c11_ep>; }; };
                };
        };
 };