audio-graph-card2-custom-sample.dtsi 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  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 <[email protected]>
  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. /* for [DPCM] */
  96. /* BE FE */
  97. routing = "TC DAI3 Playback", "DAI3 Playback",
  98. "TC DAI3 Playback", "DAI4 Playback",
  99. "DAI3 Capture", "TC DAI3 Capture",
  100. "DAI4 Capture", "TC DAI3 Capture",
  101. /* for [DPCM-Multi] */
  102. /* BE FE */
  103. "TC DAI4 Playback", "DAI5 Playback",
  104. "TC DAI5 Playback", "DAI5 Playback",
  105. "TC DAI4 Playback", "DAI6 Playback",
  106. "TC DAI5 Playback", "DAI6 Playback",
  107. "DAI5 Capture", "TC DAI4 Capture",
  108. "DAI5 Capture", "TC DAI5 Capture",
  109. "DAI6 Capture", "TC DAI4 Capture",
  110. "DAI6 Capture", "TC DAI5 Capture",
  111. /* for [Codec2Codec] */
  112. "TC OUT", "TC DAI7 Playback",
  113. "TC DAI6 Capture", "TC IN",
  114. /* for [Codec2Codec-Multi] */
  115. "TC OUT", "TC DAI10 Playback",
  116. "TC DAI8 Capture", "TC IN",
  117. "TC OUT", "TC DAI11 Playback",
  118. "TC DAI9 Capture", "TC IN";
  119. links = <
  120. /*
  121. * [Normal]: cpu side only
  122. * cpu0/codec0
  123. */
  124. &cpu0
  125. /*
  126. * [Multi-CPU/Codec]: cpu side only
  127. * cpu1/cpu2/codec1/codec2
  128. */
  129. &mcpu0
  130. /*
  131. * [DPCM]: both FE / BE
  132. * cpu3/cpu4/codec3
  133. */
  134. &fe00 &fe01 &be0
  135. /*
  136. * [DPCM-Multi]: both FE / BE
  137. * cpu5/cpu6/codec4/codec5
  138. */
  139. &fe10 &fe11 &be1
  140. /*
  141. * [Codec2Codec]: cpu side only
  142. * codec6/codec7
  143. */
  144. &c2c
  145. /*
  146. * [Codec2Codec-Multi]: cpu side only
  147. * codec8/codec9/codec10/codec11
  148. */
  149. &c2c_m
  150. >;
  151. multi {
  152. ports@0 {
  153. /* [Multi-CPU] */
  154. mcpu0: port@0 { mcpu0_ep: endpoint { remote-endpoint = <&mcodec0_ep>; }; };
  155. port@1 { mcpu1_ep: endpoint { remote-endpoint = <&cpu1_ep>; }; };
  156. port@2 { mcpu2_ep: endpoint { remote-endpoint = <&cpu2_ep>; }; };
  157. };
  158. /* [Multi-Codec] */
  159. ports@1 {
  160. port@0 { mcodec0_ep: endpoint { remote-endpoint = <&mcpu0_ep>; }; };
  161. port@1 { mcodec1_ep: endpoint { remote-endpoint = <&codec1_ep>; }; };
  162. port@2 { mcodec2_ep: endpoint { remote-endpoint = <&codec2_ep>; }; };
  163. };
  164. /* [DPCM-Multi]::BE */
  165. ports@2 {
  166. port@0 { mbe_ep: endpoint { remote-endpoint = <&be10_ep>; }; };
  167. port@1 { mbe1_ep: endpoint { remote-endpoint = <&codec4_ep>; }; };
  168. port@2 { mbe2_ep: endpoint { remote-endpoint = <&codec5_ep>; }; };
  169. };
  170. /* [Codec2Codec-Multi]::CPU */
  171. ports@3 {
  172. port@0 { mc2c0_ep: endpoint { remote-endpoint = <&c2cmf_ep>; }; };
  173. port@1 { mc2c00_ep: endpoint { remote-endpoint = <&codec8_ep>; }; };
  174. port@2 { mc2c01_ep: endpoint { remote-endpoint = <&codec9_ep>; }; };
  175. };
  176. /* [Codec2Codec-Multi]::Codec */
  177. ports@4 {
  178. port@0 { mc2c1_ep: endpoint { remote-endpoint = <&c2cmb_ep>; }; };
  179. port@1 { mc2c10_ep: endpoint { remote-endpoint = <&codec10_ep>; }; };
  180. port@2 { mc2c11_ep: endpoint { remote-endpoint = <&codec11_ep>; }; };
  181. };
  182. };
  183. dpcm {
  184. ports@0 {
  185. /* [DPCM]::FE */
  186. fe00: port@0 { fe00_ep: endpoint { remote-endpoint = <&cpu3_ep>; }; };
  187. fe01: port@1 { fe01_ep: endpoint { remote-endpoint = <&cpu4_ep>; }; };
  188. /* [DPCM-Multi]::FE */
  189. fe10: port@2 { fe10_ep: endpoint { remote-endpoint = <&cpu5_ep>; }; };
  190. fe11: port@3 { fe11_ep: endpoint { remote-endpoint = <&cpu6_ep>; }; };
  191. };
  192. ports@1 {
  193. /* [DPCM]::BE */
  194. be0: port@0 { be00_ep: endpoint { remote-endpoint = <&codec3_ep>; }; };
  195. /* [DPCM-Multi]::BE */
  196. be1: port@1 { be10_ep: endpoint { remote-endpoint = <&mbe_ep>; }; };
  197. };
  198. };
  199. codec2codec {
  200. /* [Codec2Codec] */
  201. ports@0 {
  202. /* use default settings */
  203. c2c: port@0 { c2cf_ep: endpoint { remote-endpoint = <&codec6_ep>; }; };
  204. port@1 { c2cb_ep: endpoint { remote-endpoint = <&codec7_ep>; }; };
  205. };
  206. /* [Codec2Codec-Multi] */
  207. ports@1 {
  208. /* use original settings */
  209. rate = <48000>;
  210. c2c_m: port@0 { c2cmf_ep: endpoint { remote-endpoint = <&mc2c0_ep>; }; };
  211. port@1 { c2cmb_ep: endpoint { remote-endpoint = <&mc2c1_ep>; }; };
  212. };
  213. };
  214. };
  215. test_cpu {
  216. /*
  217. * update compatible to indicate more detail behaviour
  218. * if you want. see test-compatible for more detail.
  219. *
  220. * ex)
  221. * - compatible = "test-cpu";
  222. * + compatible = "test-cpu-verbose";
  223. */
  224. compatible = "test-cpu";
  225. ports {
  226. bitclock-master;
  227. frame-master;
  228. /* [Normal] */
  229. cpu0: port@0 { cpu0_ep: endpoint { remote-endpoint = <&codec0_ep>; }; };
  230. /* [Multi-CPU] */
  231. port@1 { cpu1_ep: endpoint { remote-endpoint = <&mcpu1_ep>; }; };
  232. port@2 { cpu2_ep: endpoint { remote-endpoint = <&mcpu2_ep>; }; };
  233. /* [DPCM]::FE */
  234. port@3 { cpu3_ep: endpoint { remote-endpoint = <&fe00_ep>; }; };
  235. port@4 { cpu4_ep: endpoint { remote-endpoint = <&fe01_ep>; }; };
  236. /* [DPCM-Multi]::FE */
  237. port@5 { cpu5_ep: endpoint { remote-endpoint = <&fe10_ep>; }; };
  238. port@6 { cpu6_ep: endpoint { remote-endpoint = <&fe11_ep>; }; };
  239. };
  240. };
  241. test_codec {
  242. /*
  243. * update compatible to indicate more detail behaviour
  244. * if you want. see test-compatible for more detail.
  245. *
  246. * ex)
  247. * - compatible = "test-codec";
  248. * + compatible = "test-codec-verbose";
  249. */
  250. compatible = "test-codec";
  251. ports {
  252. /*
  253. * prefix can be added to *component*,
  254. * see audio-graph-card2::routing
  255. */
  256. prefix = "TC";
  257. /* [Normal] */
  258. port@0 { codec0_ep: endpoint { remote-endpoint = <&cpu0_ep>; }; };
  259. /* [Multi-Codec] */
  260. port@1 { codec1_ep: endpoint { remote-endpoint = <&mcodec1_ep>; }; };
  261. port@2 { codec2_ep: endpoint { remote-endpoint = <&mcodec2_ep>; }; };
  262. /* [DPCM]::BE */
  263. port@3 { codec3_ep: endpoint { remote-endpoint = <&be00_ep>; }; };
  264. /* [DPCM-Multi]::BE */
  265. port@4 { codec4_ep: endpoint { remote-endpoint = <&mbe1_ep>; }; };
  266. port@5 { codec5_ep: endpoint { remote-endpoint = <&mbe2_ep>; }; };
  267. /* [Codec2Codec] */
  268. port@6 { bitclock-master;
  269. frame-master;
  270. codec6_ep: endpoint { remote-endpoint = <&c2cf_ep>; }; };
  271. port@7 { codec7_ep: endpoint { remote-endpoint = <&c2cb_ep>; }; };
  272. /* [Codec2Codec-Multi] */
  273. port@8 { bitclock-master;
  274. frame-master;
  275. codec8_ep: endpoint { remote-endpoint = <&mc2c00_ep>; }; };
  276. port@9 { codec9_ep: endpoint { remote-endpoint = <&mc2c01_ep>; }; };
  277. port@10 { codec10_ep: endpoint { remote-endpoint = <&mc2c10_ep>; }; };
  278. port@11 { codec11_ep: endpoint { remote-endpoint = <&mc2c11_ep>; }; };
  279. };
  280. };
  281. };