1// SPDX-License-Identifier: GPL-2.0 2/* 3 * audio-graph-card2-custom-sample.dtsi 4 * 5 * Copyright (C) 2020 Renesas Electronics Corp. 6 * Copyright (C) 2020 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> 7 * 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. 11 * 12 * You can easily use this sample by adding below line on your DT file, 13 * and add new CONFIG to your .config. 14 * 15 * #include "../../../../../sound/soc/generic/audio-graph-card2-custom-sample.dtsi" 16 * 17 * CONFIG_SND_AUDIO_GRAPH_CARD2 18 * CONFIG_SND_AUDIO_GRAPH_CARD2_CUSTOM_SAMPLE 19 * CONFIG_SND_TEST_COMPONENT 20 * 21 * 22 * You can indicate more detail each device behavior as debug if you modify 23 * "compatible" on each test-component. see below 24 * 25 * test_cpu { 26 * - compatible = "test-cpu"; 27 * + compatible = "test-cpu-verbose"; 28 * ... 29 * }; 30 * 31 * test_codec { 32 * - compatible = "test-codec"; 33 * + compatible = "test-codec-verbose"; 34 * ... 35 * }; 36 * 37 */ 38/ { 39 /* 40 * @ : used at links 41 * 42 * [Normal] 43 * cpu0 <-@-----------------> codec0 44 * 45 * [Multi-CPU/Codec] 46 * +-+ +-+ 47 * cpu1 <--| |<-@--------->| |-> codec1 48 * cpu2 <--| | | |-> codec2 49 * +-+ +-+ 50 * 51 * [DPCM] 52 * FE BE 53 * **** 54 * cpu3 <-@--* *--@-> codec3 55 * cpu4 <-@--* * 56 * **** 57 * 58 * [DPCM-Multi] 59 * 60 * --NOTE-- 61 * Multi-FE is not supported by ASoC. 62 * 63 * FE BE 64 * **** +-+ 65 * cpu5 <-@--* *--@-> | | -> codec4 66 * cpu6 <-@--* * | | -> codec5 67 * **** +-+ 68 * 69 * [Codec2Codec] 70 * +-@-> codec6 71 * | 72 * +---> codec7 73 * 74 * [Codec2Codec-Multi] 75 * 76 * --NOTE-- 77 * Multi connect N:M is not supported by ASoC. 78 * 79 * +-+ 80 * +-@->| |-> codec8 81 * | | |-> codec9 82 * | +-+ 83 * | +-+ 84 * +--->| |-> codec10 85 * | |-> codec11 86 * +-+ 87 */ 88 audio-graph-card2-custom-sample { 89 /* 90 * You can use audio-graph-card2 directly by using 91 * 92 * compatible = "audio-graph-card2"; 93 */ 94 compatible = "audio-graph-card2-custom-sample"; 95 96 /* for [DPCM] */ 97 /* BE FE */ 98 routing = "TC DAI3 Playback", "DAI3 Playback", 99 "TC DAI3 Playback", "DAI4 Playback", 100 "DAI3 Capture", "TC DAI3 Capture", 101 "DAI4 Capture", "TC DAI3 Capture", 102 /* for [DPCM-Multi] */ 103 /* BE FE */ 104 "TC DAI4 Playback", "DAI5 Playback", 105 "TC DAI5 Playback", "DAI5 Playback", 106 "TC DAI4 Playback", "DAI6 Playback", 107 "TC DAI5 Playback", "DAI6 Playback", 108 "DAI5 Capture", "TC DAI4 Capture", 109 "DAI5 Capture", "TC DAI5 Capture", 110 "DAI6 Capture", "TC DAI4 Capture", 111 "DAI6 Capture", "TC DAI5 Capture", 112 /* for [Codec2Codec] */ 113 "TC OUT", "TC DAI7 Playback", 114 "TC DAI6 Capture", "TC IN", 115 /* for [Codec2Codec-Multi] */ 116 "TC OUT", "TC DAI10 Playback", 117 "TC DAI8 Capture", "TC IN", 118 "TC OUT", "TC DAI11 Playback", 119 "TC DAI9 Capture", "TC IN"; 120 121 links = < 122 /* 123 * [Normal]: cpu side only 124 * cpu0/codec0 125 */ 126 &cpu0 127 128 /* 129 * [Multi-CPU/Codec]: cpu side only 130 * cpu1/cpu2/codec1/codec2 131 */ 132 &mcpu0 133 134 /* 135 * [DPCM]: both FE / BE 136 * cpu3/cpu4/codec3 137 */ 138 &fe00 &fe01 &be0 139 140 /* 141 * [DPCM-Multi]: both FE / BE 142 * cpu5/cpu6/codec4/codec5 143 */ 144 &fe10 &fe11 &be1 145 146 /* 147 * [Codec2Codec]: cpu side only 148 * codec6/codec7 149 */ 150 &c2c 151 152 /* 153 * [Codec2Codec-Multi]: cpu side only 154 * codec8/codec9/codec10/codec11 155 */ 156 &c2c_m 157 >; 158 159 multi { 160 ports@0 { 161 /* [Multi-CPU] */ 162 mcpu0: port@0 { mcpu0_ep: endpoint { remote-endpoint = <&mcodec0_ep>; }; }; 163 port@1 { mcpu1_ep: endpoint { remote-endpoint = <&cpu1_ep>; }; }; 164 port@2 { mcpu2_ep: endpoint { remote-endpoint = <&cpu2_ep>; }; }; 165 }; 166 167 /* [Multi-Codec] */ 168 ports@1 { 169 port@0 { mcodec0_ep: endpoint { remote-endpoint = <&mcpu0_ep>; }; }; 170 port@1 { mcodec1_ep: endpoint { remote-endpoint = <&codec1_ep>; }; }; 171 port@2 { mcodec2_ep: endpoint { remote-endpoint = <&codec2_ep>; }; }; 172 }; 173 174 /* [DPCM-Multi]::BE */ 175 ports@2 { 176 port@0 { mbe_ep: endpoint { remote-endpoint = <&be10_ep>; }; }; 177 port@1 { mbe1_ep: endpoint { remote-endpoint = <&codec4_ep>; }; }; 178 port@2 { mbe2_ep: endpoint { remote-endpoint = <&codec5_ep>; }; }; 179 }; 180 181 /* [Codec2Codec-Multi]::CPU */ 182 ports@3 { 183 port@0 { mc2c0_ep: endpoint { remote-endpoint = <&c2cmf_ep>; }; }; 184 port@1 { mc2c00_ep: endpoint { remote-endpoint = <&codec8_ep>; }; }; 185 port@2 { mc2c01_ep: endpoint { remote-endpoint = <&codec9_ep>; }; }; 186 }; 187 188 /* [Codec2Codec-Multi]::Codec */ 189 ports@4 { 190 port@0 { mc2c1_ep: endpoint { remote-endpoint = <&c2cmb_ep>; }; }; 191 port@1 { mc2c10_ep: endpoint { remote-endpoint = <&codec10_ep>; }; }; 192 port@2 { mc2c11_ep: endpoint { remote-endpoint = <&codec11_ep>; }; }; 193 }; 194 }; 195 196 dpcm { 197 ports@0 { 198 /* [DPCM]::FE */ 199 fe00: port@0 { fe00_ep: endpoint { remote-endpoint = <&cpu3_ep>; }; }; 200 fe01: port@1 { fe01_ep: endpoint { remote-endpoint = <&cpu4_ep>; }; }; 201 202 /* [DPCM-Multi]::FE */ 203 fe10: port@2 { fe10_ep: endpoint { remote-endpoint = <&cpu5_ep>; }; }; 204 fe11: port@3 { fe11_ep: endpoint { remote-endpoint = <&cpu6_ep>; }; }; 205 }; 206 207 ports@1 { 208 /* [DPCM]::BE */ 209 be0: port@0 { be00_ep: endpoint { remote-endpoint = <&codec3_ep>; }; }; 210 211 /* [DPCM-Multi]::BE */ 212 be1: port@1 { be10_ep: endpoint { remote-endpoint = <&mbe_ep>; }; }; 213 }; 214 }; 215 216 codec2codec { 217 /* [Codec2Codec] */ 218 ports@0 { 219 /* use default settings */ 220 c2c: port@0 { c2cf_ep: endpoint { remote-endpoint = <&codec6_ep>; }; }; 221 port@1 { c2cb_ep: endpoint { remote-endpoint = <&codec7_ep>; }; }; 222 }; 223 224 /* [Codec2Codec-Multi] */ 225 ports@1 { 226 /* use original settings */ 227 rate = <48000>; 228 c2c_m: port@0 { c2cmf_ep: endpoint { remote-endpoint = <&mc2c0_ep>; }; }; 229 port@1 { c2cmb_ep: endpoint { remote-endpoint = <&mc2c1_ep>; }; }; 230 }; 231 }; 232 }; 233 234 test_cpu { 235 /* 236 * update compatible to indicate more detail behaviour 237 * if you want. see test-compatible for more detail. 238 * 239 * ex) 240 * - compatible = "test-cpu"; 241 * + compatible = "test-cpu-verbose"; 242 */ 243 compatible = "test-cpu"; 244 ports { 245 bitclock-master; 246 frame-master; 247 /* [Normal] */ 248 cpu0: port@0 { cpu0_ep: endpoint { remote-endpoint = <&codec0_ep>; }; }; 249 250 /* [Multi-CPU] */ 251 port@1 { cpu1_ep: endpoint { remote-endpoint = <&mcpu1_ep>; }; }; 252 port@2 { cpu2_ep: endpoint { remote-endpoint = <&mcpu2_ep>; }; }; 253 254 /* [DPCM]::FE */ 255 port@3 { cpu3_ep: endpoint { remote-endpoint = <&fe00_ep>; }; }; 256 port@4 { cpu4_ep: endpoint { remote-endpoint = <&fe01_ep>; }; }; 257 258 /* [DPCM-Multi]::FE */ 259 port@5 { cpu5_ep: endpoint { remote-endpoint = <&fe10_ep>; }; }; 260 port@6 { cpu6_ep: endpoint { remote-endpoint = <&fe11_ep>; }; }; 261 }; 262 }; 263 264 test_codec { 265 /* 266 * update compatible to indicate more detail behaviour 267 * if you want. see test-compatible for more detail. 268 * 269 * ex) 270 * - compatible = "test-codec"; 271 * + compatible = "test-codec-verbose"; 272 */ 273 compatible = "test-codec"; 274 ports { 275 /* 276 * prefix can be added to *component*, 277 * see audio-graph-card2::routing 278 */ 279 prefix = "TC"; 280 281 /* [Normal] */ 282 port@0 { codec0_ep: endpoint { remote-endpoint = <&cpu0_ep>; }; }; 283 284 /* [Multi-Codec] */ 285 port@1 { codec1_ep: endpoint { remote-endpoint = <&mcodec1_ep>; }; }; 286 port@2 { codec2_ep: endpoint { remote-endpoint = <&mcodec2_ep>; }; }; 287 288 /* [DPCM]::BE */ 289 port@3 { codec3_ep: endpoint { remote-endpoint = <&be00_ep>; }; }; 290 291 /* [DPCM-Multi]::BE */ 292 port@4 { codec4_ep: endpoint { remote-endpoint = <&mbe1_ep>; }; }; 293 port@5 { codec5_ep: endpoint { remote-endpoint = <&mbe2_ep>; }; }; 294 295 /* [Codec2Codec] */ 296 port@6 { bitclock-master; 297 frame-master; 298 codec6_ep: endpoint { remote-endpoint = <&c2cf_ep>; }; }; 299 port@7 { codec7_ep: endpoint { remote-endpoint = <&c2cb_ep>; }; }; 300 301 /* [Codec2Codec-Multi] */ 302 port@8 { bitclock-master; 303 frame-master; 304 codec8_ep: endpoint { remote-endpoint = <&mc2c00_ep>; }; }; 305 port@9 { codec9_ep: endpoint { remote-endpoint = <&mc2c01_ep>; }; }; 306 port@10 { codec10_ep: endpoint { remote-endpoint = <&mc2c10_ep>; }; }; 307 port@11 { codec11_ep: endpoint { remote-endpoint = <&mc2c11_ep>; }; }; 308 }; 309 }; 310}; 311