1 // SPDX-License-Identifier: GPL-2.0
3 * audio-graph-card2-custom-sample.dtsi
5 * Copyright (C) 2020 Renesas Electronics Corp.
6 * Copyright (C) 2020 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
8 * This sample indicates how to use audio-graph-card2 and its
9 * custom driver. "audio-graph-card2-custom-sample" is the custome driver
10 * which is using audio-graph-card2.
12 * You can easily use this sample by adding below line on your DT file,
13 * and add new CONFIG to your .config.
15 * #include "../../../../../sound/soc/generic/audio-graph-card2-custom-sample.dtsi"
17 * CONFIG_SND_AUDIO_GRAPH_CARD2
18 * CONFIG_SND_AUDIO_GRAPH_CARD2_CUSTOM_SAMPLE
19 * CONFIG_SND_TEST_COMPONENT
22 * You can indicate more detail each device behavior as debug if you modify
23 * "compatible" on each test-component. see below
26 * - compatible = "test-cpu";
27 * + compatible = "test-cpu-verbose";
32 * - compatible = "test-codec";
33 * + compatible = "test-codec-verbose";
38 * Below sample doesn't use "format" property,
39 * because test-component driver (test-cpu/test-codec) is supporting
40 * snd_soc_dai_ops :: .auto_selectable_formats.
42 * snd_soc_runtime_get_dai_fmt()
43 * linux/sound/soc/generic/test-component.c :: test_dai_formats
50 * cpu0 <-@-----------------> codec0
57 * cpu7 <-@------->| |-> codec12
63 * cpu1 <--| |<-@--------->| |-> codec1
64 * cpu2 <--| | | |-> codec2
69 * CPU3/CPU4 are converting rate to 44100
73 * cpu3 <-@--* *--@-> codec3
74 * cpu4 <-@--* * (44.1kHz)
80 * Multi-FE is not supported by ASoC.
84 * cpu5 <-@--* *--@-> | | -> codec4
85 * cpu6 <-@--* * | | -> codec5
96 * Multi connect N:M is not supported by ASoC.
107 audio-graph-card2-custom-sample {
109 * You can use audio-graph-card2 directly by using
111 * compatible = "audio-graph-card2";
113 compatible = "audio-graph-card2-custom-sample";
117 routing = "TC DAI3 Playback", "DAI3 Playback",
118 "TC DAI3 Playback", "DAI4 Playback",
119 "DAI3 Capture", "TC DAI3 Capture",
120 "DAI4 Capture", "TC DAI3 Capture",
121 /* for [DPCM-Multi] */
123 "TC DAI4 Playback", "DAI5 Playback",
124 "TC DAI5 Playback", "DAI5 Playback",
125 "TC DAI4 Playback", "DAI6 Playback",
126 "TC DAI5 Playback", "DAI6 Playback",
127 "DAI5 Capture", "TC DAI4 Capture",
128 "DAI5 Capture", "TC DAI5 Capture",
129 "DAI6 Capture", "TC DAI4 Capture",
130 "DAI6 Capture", "TC DAI5 Capture",
131 /* for [Codec2Codec] */
132 "TC OUT", "TC DAI7 Playback",
133 "TC DAI6 Capture", "TC IN",
134 /* for [Codec2Codec-Multi] */
135 "TC OUT", "TC DAI10 Playback",
136 "TC DAI8 Capture", "TC IN",
137 "TC OUT", "TC DAI11 Playback",
138 "TC DAI9 Capture", "TC IN";
142 * [Normal]: cpu side only
151 * [Multi-CPU/Codec]: cpu side only
152 * cpu1/cpu2/codec1/codec2
157 * [DPCM]: both FE / BE
163 * [DPCM-Multi]: both FE / BE
164 * cpu5/cpu6/codec4/codec5
169 * [Codec2Codec]: cpu side only
175 * [Codec2Codec-Multi]: cpu side only
176 * codec8/codec9/codec10/codec11
182 #address-cells = <1>;
187 #address-cells = <1>;
190 mcpu0: port@0 { reg = <0>; mcpu0_ep: endpoint { remote-endpoint = <&mcodec0_ep>; }; };
191 port@1 { reg = <1>; mcpu1_ep: endpoint { remote-endpoint = <&cpu1_ep>; }; };
192 port@2 { reg = <2>; mcpu2_ep: endpoint { remote-endpoint = <&cpu2_ep>; }; };
198 #address-cells = <1>;
200 port@0 { reg = <0>; mcodec0_ep: endpoint { remote-endpoint = <&mcpu0_ep>; }; };
201 port@1 { reg = <1>; mcodec1_ep: endpoint { remote-endpoint = <&codec1_ep>; }; };
202 port@2 { reg = <2>; mcodec2_ep: endpoint { remote-endpoint = <&codec2_ep>; }; };
205 /* [DPCM-Multi]::BE */
208 #address-cells = <1>;
210 port@0 { reg = <0>; mbe_ep: endpoint { remote-endpoint = <&be10_ep>; }; };
211 port@1 { reg = <1>; mbe1_ep: endpoint { remote-endpoint = <&codec4_ep>; }; };
212 port@2 { reg = <2>; mbe2_ep: endpoint { remote-endpoint = <&codec5_ep>; }; };
215 /* [Codec2Codec-Multi]::CPU */
218 #address-cells = <1>;
220 port@0 { reg = <0>; mc2c0_ep: endpoint { remote-endpoint = <&c2cmf_ep>; }; };
221 port@1 { reg = <1>; mc2c00_ep: endpoint { remote-endpoint = <&codec8_ep>; }; };
222 port@2 { reg = <2>; mc2c01_ep: endpoint { remote-endpoint = <&codec9_ep>; }; };
225 /* [Codec2Codec-Multi]::Codec */
228 #address-cells = <1>;
230 port@0 { reg = <0>; mc2c1_ep: endpoint { remote-endpoint = <&c2cmb_ep>; }; };
231 port@1 { reg = <1>; mc2c10_ep: endpoint { remote-endpoint = <&codec10_ep>; }; };
232 port@2 { reg = <2>; mc2c11_ep: endpoint { remote-endpoint = <&codec11_ep>; }; };
238 #address-cells = <1>;
240 port@0 { reg = <0>; smcodec0_ep: endpoint { remote-endpoint = <&cpu7_ep>; }; };
241 port@1 { reg = <1>; smcodec1_ep: endpoint { remote-endpoint = <&codec12_ep>; }; };
242 port@2 { reg = <2>; smcodec2_ep: endpoint { remote-endpoint = <&codec13_ep>; }; };
247 #address-cells = <1>;
253 #address-cells = <1>;
256 fe00: port@0 { reg = <0>; fe00_ep: endpoint { remote-endpoint = <&cpu3_ep>; }; };
257 fe01: port@1 { reg = <1>; fe01_ep: endpoint { remote-endpoint = <&cpu4_ep>; }; };
259 /* [DPCM-Multi]::FE */
260 fe10: port@2 { reg = <2>; fe10_ep: endpoint { remote-endpoint = <&cpu5_ep>; }; };
261 fe11: port@3 { reg = <3>; fe11_ep: endpoint { remote-endpoint = <&cpu6_ep>; }; };
267 #address-cells = <1>;
270 be0: port@0 { reg = <0>; be00_ep: endpoint { remote-endpoint = <&codec3_ep>; }; };
272 /* [DPCM-Multi]::BE */
273 be1: port@1 { reg = <1>; be10_ep: endpoint { remote-endpoint = <&mbe_ep>; }; };
278 #address-cells = <1>;
284 #address-cells = <1>;
287 /* use default settings */
288 c2c: port@0 { reg = <0>; c2cf_ep: endpoint { remote-endpoint = <&codec6_ep>; }; };
289 port@1 { reg = <1>; c2cb_ep: endpoint { remote-endpoint = <&codec7_ep>; }; };
292 /* [Codec2Codec-Multi] */
296 #address-cells = <1>;
299 /* use original settings */
301 c2c_m: port@0 { reg = <0>; c2cmf_ep: endpoint { remote-endpoint = <&mc2c0_ep>; }; };
302 port@1 { reg = <1>; c2cmb_ep: endpoint { remote-endpoint = <&mc2c1_ep>; }; };
309 * update compatible to indicate more detail behaviour
310 * if you want. see test-compatible for more detail.
313 * - compatible = "test-cpu";
314 * + compatible = "test-cpu-verbose";
316 compatible = "test-cpu";
318 #address-cells = <1>;
324 cpu0: port@0 { reg = <0>; cpu0_ep: endpoint { remote-endpoint = <&codec0_ep>; }; };
327 port@1 { reg = <1>; cpu1_ep: endpoint { remote-endpoint = <&mcpu1_ep>; }; };
328 port@2 { reg = <2>; cpu2_ep: endpoint { remote-endpoint = <&mcpu2_ep>; }; };
331 port@3 { reg = <3>; cpu3_ep: endpoint { remote-endpoint = <&fe00_ep>; }; };
332 port@4 { reg = <4>; cpu4_ep: endpoint { remote-endpoint = <&fe01_ep>; }; };
334 /* [DPCM-Multi]::FE */
335 port@5 { reg = <5>; cpu5_ep: endpoint { remote-endpoint = <&fe10_ep>; }; };
336 port@6 { reg = <6>; cpu6_ep: endpoint { remote-endpoint = <&fe11_ep>; }; };
339 sm0: port@7 { reg = <7>; cpu7_ep: endpoint { remote-endpoint = <&smcodec0_ep>; }; };
345 * update compatible to indicate more detail behaviour
346 * if you want. see test-compatible for more detail.
349 * - compatible = "test-codec";
350 * + compatible = "test-codec-verbose";
352 compatible = "test-codec";
354 #address-cells = <1>;
358 * prefix can be added to *component*,
359 * see audio-graph-card2::routing
364 port@0 { reg = <0>; codec0_ep: endpoint { remote-endpoint = <&cpu0_ep>; }; };
367 port@1 { reg = <1>; codec1_ep: endpoint { remote-endpoint = <&mcodec1_ep>; }; };
368 port@2 { reg = <2>; codec2_ep: endpoint { remote-endpoint = <&mcodec2_ep>; }; };
372 convert-rate = <44100>;
373 reg = <3>; codec3_ep: endpoint { remote-endpoint = <&be00_ep>; };
376 /* [DPCM-Multi]::BE */
377 port@4 { reg = <4>; codec4_ep: endpoint { remote-endpoint = <&mbe1_ep>; }; };
378 port@5 { reg = <5>; codec5_ep: endpoint { remote-endpoint = <&mbe2_ep>; }; };
381 port@6 { bitclock-master;
383 reg = <6>; codec6_ep: endpoint { remote-endpoint = <&c2cf_ep>; }; };
384 port@7 { reg = <7>; codec7_ep: endpoint { remote-endpoint = <&c2cb_ep>; }; };
386 /* [Codec2Codec-Multi] */
387 port@8 { bitclock-master;
389 reg = <8>; codec8_ep: endpoint { remote-endpoint = <&mc2c00_ep>; }; };
390 port@9 { reg = <9>; codec9_ep: endpoint { remote-endpoint = <&mc2c01_ep>; }; };
391 port@a { reg = <10>; codec10_ep: endpoint { remote-endpoint = <&mc2c10_ep>; }; };
392 port@b { reg = <11>; codec11_ep: endpoint { remote-endpoint = <&mc2c11_ep>; }; };
395 port@c { reg = <12>; codec12_ep: endpoint { remote-endpoint = <&smcodec1_ep>; }; };
396 port@d { reg = <13>; codec13_ep: endpoint { remote-endpoint = <&smcodec2_ep>; }; };