Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: audio-graph-card2-custom-sample: Separate Sample

Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

audio-graph-card2-custom-sample has many sample connections, but because
ALSA card has number limition for links, it is impossible to have all
samples into 1 ASoC card.

This patch-set separate sample DT into 2 parts, and remove original sample.
Because of this separation, we can see all sample connection via multi Card.

- for normal
- for DPCM/Codec2Codec

+778 -702
-702
sound/soc/generic/audio-graph-card2-custom-sample.dtsi
··· 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 - * 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. 41 - * see 42 - * snd_soc_runtime_get_dai_fmt() 43 - * linux/sound/soc/generic/test-component.c :: test_dai_formats 44 - */ 45 - / { 46 - /* 47 - * @ : used at links 48 - * 49 - * [Normal] 50 - * cpu0 <-@-----------------> codec0 51 - * 52 - * [Semi-Multi] 53 - * 54 - * CPU:Codec = 1:N 55 - * 56 - * +-+ 57 - * cpu7 <-@------->| |-> codec12 58 - * | |-> codec13 59 - * +-+ 60 - * 61 - * [Multi-CPU/Codec-0] 62 - * +-+ +-+ 63 - * cpu1 <--| |<-@--------->| |-> codec1 64 - * cpu2 <--| | | |-> codec2 65 - * +-+ +-+ 66 - * 67 - * [Multi-CPU/Codec-1] 68 - * 69 - * +-+ +-+ 70 - * | |<-@--------->| | 71 - * | | | | 72 - * cpu8 <--| |<----------->| |-> codec14 73 - * cpu9 <--| |<---+------->| |-> codec15 74 - * +-+ \------>| |-> codec16 75 - * +-+ 76 - * 77 - * [Multi-CPU/Codec-2] 78 - * 79 - * +-+ +-+ 80 - * | |<-@--------->| | 81 - * | | | | 82 - * cpu10 <-| |<----------->| |-> codec17 83 - * cpu11 <-| |<-----+----->| |-> codec18 84 - * cpu12 <-| |<----/ +-+ 85 - * +-+ 86 - * 87 - * [DPCM] 88 - * 89 - * CPU3/CPU4 are converting rate to 44100 90 - * 91 - * FE BE 92 - * **** 93 - * cpu3 <-@--* *--@-> codec3 94 - * cpu4 <-@--* * (44.1kHz) 95 - * **** 96 - * 97 - * [DPCM-Multi] 98 - * 99 - * --NOTE-- 100 - * Multi-FE is not supported by ASoC. 101 - * 102 - * FE BE 103 - * **** +-+ 104 - * cpu5 <-@--* *--@-> | | -> codec4 105 - * cpu6 <-@--* * | | -> codec5 106 - * **** +-+ 107 - * 108 - * [Codec2Codec] 109 - * +-@-> codec6 110 - * | 111 - * +---> codec7 112 - * 113 - * [Codec2Codec-Multi] 114 - * 115 - * --NOTE-- 116 - * Multi connect N:M is not supported by ASoC. 117 - * 118 - * +-+ 119 - * +-@->| |-> codec8 120 - * | | |-> codec9 121 - * | +-+ 122 - * | +-+ 123 - * +--->| |-> codec10 124 - * | |-> codec11 125 - * +-+ 126 - */ 127 - audio-graph-card2-custom-sample { 128 - /* 129 - * You can use audio-graph-card2 directly by using 130 - * 131 - * compatible = "audio-graph-card2"; 132 - */ 133 - compatible = "audio-graph-card2-custom-sample"; 134 - 135 - /* for [DPCM] */ 136 - /* BE FE */ 137 - routing = "TC DAI3 Playback", "DAI3 Playback", 138 - "TC DAI3 Playback", "DAI4 Playback", 139 - "DAI3 Capture", "TC DAI3 Capture", 140 - "DAI4 Capture", "TC DAI3 Capture", 141 - /* for [DPCM-Multi] */ 142 - /* BE FE */ 143 - "TC DAI4 Playback", "DAI5 Playback", 144 - "TC DAI5 Playback", "DAI5 Playback", 145 - "TC DAI4 Playback", "DAI6 Playback", 146 - "TC DAI5 Playback", "DAI6 Playback", 147 - "DAI5 Capture", "TC DAI4 Capture", 148 - "DAI5 Capture", "TC DAI5 Capture", 149 - "DAI6 Capture", "TC DAI4 Capture", 150 - "DAI6 Capture", "TC DAI5 Capture", 151 - /* for [Codec2Codec] */ 152 - "TC OUT", "TC DAI7 Playback", 153 - "TC DAI6 Capture", "TC IN", 154 - /* for [Codec2Codec-Multi] */ 155 - "TC OUT", "TC DAI10 Playback", 156 - "TC DAI8 Capture", "TC IN", 157 - "TC OUT", "TC DAI11 Playback", 158 - "TC DAI9 Capture", "TC IN"; 159 - 160 - links = < 161 - /* 162 - * [Normal]: cpu side only 163 - * cpu0/codec0 164 - */ 165 - &cpu0 166 - 167 - /* 168 - * [Semi-Multi] 169 - * cpu7/codec12/codec13 170 - */ 171 - &sm0 172 - 173 - /* 174 - * [Multi-CPU/Codec-0]: cpu side only 175 - * cpu1/cpu2/codec1/codec2 176 - */ 177 - &mcpu0 178 - 179 - /* 180 - * [Multi-CPU/Codec-1]: cpu side only 181 - * cpu8/cpu9/codec14/codec15/codec16 182 - * 183 - * Because it will reach to the maximum of sound minor number, 184 - * disable it so far. 185 - * If you want to try it, please disable some other one instead. 186 - */ 187 - //&mcpu1 188 - 189 - /* 190 - * [Multi-CPU/Codec-2]: cpu side only 191 - * cpu10/cpu11/cpu12/codec17/codec18 192 - * 193 - * Because it will reach to the maximum of sound minor number, 194 - * disable it so far. 195 - * If you want to try it, please disable some other one instead. 196 - */ 197 - //&mcpu2 198 - 199 - /* 200 - * [DPCM]: both FE / BE 201 - * cpu3/cpu4/codec3 202 - */ 203 - &fe00 &fe01 &be0 204 - 205 - /* 206 - * [DPCM-Multi]: both FE / BE 207 - * cpu5/cpu6/codec4/codec5 208 - */ 209 - &fe10 &fe11 &be1 210 - 211 - /* 212 - * [Codec2Codec]: cpu side only 213 - * codec6/codec7 214 - */ 215 - &c2c 216 - 217 - /* 218 - * [Codec2Codec-Multi]: cpu side only 219 - * codec8/codec9/codec10/codec11 220 - */ 221 - &c2c_m 222 - >; 223 - 224 - multi { 225 - #address-cells = <1>; 226 - #size-cells = <0>; 227 - 228 - /* 229 - * [Multi-CPU-0] 230 - * 231 - * +---+ +---+ 232 - * cpu1 <--|A X|<-@------->|x a|-> codec1 233 - * cpu2 <--|B | | b|-> codec2 234 - * +---+ +---+ 235 - */ 236 - ports@0 { 237 - reg = <0>; 238 - #address-cells = <1>; 239 - #size-cells = <0>; 240 - mcpu0: port@0 { reg = <0>; mcpu00_ep: endpoint { remote-endpoint = <&mcodec00_ep>; };};/* (X) to pair */ 241 - port@1 { reg = <1>; mcpu01_ep: endpoint { remote-endpoint = <&cpu1_ep>; };};/* (A) Multi Element */ 242 - port@2 { reg = <2>; mcpu02_ep: endpoint { remote-endpoint = <&cpu2_ep>; };};/* (B) Multi Element */ 243 - }; 244 - 245 - /* 246 - * [Multi-Codec-0] 247 - * 248 - * +---+ +---+ 249 - * cpu1 <--|A X|<-@------->|x a|-> codec1 250 - * cpu2 <--|B | | b|-> codec2 251 - * +---+ +---+ 252 - */ 253 - ports@1 { 254 - reg = <1>; 255 - #address-cells = <1>; 256 - #size-cells = <0>; 257 - port@0 { reg = <0>; mcodec00_ep: endpoint { remote-endpoint = <&mcpu00_ep>; };};/* (x) to pair */ 258 - port@1 { reg = <1>; mcodec01_ep: endpoint { remote-endpoint = <&codec1_ep>; };};/* (a) Multi Element */ 259 - port@2 { reg = <2>; mcodec02_ep: endpoint { remote-endpoint = <&codec2_ep>; };};/* (b) Multi Element */ 260 - }; 261 - 262 - /* 263 - * [DPCM-Multi]::BE 264 - * 265 - * FE BE 266 - * **** +---+ 267 - * cpu5 <-@--* *-----@--->|x a|-> codec4 268 - * cpu6 <-@--* * | b|-> codec5 269 - * **** +---+ 270 - */ 271 - ports@2 { 272 - reg = <2>; 273 - #address-cells = <1>; 274 - #size-cells = <0>; 275 - port@0 { reg = <0>; mbe_ep: endpoint { remote-endpoint = <&be10_ep>; };};/* (x) to pair */ 276 - port@1 { reg = <1>; mbe1_ep: endpoint { remote-endpoint = <&codec4_ep>; };};/* (a) Multi Element */ 277 - port@2 { reg = <2>; mbe2_ep: endpoint { remote-endpoint = <&codec5_ep>; };};/* (b) Multi Element */ 278 - }; 279 - 280 - /* 281 - * [Codec2Codec-Multi]::CPU 282 - * 283 - * +---+ 284 - * +-@->|X A|-> codec8 285 - * | | B|-> codec9 286 - * | +---+ 287 - * | +---+ 288 - * +--->|x a|-> codec10 289 - * | b|-> codec11 290 - * +---+ 291 - */ 292 - ports@3 { 293 - reg = <3>; 294 - #address-cells = <1>; 295 - #size-cells = <0>; 296 - port@0 { reg = <0>; mc2c0_ep: endpoint { remote-endpoint = <&c2cmf_ep>; };};/* (X) to pair */ 297 - port@1 { reg = <1>; mc2c00_ep: endpoint { remote-endpoint = <&codec8_ep>; };};/* (A) Multi Element */ 298 - port@2 { reg = <2>; mc2c01_ep: endpoint { remote-endpoint = <&codec9_ep>; };};/* (B) Multi Element */ 299 - }; 300 - 301 - /* 302 - * [Codec2Codec-Multi]::Codec 303 - * 304 - * +---+ 305 - * +-@->|X A|-> codec8 306 - * | | B|-> codec9 307 - * | +---+ 308 - * | +---+ 309 - * +--->|x a|-> codec10 310 - * | b|-> codec11 311 - * +---+ 312 - */ 313 - ports@4 { 314 - reg = <4>; 315 - #address-cells = <1>; 316 - #size-cells = <0>; 317 - port@0 { reg = <0>; mc2c1_ep: endpoint { remote-endpoint = <&c2cmb_ep>; };};/* (x) to pair */ 318 - port@1 { reg = <1>; mc2c10_ep: endpoint { remote-endpoint = <&codec10_ep>; };};/* (a) Multi Element */ 319 - port@2 { reg = <2>; mc2c11_ep: endpoint { remote-endpoint = <&codec11_ep>; };};/* (b) Multi Element */ 320 - }; 321 - 322 - /* 323 - * [Semi-Multi] 324 - * 325 - * +---+ 326 - * cpu7 <-@------->|X A|-> codec12 327 - * | B|-> codec13 328 - * +---+ 329 - */ 330 - ports@5 { 331 - reg = <5>; 332 - #address-cells = <1>; 333 - #size-cells = <0>; 334 - port@0 { reg = <0>; smcodec0_ep: endpoint { remote-endpoint = <&cpu7_ep>; };};/* (X) to pair */ 335 - port@1 { reg = <1>; smcodec1_ep: endpoint { remote-endpoint = <&codec12_ep>; };};/* (A) Multi Element */ 336 - port@2 { reg = <2>; smcodec2_ep: endpoint { remote-endpoint = <&codec13_ep>; };};/* (B) Multi Element */ 337 - }; 338 - 339 - /* 340 - * [Multi-CPU-1] 341 - * 342 - * +---+ +---+ 343 - * | X|<-@------->|x | 344 - * | | | | 345 - * cpu8 <--|A 1|<--------->|3 a|-> codec14 346 - * cpu9 <--|B 2|<---+----->|4 b|-> codec15 347 - * +---+ \---->|5 c|-> codec16 348 - * +---+ 349 - */ 350 - ports@6 { 351 - reg = <6>; 352 - #address-cells = <1>; 353 - #size-cells = <0>; 354 - mcpu1: port@0 { reg = <0>; mcpu10_ep: endpoint { remote-endpoint = <&mcodec10_ep>; };}; /* (X) to pair */ 355 - port@1 { 356 - #address-cells = <1>; 357 - #size-cells = <0>; 358 - reg = <1>; 359 - mcpu11_ep: endpoint@0 { reg = <0>; remote-endpoint = <&cpu8_ep>; }; /* (A) Multi Element */ 360 - mcpu11_ep_0: endpoint@1 { reg = <1>; remote-endpoint = <&mcodec11_ep_0>; }; /* (1) connected Codec */ 361 - }; 362 - port@2 { 363 - #address-cells = <1>; 364 - #size-cells = <0>; 365 - reg = <2>; 366 - mcpu12_ep: endpoint@0 { reg = <0>; remote-endpoint = <&cpu9_ep>; }; /* (B) Multi Element */ 367 - mcpu12_ep_0: endpoint@1 { reg = <1>; remote-endpoint = <&mcodec12_ep_0>; }; /* (2) connected Codec */ 368 - mcpu12_ep_1: endpoint@2 { reg = <2>; remote-endpoint = <&mcodec13_ep_0>; }; /* (2) connected Codec */ 369 - }; 370 - }; 371 - 372 - /* 373 - * [Multi-Codec-1] 374 - * 375 - * +---+ +---+ 376 - * | X|<-@------->|x | 377 - * | | | | 378 - * cpu8 <--|A 1|<--------->|3 a|-> codec14 379 - * cpu9 <--|B 2|<---+----->|4 b|-> codec15 380 - * +---+ \---->|5 c|-> codec16 381 - * +---+ 382 - */ 383 - ports@7 { 384 - reg = <7>; 385 - #address-cells = <1>; 386 - #size-cells = <0>; 387 - port@0 { reg = <0>; mcodec10_ep: endpoint { remote-endpoint = <&mcpu10_ep>; };}; /* (x) to pair */ 388 - port@1 { 389 - #address-cells = <1>; 390 - #size-cells = <0>; 391 - reg = <1>; 392 - mcodec11_ep: endpoint@0 { reg = <0>; remote-endpoint = <&codec14_ep>; }; /* (a) Multi Element */ 393 - mcodec11_ep_0: endpoint@1 { reg = <1>; remote-endpoint = <&mcpu11_ep_0>; }; /* (3) connected CPU */ 394 - }; 395 - port@2 { 396 - #address-cells = <1>; 397 - #size-cells = <0>; 398 - reg = <2>; 399 - mcodec12_ep: endpoint@0 { reg = <0>; remote-endpoint = <&codec15_ep>; }; /* (b) Multi Element */ 400 - mcodec12_ep_0: endpoint@1 { reg = <1>; remote-endpoint = <&mcpu12_ep_0>; }; /* (4) connected CPU */ 401 - }; 402 - port@3 { 403 - #address-cells = <1>; 404 - #size-cells = <0>; 405 - reg = <3>; 406 - mcodec13_ep: endpoint@0 { reg = <0>; remote-endpoint = <&codec16_ep>; }; /* (c) Multi Element */ 407 - mcodec13_ep_0: endpoint@1 { reg = <1>; remote-endpoint = <&mcpu12_ep_1>; }; /* (5) connected CPU */ 408 - }; 409 - }; 410 - 411 - /* 412 - * [Multi-CPU-2] 413 - * 414 - * +---+ +---+ 415 - * | X|<-@------->|x | 416 - * | | | | 417 - * cpu10 <-|A 1|<--------->|4 a|-> codec17 418 - * cpu11 <-|B 2|<-----+--->|5 b|-> codec18 419 - * cpu12 <-|C 3|<----/ +---+ 420 - * +---+ 421 - */ 422 - ports@8 { 423 - reg = <8>; 424 - #address-cells = <1>; 425 - #size-cells = <0>; 426 - mcpu2: port@0 { reg = <0>; mcpu20_ep: endpoint { remote-endpoint = <&mcodec20_ep>; };}; /* (X) to pair */ 427 - port@1 { 428 - #address-cells = <1>; 429 - #size-cells = <0>; 430 - reg = <1>; 431 - mcpu21_ep: endpoint@0 { reg = <0>; remote-endpoint = <&cpu10_ep>; }; /* (A) Multi Element */ 432 - mcpu21_ep_0: endpoint@1 { reg = <1>; remote-endpoint = <&mcodec21_ep_0>; }; /* (1) connected Codec */ 433 - }; 434 - port@2 { 435 - #address-cells = <1>; 436 - #size-cells = <0>; 437 - reg = <2>; 438 - mcpu22_ep: endpoint@0 { reg = <0>; remote-endpoint = <&cpu11_ep>; }; /* (B) Multi Element */ 439 - mcpu22_ep_0: endpoint@1 { reg = <1>; remote-endpoint = <&mcodec22_ep_0>; }; /* (2) connected Codec */ 440 - }; 441 - port@3 { 442 - #address-cells = <1>; 443 - #size-cells = <0>; 444 - reg = <3>; 445 - mcpu23_ep: endpoint@0 { reg = <0>; remote-endpoint = <&cpu12_ep>; }; /* (C) Multi Element */ 446 - mcpu23_ep_0: endpoint@1 { reg = <1>; remote-endpoint = <&mcodec22_ep_1>; }; /* (3) connected Codec */ 447 - }; 448 - }; 449 - 450 - /* 451 - * [Multi-Codec-2] 452 - * 453 - * +---+ +---+ 454 - * | X|<-@------->|x | 455 - * | | | | 456 - * cpu10 <-|A 1|<--------->|4 a|-> codec17 457 - * cpu11 <-|B 2|<-----+--->|5 b|-> codec18 458 - * cpu12 <-|C 3|<----/ +---+ 459 - * +---+ 460 - */ 461 - ports@9 { 462 - reg = <9>; 463 - #address-cells = <1>; 464 - #size-cells = <0>; 465 - port@0 { reg = <0>; mcodec20_ep: endpoint { remote-endpoint = <&mcpu20_ep>; };}; /* (x) to pair */ 466 - port@1 { 467 - #address-cells = <1>; 468 - #size-cells = <0>; 469 - reg = <1>; 470 - mcodec21_ep: endpoint@0 { reg = <0>; remote-endpoint = <&codec17_ep>; }; /* (a) Multi Element */ 471 - mcodec21_ep_0: endpoint@1 { reg = <1>; remote-endpoint = <&mcpu21_ep_0>; }; /* (4) connected CPU */ 472 - }; 473 - port@2 { 474 - #address-cells = <1>; 475 - #size-cells = <0>; 476 - reg = <2>; 477 - mcodec22_ep: endpoint@0 { reg = <0>; remote-endpoint = <&codec18_ep>; }; /* (b) Multi Element */ 478 - mcodec22_ep_0: endpoint@1 { reg = <1>; remote-endpoint = <&mcpu22_ep_0>; }; /* (5) connected CPU */ 479 - mcodec22_ep_1: endpoint@2 { reg = <2>; remote-endpoint = <&mcpu23_ep_0>; }; /* (5) connected CPU */ 480 - }; 481 - }; 482 - }; 483 - 484 - dpcm { 485 - #address-cells = <1>; 486 - #size-cells = <0>; 487 - 488 - ports@0 { 489 - reg = <0>; 490 - 491 - #address-cells = <1>; 492 - #size-cells = <0>; 493 - /* 494 - * [DPCM]::FE 495 - * 496 - * FE BE 497 - * **** 498 - * cpu3 <-@(fe00)--* *--(be0)@--> codec3 499 - * cpu4 <-@(fe01)--* * (44.1kHz) 500 - * **** 501 - */ 502 - fe00: port@0 { reg = <0>; fe00_ep: endpoint { remote-endpoint = <&cpu3_ep>; }; }; 503 - fe01: port@1 { reg = <1>; fe01_ep: endpoint { remote-endpoint = <&cpu4_ep>; }; }; 504 - 505 - /* 506 - * [DPCM-Multi]::FE 507 - * 508 - * FE BE 509 - * **** +-+ 510 - * cpu5 <-@(fe10)--* *---(be1)@-->| |-> codec4 511 - * cpu6 <-@(fe11)--* * | |-> codec5 512 - * **** +-+ 513 - */ 514 - fe10: port@2 { reg = <2>; fe10_ep: endpoint { remote-endpoint = <&cpu5_ep>; }; }; 515 - fe11: port@3 { reg = <3>; fe11_ep: endpoint { remote-endpoint = <&cpu6_ep>; }; }; 516 - }; 517 - 518 - ports@1 { 519 - reg = <1>; 520 - 521 - #address-cells = <1>; 522 - #size-cells = <0>; 523 - /* 524 - * [DPCM]::BE 525 - * 526 - * FE BE 527 - * **** 528 - * cpu3 <-@(fe00)--* *--(be0)@--> codec3 529 - * cpu4 <-@(fe01)--* * (44.1kHz) 530 - * **** 531 - */ 532 - be0: port@0 { reg = <0>; be00_ep: endpoint { remote-endpoint = <&codec3_ep>; }; }; 533 - 534 - /* 535 - * [DPCM-Multi]::BE 536 - * 537 - * FE BE 538 - * **** +-+ 539 - * cpu5 <-@(fe10)--* *---(be1)@-->| |-> codec4 540 - * cpu6 <-@(fe11)--* * | |-> codec5 541 - * **** +-+ 542 - */ 543 - be1: port@1 { reg = <1>; be10_ep: endpoint { remote-endpoint = <&mbe_ep>; }; }; 544 - }; 545 - }; 546 - 547 - codec2codec { 548 - #address-cells = <1>; 549 - #size-cells = <0>; 550 - /* 551 - * [Codec2Codec] 552 - * 553 - * +-@(c2c)-> codec6 554 - * | 555 - * +--------> codec7 556 - */ 557 - ports@0 { 558 - reg = <0>; 559 - 560 - #address-cells = <1>; 561 - #size-cells = <0>; 562 - 563 - /* use default settings */ 564 - c2c: port@0 { reg = <0>; c2cf_ep: endpoint { remote-endpoint = <&codec6_ep>; }; }; 565 - port@1 { reg = <1>; c2cb_ep: endpoint { remote-endpoint = <&codec7_ep>; }; }; 566 - }; 567 - 568 - /* 569 - * [Codec2Codec-Multi] 570 - * 571 - * +-+ 572 - * +-@(c2c_m)-->| |-> codec8 573 - * | | |-> codec9 574 - * | +-+ 575 - * | +-+ 576 - * +----------->| |-> codec10 577 - * | |-> codec11 578 - * +-+ 579 - */ 580 - ports@1 { 581 - reg = <1>; 582 - 583 - #address-cells = <1>; 584 - #size-cells = <0>; 585 - 586 - /* use original settings */ 587 - rate = <48000>; 588 - c2c_m: port@0 { reg = <0>; c2cmf_ep: endpoint { remote-endpoint = <&mc2c0_ep>; }; }; 589 - port@1 { reg = <1>; c2cmb_ep: endpoint { remote-endpoint = <&mc2c1_ep>; }; }; 590 - }; 591 - }; 592 - }; 593 - 594 - test_cpu { 595 - /* 596 - * update compatible to indicate more detail behaviour 597 - * if you want. see test-compatible for more detail. 598 - * 599 - * ex) 600 - * - compatible = "test-cpu"; 601 - * + compatible = "test-cpu-verbose"; 602 - */ 603 - compatible = "test-cpu"; 604 - ports { 605 - #address-cells = <1>; 606 - #size-cells = <0>; 607 - 608 - bitclock-master; 609 - frame-master; 610 - /* [Normal] */ 611 - cpu0: port@0 { reg = <0>; cpu0_ep: endpoint { remote-endpoint = <&codec0_ep>; }; }; 612 - 613 - /* [Multi-CPU-0] */ 614 - port@1 { reg = <1>; cpu1_ep: endpoint { remote-endpoint = <&mcpu01_ep>; }; }; 615 - port@2 { reg = <2>; cpu2_ep: endpoint { remote-endpoint = <&mcpu02_ep>; }; }; 616 - 617 - /* [DPCM]::FE */ 618 - port@3 { reg = <3>; cpu3_ep: endpoint { remote-endpoint = <&fe00_ep>; }; }; 619 - port@4 { reg = <4>; cpu4_ep: endpoint { remote-endpoint = <&fe01_ep>; }; }; 620 - 621 - /* [DPCM-Multi]::FE */ 622 - port@5 { reg = <5>; cpu5_ep: endpoint { remote-endpoint = <&fe10_ep>; }; }; 623 - port@6 { reg = <6>; cpu6_ep: endpoint { remote-endpoint = <&fe11_ep>; }; }; 624 - 625 - /* [Semi-Multi] */ 626 - sm0: port@7 { reg = <7>; cpu7_ep: endpoint { remote-endpoint = <&smcodec0_ep>; }; }; 627 - 628 - /* [Multi-CPU-1] */ 629 - port@8 { reg = <8>; cpu8_ep: endpoint { remote-endpoint = <&mcpu11_ep>; }; }; 630 - port@9 { reg = <9>; cpu9_ep: endpoint { remote-endpoint = <&mcpu12_ep>; }; }; 631 - /* [Multi-CPU-2] */ 632 - port@a { reg = <10>; cpu10_ep: endpoint { remote-endpoint = <&mcpu21_ep>; }; }; 633 - port@b { reg = <11>; cpu11_ep: endpoint { remote-endpoint = <&mcpu22_ep>; }; }; 634 - port@c { reg = <12>; cpu12_ep: endpoint { remote-endpoint = <&mcpu23_ep>; }; }; 635 - }; 636 - }; 637 - 638 - test_codec { 639 - /* 640 - * update compatible to indicate more detail behaviour 641 - * if you want. see test-compatible for more detail. 642 - * 643 - * ex) 644 - * - compatible = "test-codec"; 645 - * + compatible = "test-codec-verbose"; 646 - */ 647 - compatible = "test-codec"; 648 - ports { 649 - #address-cells = <1>; 650 - #size-cells = <0>; 651 - 652 - /* 653 - * prefix can be added to *component*, 654 - * see audio-graph-card2::routing 655 - */ 656 - prefix = "TC"; 657 - 658 - /* [Normal] */ 659 - port@0 { reg = <0>; codec0_ep: endpoint { remote-endpoint = <&cpu0_ep>; }; }; 660 - 661 - /* [Multi-Codec-0] */ 662 - port@1 { reg = <1>; codec1_ep: endpoint { remote-endpoint = <&mcodec01_ep>; }; }; 663 - port@2 { reg = <2>; codec2_ep: endpoint { remote-endpoint = <&mcodec02_ep>; }; }; 664 - 665 - /* [DPCM]::BE */ 666 - port@3 { 667 - convert-rate = <44100>; 668 - reg = <3>; codec3_ep: endpoint { remote-endpoint = <&be00_ep>; }; 669 - }; 670 - 671 - /* [DPCM-Multi]::BE */ 672 - port@4 { reg = <4>; codec4_ep: endpoint { remote-endpoint = <&mbe1_ep>; }; }; 673 - port@5 { reg = <5>; codec5_ep: endpoint { remote-endpoint = <&mbe2_ep>; }; }; 674 - 675 - /* [Codec2Codec] */ 676 - port@6 { bitclock-master; 677 - frame-master; 678 - reg = <6>; codec6_ep: endpoint { remote-endpoint = <&c2cf_ep>; }; }; 679 - port@7 { reg = <7>; codec7_ep: endpoint { remote-endpoint = <&c2cb_ep>; }; }; 680 - 681 - /* [Codec2Codec-Multi] */ 682 - port@8 { bitclock-master; 683 - frame-master; 684 - reg = <8>; codec8_ep: endpoint { remote-endpoint = <&mc2c00_ep>; }; }; 685 - port@9 { reg = <9>; codec9_ep: endpoint { remote-endpoint = <&mc2c01_ep>; }; }; 686 - port@a { reg = <10>; codec10_ep: endpoint { remote-endpoint = <&mc2c10_ep>; }; }; 687 - port@b { reg = <11>; codec11_ep: endpoint { remote-endpoint = <&mc2c11_ep>; }; }; 688 - 689 - /* [Semi-Multi] */ 690 - port@c { reg = <12>; codec12_ep: endpoint { remote-endpoint = <&smcodec1_ep>; }; }; 691 - port@d { reg = <13>; codec13_ep: endpoint { remote-endpoint = <&smcodec2_ep>; }; }; 692 - 693 - /* [Multi-Codec-1] */ 694 - port@e { reg = <14>; codec14_ep: endpoint { remote-endpoint = <&mcodec11_ep>; }; }; 695 - port@f { reg = <15>; codec15_ep: endpoint { remote-endpoint = <&mcodec12_ep>; }; }; 696 - port@10 { reg = <16>; codec16_ep: endpoint { remote-endpoint = <&mcodec13_ep>; }; }; 697 - /* [Multi-Codec-2] */ 698 - port@11 { reg = <17>; codec17_ep: endpoint { remote-endpoint = <&mcodec21_ep>; }; }; 699 - port@12 { reg = <18>; codec18_ep: endpoint { remote-endpoint = <&mcodec22_ep>; }; }; 700 - }; 701 - }; 702 - };
+396
sound/soc/generic/audio-graph-card2-custom-sample1.dtsi
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * audio-graph-card2-custom-sample1.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-sample1.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 + * 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. 41 + * see 42 + * snd_soc_runtime_get_dai_fmt() 43 + * linux/sound/soc/generic/test-component.c :: test_dai_formats 44 + */ 45 + / { 46 + audio-graph-card2-custom-sample-1 { 47 + /* 48 + * You can use audio-graph-card2 directly by using 49 + * 50 + * compatible = "audio-graph-card2"; 51 + */ 52 + compatible = "audio-graph-card2-custom-sample"; 53 + label = "card2-custom-sample-1"; 54 + 55 + /* 56 + * @ : used at links 57 + */ 58 + links = < 59 + /* 60 + * 61 + * [Normal] 62 + * 63 + * <cpu1_0> 64 + * cpu1_0 <-@-----> codec1_0 65 + */ 66 + &cpu1_0 /* CPU side only */ 67 + 68 + /* 69 + * [Semi-Multi] 70 + * 71 + * CPU:Codec = 1:N 72 + * 73 + * <sm> +-+ 74 + * cpu1_1 <--@---->| |-> codec1_1 75 + * | |-> codec1_2 76 + * +-+ 77 + */ 78 + &sm /* CPU side only */ 79 + 80 + /* 81 + * [Multi-CPU/Codec-A] 82 + * 83 + * +-+ <mcpuA> +-+ 84 + * cpu1_2 <-| |<---@------>| |-> codec1_3 85 + * cpu1_3 <-| | | |-> codec1_4 86 + * +-+ +-+ 87 + */ 88 + &mcpuA /* CPU side only */ 89 + 90 + /* 91 + * [Multi-CPU/Codec-B] 92 + * 93 + * +-+ <mcpuB> +-+ 94 + * | |<---@------>| | 95 + * | | | | 96 + * cpu1_4 <-| |<---------->| |-> codec1_5 97 + * cpu1_5 <-| |<---+------>| |-> codec1_6 98 + * +-+ \----->| |-> codec1_7 99 + * +-+ 100 + */ 101 + &mcpuB /* CPU side only */ 102 + 103 + /* 104 + * [Multi-CPU/Codec-C] 105 + * 106 + * +-+ <mcpuC> +-+ 107 + * | |<---@------>| | 108 + * | | | | 109 + * cpu1_6 <-| |<---------->| |-> codec1_8 110 + * cpu1_7 <-| |<-----+---->| |-> codec1_9 111 + * cpu1_8 <-| |<----/ +-+ 112 + * +-+ 113 + */ 114 + &mcpuC /* CPU side only */ 115 + >; 116 + 117 + multi { 118 + #address-cells = <1>; 119 + #size-cells = <0>; 120 + 121 + /* 122 + * [Semi-Multi] 123 + * 124 + * <sm> +---+ 125 + * cpu1_1 <---@--->|X A|-> codec1_1 126 + * | B|-> codec1_2 127 + * +---+ 128 + */ 129 + ports@0 { 130 + reg = <0>; 131 + #address-cells = <1>; 132 + #size-cells = <0>; 133 + port@0 { reg = <0>; smcodec_ep: endpoint { remote-endpoint = <&cpu1_1_ep>; };};/* (X) to pair */ 134 + port@1 { reg = <1>; smcodec_A_ep: endpoint { remote-endpoint = <&codec1_1_ep>; };};/* (A) Multi Element */ 135 + port@2 { reg = <2>; smcodec_B_ep: endpoint { remote-endpoint = <&codec1_2_ep>; };};/* (B) Multi Element */ 136 + }; 137 + 138 + /* 139 + * [Multi-CPU-A] 140 + * 141 + * +---+ <mcpuA> +---+ 142 + * cpu1_2 <-|A X|<---@---->|x a|-> codec1_3 143 + * cpu1_3 <-|B | | b|-> codec1_4 144 + * +---+ +---+ 145 + */ 146 + ports@1 { 147 + reg = <1>; 148 + #address-cells = <1>; 149 + #size-cells = <0>; 150 + mcpuA: port@0 { reg = <0>; mcpu_A_ep: endpoint { remote-endpoint = <&mcodec_A_ep>; };}; /* (X) to pair */ 151 + port@1 { reg = <1>; mcpu_AA_ep: endpoint { remote-endpoint = <&cpu1_2_ep>; };}; /* (A) Multi Element */ 152 + port@2 { reg = <2>; mcpu_AB_ep: endpoint { remote-endpoint = <&cpu1_3_ep>; };}; /* (B) Multi Element */ 153 + }; 154 + 155 + /* 156 + * [Multi-Codec-A] 157 + * 158 + * +---+ <mcpuA> +---+ 159 + * cpu1_2 <-|A X|<-@------>|x a|-> codec1_3 160 + * cpu1_3 <-|B | | b|-> codec1_4 161 + * +---+ +---+ 162 + */ 163 + ports@2 { 164 + reg = <2>; 165 + #address-cells = <1>; 166 + #size-cells = <0>; 167 + port@0 { reg = <0>; mcodec_A_ep: endpoint { remote-endpoint = <&mcpu_A_ep>; };}; /* (x) to pair */ 168 + port@1 { reg = <1>; mcodec_Aa_ep: endpoint { remote-endpoint = <&codec1_3_ep>; };}; /* (a) Multi Element */ 169 + port@2 { reg = <2>; mcodec_Ab_ep: endpoint { remote-endpoint = <&codec1_4_ep>; };}; /* (b) Multi Element */ 170 + }; 171 + 172 + /* 173 + * [Multi-CPU-B] 174 + * 175 + * +---+ <mcpuB> +---+ 176 + * | X|<---@---->|x | 177 + * | | | | 178 + * cpu1_4 <-|A 1|<-------->|3 a|-> codec1_5 179 + * cpu1_5 <-|B 2|<---+---->|4 b|-> codec1_6 180 + * +---+ \--->|5 c|-> codec1_7 181 + * +---+ 182 + */ 183 + ports@3 { 184 + reg = <3>; 185 + #address-cells = <1>; 186 + #size-cells = <0>; 187 + mcpuB: port@0 { 188 + reg = <0>; 189 + mcpu_BX_ep: endpoint { remote-endpoint = <&mcodec_Bx_ep>; }; /* (X) to pair */ 190 + }; 191 + port@1 { 192 + #address-cells = <1>; 193 + #size-cells = <0>; 194 + reg = <1>; 195 + mcpu_BA_ep: endpoint@0 { reg = <0>; remote-endpoint = <&cpu1_4_ep>; }; /* (A) Multi Element */ 196 + mcpu_B1_ep: endpoint@1 { reg = <1>; remote-endpoint = <&mcodec_B3_ep>; }; /* (1) connected Codec */ 197 + }; 198 + port@2 { 199 + #address-cells = <1>; 200 + #size-cells = <0>; 201 + reg = <2>; 202 + mcpu_BB_ep: endpoint@0 { reg = <0>; remote-endpoint = <&cpu1_5_ep>; }; /* (B) Multi Element */ 203 + mcpu_B2_0_ep: endpoint@1 { reg = <1>; remote-endpoint = <&mcodec_B4_ep>; }; /* (2) connected Codec */ 204 + mcpu_B2_1_ep: endpoint@2 { reg = <2>; remote-endpoint = <&mcodec_B5_ep>; }; /* (2) connected Codec */ 205 + }; 206 + }; 207 + 208 + /* 209 + * [Multi-Codec-B] 210 + * 211 + * +---+ <mcpuB> +---+ 212 + * | X|<-@------>|x | 213 + * | | | | 214 + * cpu1_4 <-|A 1|<-------->|3 a|-> codec1_5 215 + * cpu1_5 <-|B 2|<---+---->|4 b|-> codec1_6 216 + * +---+ \--->|5 c|-> codec1_7 217 + * +---+ 218 + */ 219 + ports@4 { 220 + reg = <4>; 221 + #address-cells = <1>; 222 + #size-cells = <0>; 223 + port@0 { 224 + reg = <0>; 225 + mcodec_Bx_ep: endpoint { remote-endpoint = <&mcpu_BX_ep>; }; /* (x) to pair */ 226 + }; 227 + port@1 { 228 + #address-cells = <1>; 229 + #size-cells = <0>; 230 + reg = <1>; 231 + mcodec_Ba_ep: endpoint@0 { reg = <0>; remote-endpoint = <&codec1_5_ep>;}; /* (a) Multi Element */ 232 + mcodec_B3_ep: endpoint@1 { reg = <1>; remote-endpoint = <&mcpu_B1_ep>; }; /* (3) connected CPU */ 233 + }; 234 + port@2 { 235 + #address-cells = <1>; 236 + #size-cells = <0>; 237 + reg = <2>; 238 + mcodec_Bb_ep: endpoint@0 { reg = <0>; remote-endpoint = <&codec1_6_ep>; }; /* (b) Multi Element */ 239 + mcodec_B4_ep: endpoint@1 { reg = <1>; remote-endpoint = <&mcpu_B2_0_ep>;}; /* (4) connected CPU */ 240 + }; 241 + port@3 { 242 + #address-cells = <1>; 243 + #size-cells = <0>; 244 + reg = <3>; 245 + mcodec_Bc_ep: endpoint@0 { reg = <0>; remote-endpoint = <&codec1_7_ep>; }; /* (c) Multi Element */ 246 + mcodec_B5_ep: endpoint@1 { reg = <1>; remote-endpoint = <&mcpu_B2_1_ep>;}; /* (5) connected CPU */ 247 + }; 248 + }; 249 + 250 + /* 251 + * [Multi-CPU-C] 252 + * 253 + * +---+ <mcpuC> +---+ 254 + * | X|<-@------>|x | 255 + * | | | | 256 + * cpu1_6 <-|A 1|<-------->|4 a|-> codec1_8 257 + * cpu1_7 <-|B 2|<-----+-->|5 b|-> codec1_9 258 + * cpu1_8 <-|C 3|<----/ +---+ 259 + * +---+ 260 + */ 261 + ports@5 { 262 + reg = <5>; 263 + #address-cells = <1>; 264 + #size-cells = <0>; 265 + mcpuC: port@0 { 266 + reg = <0>; 267 + mcpu_CX_ep: endpoint { remote-endpoint = <&mcodec_Cx_ep>; }; /* (X) to pair */ 268 + }; 269 + port@1 { 270 + #address-cells = <1>; 271 + #size-cells = <0>; 272 + reg = <1>; 273 + mcpu_CA_ep: endpoint@0 { reg = <0>; remote-endpoint = <&cpu1_6_ep>; }; /* (A) Multi Element */ 274 + mcpu_C1_ep: endpoint@1 { reg = <1>; remote-endpoint = <&mcodec_C4_ep>; }; /* (1) connected Codec */ 275 + }; 276 + port@2 { 277 + #address-cells = <1>; 278 + #size-cells = <0>; 279 + reg = <2>; 280 + mcpu_CB_ep: endpoint@0 { reg = <0>; remote-endpoint = <&cpu1_7_ep>; }; /* (B) Multi Element */ 281 + mcpu_C2_ep: endpoint@1 { reg = <1>; remote-endpoint = <&mcodec_C5_0_ep>; }; /* (2) connected Codec */ 282 + }; 283 + port@3 { 284 + #address-cells = <1>; 285 + #size-cells = <0>; 286 + reg = <3>; 287 + mcpu_CC_ep: endpoint@0 { reg = <0>; remote-endpoint = <&cpu1_8_ep>; }; /* (C) Multi Element */ 288 + mcpu_C3_ep: endpoint@1 { reg = <1>; remote-endpoint = <&mcodec_C5_1_ep>; }; /* (3) connected Codec */ 289 + }; 290 + }; 291 + 292 + /* 293 + * [Multi-Codec-C] 294 + * 295 + * +---+ <mcpuC> +---+ 296 + * | X|<-@------>|x | 297 + * | | | | 298 + * cpu1_6 <-|A 1|<-------->|4 a|-> codec1_8 299 + * cpu1_7 <-|B 2|<-----+-->|5 b|-> codec1_9 300 + * cpu1_8 <-|C 3|<----/ +---+ 301 + * +---+ 302 + */ 303 + ports@6 { 304 + reg = <6>; 305 + #address-cells = <1>; 306 + #size-cells = <0>; 307 + port@0 { 308 + reg = <0>; 309 + mcodec_Cx_ep: endpoint { remote-endpoint = <&mcpu_CX_ep>; }; /* (x) to pair */ 310 + }; 311 + port@1 { 312 + #address-cells = <1>; 313 + #size-cells = <0>; 314 + reg = <1>; 315 + mcodec_Ca_ep: endpoint@0 { reg = <0>; remote-endpoint = <&codec1_8_ep>;}; /* (a) Multi Element */ 316 + mcodec_C4_ep: endpoint@1 { reg = <1>; remote-endpoint = <&mcpu_C1_ep>; }; /* (4) connected CPU */ 317 + }; 318 + port@2 { 319 + #address-cells = <1>; 320 + #size-cells = <0>; 321 + reg = <2>; 322 + mcodec_Cb_ep: endpoint@0 { reg = <0>; remote-endpoint = <&codec1_9_ep>;}; /* (b) Multi Element */ 323 + mcodec_C5_0_ep: endpoint@1 { reg = <1>; remote-endpoint = <&mcpu_C2_ep>; }; /* (5) connected CPU */ 324 + mcodec_C5_1_ep: endpoint@2 { reg = <2>; remote-endpoint = <&mcpu_C3_ep>; }; /* (5) connected CPU */ 325 + }; 326 + }; 327 + }; 328 + }; 329 + 330 + test_cpu_1 { 331 + /* 332 + * update compatible to indicate more detail behaviour 333 + * if you want. see test-compatible for more detail. 334 + * 335 + * ex) 336 + * - compatible = "test-cpu"; 337 + * + compatible = "test-cpu-verbose"; 338 + */ 339 + compatible = "test-cpu"; 340 + ports { 341 + #address-cells = <1>; 342 + #size-cells = <0>; 343 + 344 + bitclock-master; 345 + frame-master; 346 + 347 + /* [Normal] */ 348 + cpu1_0: port@0 { reg = <0>; cpu1_0_ep: endpoint { remote-endpoint = <&codec1_0_ep>;}; }; 349 + /* [Semi-Multi] */ 350 + sm: port@1 { reg = <1>; cpu1_1_ep: endpoint { remote-endpoint = <&smcodec_ep>; }; }; 351 + /* [Multi-CPU-A] */ 352 + port@2 { reg = <2>; cpu1_2_ep: endpoint { remote-endpoint = <&mcpu_AA_ep>; }; }; 353 + port@3 { reg = <3>; cpu1_3_ep: endpoint { remote-endpoint = <&mcpu_AB_ep>; }; }; 354 + /* [Multi-CPU-B] */ 355 + port@4 { reg = <4>; cpu1_4_ep: endpoint { remote-endpoint = <&mcpu_BA_ep>; }; }; 356 + port@5 { reg = <5>; cpu1_5_ep: endpoint { remote-endpoint = <&mcpu_BB_ep>; }; }; 357 + /* [Multi-CPU-C] */ 358 + port@6 { reg = <6>; cpu1_6_ep: endpoint { remote-endpoint = <&mcpu_CA_ep>; }; }; 359 + port@7 { reg = <7>; cpu1_7_ep: endpoint { remote-endpoint = <&mcpu_CB_ep>; }; }; 360 + port@8 { reg = <8>; cpu1_8_ep: endpoint { remote-endpoint = <&mcpu_CC_ep>; }; }; 361 + }; 362 + }; 363 + 364 + test_codec_1 { 365 + /* 366 + * update compatible to indicate more detail behaviour 367 + * if you want. see test-compatible for more detail. 368 + * 369 + * ex) 370 + * - compatible = "test-codec"; 371 + * + compatible = "test-codec-verbose"; 372 + */ 373 + compatible = "test-codec"; 374 + 375 + ports { 376 + #address-cells = <1>; 377 + #size-cells = <0>; 378 + 379 + /* [Normal] */ 380 + port@0 { reg = <0>; codec1_0_ep: endpoint { remote-endpoint = <&cpu1_0_ep>; }; }; 381 + /* [Semi-Multi] */ 382 + port@1 { reg = <1>; codec1_1_ep: endpoint { remote-endpoint = <&smcodec_A_ep>; }; }; 383 + port@2 { reg = <2>; codec1_2_ep: endpoint { remote-endpoint = <&smcodec_B_ep>; }; }; 384 + /* [Multi-Codec-0] */ 385 + port@3 { reg = <3>; codec1_3_ep: endpoint { remote-endpoint = <&mcodec_Aa_ep>; }; }; 386 + port@4 { reg = <4>; codec1_4_ep: endpoint { remote-endpoint = <&mcodec_Ab_ep>; }; }; 387 + /* [Multi-Codec-1] */ 388 + port@5 { reg = <5>; codec1_5_ep: endpoint { remote-endpoint = <&mcodec_Ba_ep>; }; }; 389 + port@6 { reg = <6>; codec1_6_ep: endpoint { remote-endpoint = <&mcodec_Bb_ep>; }; }; 390 + port@7 { reg = <7>; codec1_7_ep: endpoint { remote-endpoint = <&mcodec_Bc_ep>; }; }; 391 + /* [Multi-Codec-2] */ 392 + port@8 { reg = <8>; codec1_8_ep: endpoint { remote-endpoint = <&mcodec_Ca_ep>; }; }; 393 + port@9 { reg = <9>; codec1_9_ep: endpoint { remote-endpoint = <&mcodec_Cb_ep>; }; }; 394 + }; 395 + }; 396 + };
+382
sound/soc/generic/audio-graph-card2-custom-sample2.dtsi
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * audio-graph-card2-custom-sample2.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-sample2.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 + * 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. 41 + * see 42 + * snd_soc_runtime_get_dai_fmt() 43 + * linux/sound/soc/generic/test-component.c :: test_dai_formats 44 + */ 45 + / { 46 + audio-graph-card2-custom-sample-2 { 47 + /* 48 + * You can use audio-graph-card2 directly by using 49 + * 50 + * compatible = "audio-graph-card2"; 51 + */ 52 + compatible = "audio-graph-card2-custom-sample"; 53 + label = "card2-custom-sample-2"; 54 + 55 + /* for [DPCM] */ 56 + /* BE FE */ 57 + routing = "TC DAI0 Playback", "DAI0 Playback", 58 + "TC DAI0 Playback", "DAI1 Playback", 59 + "DAI0 Capture", "TC DAI0 Capture", 60 + "DAI1 Capture", "TC DAI0 Capture", 61 + /* for [DPCM-Multi] */ 62 + /* BE FE */ 63 + "TC DAI1 Playback", "DAI2 Playback", 64 + "TC DAI2 Playback", "DAI2 Playback", 65 + "TC DAI1 Playback", "DAI3 Playback", 66 + "TC DAI2 Playback", "DAI3 Playback", 67 + "DAI2 Capture", "TC DAI1 Capture", 68 + "DAI2 Capture", "TC DAI2 Capture", 69 + "DAI3 Capture", "TC DAI1 Capture", 70 + "DAI3 Capture", "TC DAI2 Capture", 71 + /* for [Codec2Codec] */ 72 + "TC OUT", "TC DAI4 Playback", 73 + "TC DAI3 Capture", "TC IN", 74 + /* for [Codec2Codec-Multi] */ 75 + "TC OUT", "TC DAI7 Playback", 76 + "TC DAI5 Capture", "TC IN", 77 + "TC OUT", "TC DAI8 Playback", 78 + "TC DAI6 Capture", "TC IN"; 79 + 80 + /* 81 + * @ : used at links 82 + */ 83 + links = < 84 + /* 85 + * [DPCM] 86 + * 87 + * cpu20/cpu21 are converting rate to 44.1kHz 88 + * 89 + * FE BE 90 + * <feA> **** <beA> 91 + * cpu2_0 <----@---* *------@---> codec2_0 (44.1kHz) 92 + * cpu2_1 <----@---* * 93 + * <feB> **** 94 + */ 95 + &feA &feB &beA /* both FE / BE */ 96 + 97 + /* 98 + * [DPCM-Multi] 99 + * 100 + * FE BE 101 + * <feC> **** <beB> +-+ 102 + * cpu2_2 <----@---* *------@---> | | -> codec2_1 103 + * cpu2_3 <----@---* * | | -> codec2_2 104 + * <feD> **** +-+ 105 + */ 106 + &feC &feD &beB /* both FE / BE*/ 107 + 108 + /* 109 + * [Codec2Codec] 110 + * 111 + * <c2c> 112 + * +-@-> codec2_3 113 + * | 114 + * +---> codec2_4 115 + */ 116 + &c2c /* CPU side only */ 117 + 118 + /* 119 + * [Codec2Codec-Multi] 120 + * 121 + * --NOTE-- 122 + * Multi connect N:M is not supported by ASoC. 123 + * 124 + * <c2c_m> +-+ 125 + * +---@-->| |-> codec2_5 126 + * | | |-> codec2_6 127 + * | +-+ 128 + * | +-+ 129 + * +------>| |-> codec2_7 130 + * | |-> codec2_8 131 + * +-+ 132 + */ 133 + &c2c_m /* CPU side only */ 134 + >; 135 + 136 + multi { 137 + #address-cells = <1>; 138 + #size-cells = <0>; 139 + 140 + /* 141 + * [DPCM-Multi]::BE 142 + * 143 + * FE BE 144 + * <feC> **** <beB> +---+ 145 + * cpu2_2 <----@---* *------@---> |x a| -> codec2_1 146 + * cpu2_3 <----@---* * | b| -> codec2_2 147 + * <feD> **** +---+ 148 + */ 149 + ports@2 { 150 + reg = <2>; 151 + #address-cells = <1>; 152 + #size-cells = <0>; 153 + port@0 { reg = <0>; mbe_x_ep: endpoint { remote-endpoint = <&beB_ep>; };};/* (x) to pair */ 154 + port@1 { reg = <1>; mbe_a_ep: endpoint { remote-endpoint = <&codec2_1_ep>; };};/* (a) Multi Element */ 155 + port@2 { reg = <2>; mbe_b_ep: endpoint { remote-endpoint = <&codec2_2_ep>; };};/* (b) Multi Element */ 156 + }; 157 + 158 + /* 159 + * [Codec2Codec-Multi]::CPU 160 + * 161 + * <c2c_m> c2cmf +---+ 162 + * +---@---------->|X A|-> codec2_5 163 + * | | B|-> codec2_6 164 + * | +---+ 165 + * | c2cmb +---+ 166 + * +-------------->|x a|-> codec2_7 167 + * | b|-> codec2_8 168 + * +---+ 169 + */ 170 + ports@3 { 171 + reg = <3>; 172 + #address-cells = <1>; 173 + #size-cells = <0>; 174 + port@0 { reg = <0>; mc2c0X_ep: endpoint { remote-endpoint = <&c2cmf_ep>; };};/* (X) to pair */ 175 + port@1 { reg = <1>; mc2c0A_ep: endpoint { remote-endpoint = <&codec2_5_ep>; };};/* (A) Multi Element */ 176 + port@2 { reg = <2>; mc2c0B_ep: endpoint { remote-endpoint = <&codec2_6_ep>; };};/* (B) Multi Element */ 177 + }; 178 + 179 + /* 180 + * [Codec2Codec-Multi]::Codec 181 + * 182 + * <c2c_m> c2cmf +---+ 183 + * +---@---------->|X A|-> codec2_5 184 + * | | B|-> codec2_6 185 + * | +---+ 186 + * | c2cmb +---+ 187 + * +-------------->|x a|-> codec2_7 188 + * | b|-> codec2_8 189 + * +---+ 190 + */ 191 + ports@4 { 192 + reg = <4>; 193 + #address-cells = <1>; 194 + #size-cells = <0>; 195 + port@0 { reg = <0>; mc2c1x_ep: endpoint { remote-endpoint = <&c2cmb_ep>; };};/* (x) to pair */ 196 + port@1 { reg = <1>; mc2c1a_ep: endpoint { remote-endpoint = <&codec2_7_ep>; };};/* (a) Multi Element */ 197 + port@2 { reg = <2>; mc2c1b_ep: endpoint { remote-endpoint = <&codec2_8_ep>; };};/* (b) Multi Element */ 198 + }; 199 + }; 200 + 201 + dpcm { 202 + #address-cells = <1>; 203 + #size-cells = <0>; 204 + 205 + /* FE part */ 206 + ports@0 { 207 + reg = <0>; 208 + 209 + #address-cells = <1>; 210 + #size-cells = <0>; 211 + /* 212 + * [DPCM]::FE 213 + * 214 + * FE BE 215 + * <feA> **** <beA> 216 + * cpu2_0 <----@---* *------@---> codec2_0 (44.1kHz) 217 + * cpu2_1 <----@---* * 218 + * <feB> **** 219 + */ 220 + feA: port@0 { reg = <0>; feA_ep: endpoint { remote-endpoint = <&cpu2_0_ep>; }; }; 221 + feB: port@1 { reg = <1>; feB_ep: endpoint { remote-endpoint = <&cpu2_1_ep>; }; }; 222 + 223 + /* 224 + * [DPCM-Multi]::FE 225 + * 226 + * FE BE 227 + * <feC> **** <beB> +-+ 228 + * cpu2_2 <----@---* *------@---> | | -> codec2_1 229 + * cpu2_3 <----@---* * | | -> codec2_2 230 + * <feD> **** +-+ 231 + */ 232 + feC: port@2 { reg = <2>; feC_ep: endpoint { remote-endpoint = <&cpu2_2_ep>; }; }; 233 + feD: port@3 { reg = <3>; feD_ep: endpoint { remote-endpoint = <&cpu2_3_ep>; }; }; 234 + }; 235 + 236 + /* BE part */ 237 + ports@1 { 238 + reg = <1>; 239 + 240 + #address-cells = <1>; 241 + #size-cells = <0>; 242 + /* 243 + * [DPCM]::BE 244 + * 245 + * FE BE 246 + * <feA> **** <beA> 247 + * cpu2_0 <----@---* *------@---> codec2_0 (44.1kHz) 248 + * cpu2_1 <----@---* * 249 + * <feB> **** 250 + */ 251 + beA: port@0 { reg = <0>; beA_ep: endpoint { remote-endpoint = <&codec2_0_ep>; }; }; 252 + 253 + /* 254 + * [DPCM-Multi]::BE 255 + * 256 + * FE BE 257 + * <feC> **** <beB> +-------+ 258 + * cpu2_2 <----@---* *------@---> |mbe_x | -> codec2_1 259 + * cpu2_3 <----@---* * | | -> codec2_2 260 + * <feD> **** +-------+ 261 + */ 262 + beB: port@1 { reg = <1>; beB_ep: endpoint { remote-endpoint = <&mbe_x_ep>; }; }; 263 + }; 264 + }; 265 + 266 + codec2codec { 267 + #address-cells = <1>; 268 + #size-cells = <0>; 269 + /* 270 + * [Codec2Codec] 271 + * 272 + * <c2c> 273 + * +-@--> codec2_3 274 + * | 275 + * +----> codec2_4 276 + */ 277 + ports@0 { 278 + reg = <0>; 279 + 280 + #address-cells = <1>; 281 + #size-cells = <0>; 282 + 283 + /* use default settings */ 284 + c2c: port@0 { reg = <0>; c2cf_ep: endpoint { remote-endpoint = <&codec2_3_ep>; }; }; 285 + port@1 { reg = <1>; c2cb_ep: endpoint { remote-endpoint = <&codec2_4_ep>; }; }; 286 + }; 287 + 288 + /* 289 + * [Codec2Codec-Multi] 290 + * 291 + * <c2c_m> c2cmf +--------+ 292 + * +---@---------->|mc2c0X |-> codec2_5 293 + * | | |-> codec2_6 294 + * | +--------+ 295 + * | c2cmb +--------+ 296 + * +-------------->|mc2c1x |-> codec2_7 297 + * | |-> codec2_8 298 + * +--------+ 299 + */ 300 + ports@1 { 301 + reg = <1>; 302 + 303 + #address-cells = <1>; 304 + #size-cells = <0>; 305 + 306 + /* use original settings */ 307 + rate = <48000>; 308 + c2c_m: port@0 { reg = <0>; c2cmf_ep: endpoint { remote-endpoint = <&mc2c0X_ep>; }; }; 309 + port@1 { reg = <1>; c2cmb_ep: endpoint { remote-endpoint = <&mc2c1x_ep>; }; }; 310 + }; 311 + }; 312 + }; 313 + 314 + test_cpu_2 { 315 + /* 316 + * update compatible to indicate more detail behaviour 317 + * if you want. see test-compatible for more detail. 318 + * 319 + * ex) 320 + * - compatible = "test-cpu"; 321 + * + compatible = "test-cpu-verbose"; 322 + */ 323 + compatible = "test-cpu"; 324 + ports { 325 + #address-cells = <1>; 326 + #size-cells = <0>; 327 + 328 + bitclock-master; 329 + frame-master; 330 + 331 + /* [DPCM]::FE */ 332 + port@0 { reg = <0>; cpu2_0_ep: endpoint { remote-endpoint = <&feA_ep>; };}; 333 + port@1 { reg = <1>; cpu2_1_ep: endpoint { remote-endpoint = <&feB_ep>; };}; 334 + /* [DPCM-Multi]::FE */ 335 + port@2 { reg = <2>; cpu2_2_ep: endpoint { remote-endpoint = <&feC_ep>; };}; 336 + port@3 { reg = <3>; cpu2_3_ep: endpoint { remote-endpoint = <&feD_ep>; };}; 337 + }; 338 + }; 339 + 340 + test_codec_2 { 341 + /* 342 + * update compatible to indicate more detail behaviour 343 + * if you want. see test-compatible for more detail. 344 + * 345 + * ex) 346 + * - compatible = "test-codec"; 347 + * + compatible = "test-codec-verbose"; 348 + */ 349 + compatible = "test-codec"; 350 + ports { 351 + #address-cells = <1>; 352 + #size-cells = <0>; 353 + 354 + /* 355 + * prefix can be added to *component*, 356 + * see audio-graph-card2::routing 357 + */ 358 + prefix = "TC"; 359 + 360 + /* [DPCM]::BE */ 361 + port@0 { 362 + convert-rate = <44100>; 363 + reg = <0>; codec2_0_ep: endpoint { remote-endpoint = <&beA_ep>; }; 364 + }; 365 + /* [DPCM-Multi]::BE */ 366 + port@1 { reg = <1>; codec2_1_ep: endpoint { remote-endpoint = <&mbe_a_ep>; };}; 367 + port@2 { reg = <2>; codec2_2_ep: endpoint { remote-endpoint = <&mbe_b_ep>; };}; 368 + /* [Codec2Codec] */ 369 + port@3 { bitclock-master; 370 + frame-master; 371 + reg = <3>; codec2_3_ep: endpoint { remote-endpoint = <&c2cf_ep>; };}; 372 + port@4 { reg = <4>; codec2_4_ep: endpoint { remote-endpoint = <&c2cb_ep>; };}; 373 + /* [Codec2Codec-Multi] */ 374 + port@5 { bitclock-master; 375 + frame-master; 376 + reg = <5>; codec2_5_ep: endpoint { remote-endpoint = <&mc2c0A_ep>; };}; 377 + port@6 { reg = <6>; codec2_6_ep: endpoint { remote-endpoint = <&mc2c0B_ep>; };}; 378 + port@7 { reg = <7>; codec2_7_ep: endpoint { remote-endpoint = <&mc2c1a_ep>; };}; 379 + port@8 { reg = <8>; codec2_8_ep: endpoint { remote-endpoint = <&mc2c1b_ep>; };}; 380 + }; 381 + }; 382 + };