blob: c7b29df4a96353735f23d75576f284d8f16aa649 [file] [log] [blame]
Kuninori Morimoto90e8e502014-03-17 19:29:55 -07001Renesas R-Car sound
2
Kuninori Morimotof1511a12016-03-10 05:29:21 +00003=============================================
4* Modules
5=============================================
6
7Renesas R-Car sound is constructed from below modules
8(for Gen2 or later)
9
10 SCU : Sampling Rate Converter Unit
11 - SRC : Sampling Rate Converter
12 - CMD
13 - CTU : Channel Transfer Unit
14 - MIX : Mixer
15 - DVC : Digital Volume and Mute Function
16 SSIU : Serial Sound Interface Unit
17 SSI : Serial Sound Interface
18
19See detail of each module's channels, connection, limitation on datasheet
20
21=============================================
22* Multi channel
23=============================================
24
25Multi channel is supported by Multi-SSI, or TDM-SSI.
26
27 Multi-SSI : 6ch case, you can use stereo x 3 SSI
28 TDM-SSI : 6ch case, you can use TDM
29
30=============================================
31* Enable/Disable each modules
32=============================================
33
34See datasheet to check SRC/CTU/MIX/DVC connect-limitation.
35DT controls enabling/disabling module.
36${LINUX}/arch/arm/boot/dts/r8a7790-lager.dts can be good example.
37This is example of
38
39Playback: [MEM] -> [SRC2] -> [DVC0] -> [SSIU0/SSI0] -> [codec]
40Capture: [MEM] <- [DVC1] <- [SRC3] <- [SSIU1/SSI1] <- [codec]
41
42 &rcar_sound {
43 ...
44 rcar_sound,dai {
45 dai0 {
46 playback = <&ssi0 &src2 &dvc0>;
47 capture = <&ssi1 &src3 &dvc1>;
48 };
49 };
50 };
51
52You can use below.
53${LINUX}/arch/arm/boot/dts/r8a7790.dts can be good example.
54
55 &src0 &ctu00 &mix0 &dvc0 &ssi0
56 &src1 &ctu01 &mix1 &dvc1 &ssi1
57 &src2 &ctu02 &ssi2
58 &src3 &ctu03 &ssi3
59 &src4 &ssi4
60 &src5 &ctu10 &ssi5
61 &src6 &ctu11 &ssi6
62 &src7 &ctu12 &ssi7
63 &src8 &ctu13 &ssi8
64 &src9 &ssi9
65
66=============================================
67* SRC (Sampling Rate Converter)
68=============================================
69
70 [xx]Hz [yy]Hz
71 ------> [SRC] ------>
72
73SRC can convert [xx]Hz to [yy]Hz. Then, it has below 2 modes
74
75 Asynchronous mode: input data / output data are based on different clocks.
76 you can use this mode on Playback / Capture
77 Synchronous mode: input data / output data are based on same clocks.
78 This mode will be used if system doesn't have its input clock,
79 for example digital TV case.
80 you can use this mode on Playback
81
82------------------
83** Asynchronous mode
84------------------
85
86You need to use "renesas,rsrc-card" sound card for it.
87example)
88
89 sound {
90 compatible = "renesas,rsrc-card";
91 ...
92 /*
93 * SRC Asynchronous mode setting
94 * Playback:
95 * All input data will be converted to 48kHz
96 * Capture:
97 * Inputed 48kHz data will be converted to
98 * system specified Hz
99 */
100 convert-rate = <48000>;
101 ...
102 cpu {
103 sound-dai = <&rcar_sound>;
104 };
105 codec {
106 ...
107 };
108 };
109
110------------------
111** Synchronous mode
112------------------
113
114 > amixer set "SRC Out Rate" on
115 > aplay xxxx.wav
116 > amixer set "SRC Out Rate" 48000
117 > amixer set "SRC Out Rate" 44100
118
119=============================================
120* CTU (Channel Transfer Unit)
121=============================================
122
123 [xx]ch [yy]ch
124 ------> [CTU] -------->
125
126CTU can convert [xx]ch to [yy]ch, or exchange outputed channel.
127CTU conversion needs matrix settings.
128For more detail information, see below
129
130 Renesas R-Car datasheet
131 - Sampling Rate Converter Unit (SCU)
132 - SCU Operation
133 - CMD Block
134 - Functional Blocks in CMD
135
136 Renesas R-Car datasheet
137 - Sampling Rate Converter Unit (SCU)
138 - Register Description
139 - CTUn Scale Value exx Register (CTUn_SVxxR)
140
141 ${LINUX}/sound/soc/sh/rcar/ctu.c
142 - comment of header
143
144You need to use "renesas,rsrc-card" sound card for it.
145example)
146
147 sound {
148 compatible = "renesas,rsrc-card";
149 ...
150 /*
151 * CTU setting
152 * All input data will be converted to 2ch
153 * as output data
154 */
155 convert-channels = <2>;
156 ...
157 cpu {
158 sound-dai = <&rcar_sound>;
159 };
160 codec {
161 ...
162 };
163 };
164
165Ex) Exchange output channel
166 Input -> Output
167 1ch -> 0ch
168 0ch -> 1ch
169
170 example of using matrix
171 output 0ch = (input 0ch x 0) + (input 1ch x 1)
172 output 1ch = (input 0ch x 1) + (input 1ch x 0)
173
174 amixer set "CTU Reset" on
175 amixer set "CTU Pass" 9,10
176 amixer set "CTU SV0" 0,4194304
177 amixer set "CTU SV1" 4194304,0
178
179 example of changing connection
180 amixer set "CTU Reset" on
181 amixer set "CTU Pass" 2,1
182
183=============================================
184* MIX (Mixer)
185=============================================
186
187MIX merges 2 sounds path. You can see 2 sound interface on system,
188and these sounds will be merged by MIX.
189
190 aplay -D plughw:0,0 xxxx.wav &
191 aplay -D plughw:0,1 yyyy.wav
192
193You need to use "renesas,rsrc-card" sound card for it.
194Ex)
195 [MEM] -> [SRC1] -> [CTU02] -+-> [MIX0] -> [DVC0] -> [SSI0]
196 |
197 [MEM] -> [SRC2] -> [CTU03] -+
198
199 sound {
200 compatible = "renesas,rsrc-card";
201 ...
202 cpu@0 {
203 sound-dai = <&rcar_sound 0>;
204 };
205 cpu@1 {
206 sound-dai = <&rcar_sound 1>;
207 };
208 codec {
209 ...
210 };
211 };
212
213 &rcar_sound {
214 ...
215 rcar_sound,dai {
216 dai0 {
217 playback = <&src1 &ctu02 &mix0 &dvc0 &ssi0>;
218 };
219 dai1 {
220 playback = <&src2 &ctu03 &mix0 &dvc0 &ssi0>;
221 };
222 };
223 };
224
225=============================================
226* DVC (Digital Volume and Mute Function)
227=============================================
228
229DVC controls Playback/Capture volume.
230
231Playback Volume
232 amixer set "DVC Out" 100%
233
234Capture Volume
235 amixer set "DVC In" 100%
236
237Playback Mute
238 amixer set "DVC Out Mute" on
239
240Capture Mute
241 amixer set "DVC In Mute" on
242
243Volume Ramp
244 amixer set "DVC Out Ramp Up Rate" "0.125 dB/64 steps"
245 amixer set "DVC Out Ramp Down Rate" "0.125 dB/512 steps"
246 amixer set "DVC Out Ramp" on
247 aplay xxx.wav &
248 amixer set "DVC Out" 80% // Volume Down
249 amixer set "DVC Out" 100% // Volume Up
250
251=============================================
252* SSIU (Serial Sound Interface Unit)
253=============================================
254
255There is no DT settings for SSIU, because SSIU will be automatically
256selected via SSI.
257SSIU can avoid some under/over run error, because it has some buffer.
258But you can't use it if SSI was PIO mode.
259In DMA mode, you can select not to use SSIU by using "no-busif" on DT.
260
261 &ssi0 {
262 no-busif;
263 };
264
265=============================================
266* SSI (Serial Sound Interface)
267=============================================
268
269** PIO mode
270
271You can use PIO mode which is for connection check by using.
272Note: The system will drop non-SSI modules in PIO mode
273even though if DT is selecting other modules.
274
275 &ssi0 {
276 pio-transfer
277 };
278
279** DMA mode without SSIU
280
281You can use DMA without SSIU.
282Note: under/over run, or noise are likely to occur
283
284 &ssi0 {
285 no-busif;
286 };
287
288** PIN sharing
289
290Each SSI can share WS pin. It is based on platform.
291This is example if SSI1 want to share WS pin with SSI0
292
293 &ssi1 {
294 shared-pin;
295 };
296
297** Multi-SSI
298
299You can use Multi-SSI.
300This is example of SSI0/SSI1/SSI2 (= for 6ch)
301
302 &rcar_sound {
303 ...
304 rcar_sound,dai {
305 dai0 {
306 playback = <&ssi0 &ssi1 &ssi2 &src0 &dvc0>;
307 };
308 };
309 };
310
311** TDM-SSI
312
313You can use TDM with SSI.
314This is example of TDM 6ch.
315Driver can automatically switches TDM <-> stereo mode in this case.
316
317 rsnd_tdm: sound {
318 compatible = "simple-audio-card";
319 ...
320 simple-audio-card,cpu {
321 /* system can use TDM 6ch */
322 dai-tdm-slot-num = <6>;
323 sound-dai = <&rcar_sound>;
324 };
325 simple-audio-card,codec {
326 ...
327 };
328 };
329
330
331=============================================
Kuninori Morimoto90e8e502014-03-17 19:29:55 -0700332Required properties:
Kuninori Morimotof1511a12016-03-10 05:29:21 +0000333=============================================
334
Geert Uytterhoeven56ba98a2014-11-10 20:00:42 +0100335- compatible : "renesas,rcar_sound-<soctype>", fallbacks
336 "renesas,rcar_sound-gen1" if generation1, and
Kuninori Morimoto90e8e502014-03-17 19:29:55 -0700337 "renesas,rcar_sound-gen2" if generation2
Kuninori Morimotoac37a452015-09-10 07:01:58 +0000338 "renesas,rcar_sound-gen3" if generation3
Geert Uytterhoeven56ba98a2014-11-10 20:00:42 +0100339 Examples with soctypes are:
Geert Uytterhoeven7667f712015-06-01 12:44:15 +0200340 - "renesas,rcar_sound-r8a7778" (R-Car M1A)
Simon Horman4eb404d2015-11-30 15:02:52 +0900341 - "renesas,rcar_sound-r8a7779" (R-Car H1)
Geert Uytterhoeven56ba98a2014-11-10 20:00:42 +0100342 - "renesas,rcar_sound-r8a7790" (R-Car H2)
343 - "renesas,rcar_sound-r8a7791" (R-Car M2-W)
Simon Horman4eb404d2015-11-30 15:02:52 +0900344 - "renesas,rcar_sound-r8a7793" (R-Car M2-N)
345 - "renesas,rcar_sound-r8a7794" (R-Car E2)
Kuninori Morimotoac37a452015-09-10 07:01:58 +0000346 - "renesas,rcar_sound-r8a7795" (R-Car H3)
Kuninori Morimoto90e8e502014-03-17 19:29:55 -0700347- reg : Should contain the register physical address.
348 required register is
349 SRU/ADG/SSI if generation1
350 SRU/ADG/SSIU/SSI if generation2
Kuninori Morimoto8bab0dd2014-03-23 20:29:15 -0700351- rcar_sound,ssi : Should contain SSI feature.
352 The number of SSI subnode should be same as HW.
353 see below for detail.
354- rcar_sound,src : Should contain SRC feature.
355 The number of SRC subnode should be same as HW.
356 see below for detail.
Kuninori Morimoto9269e3c2015-07-15 07:17:17 +0000357- rcar_sound,ctu : Should contain CTU feature.
358 The number of CTU subnode should be same as HW.
359 see below for detail.
Kuninori Morimoto70fb1052015-07-15 07:17:36 +0000360- rcar_sound,mix : Should contain MIX feature.
361 The number of MIX subnode should be same as HW.
362 see below for detail.
Kuninori Morimoto34cb6122014-06-22 17:59:28 -0700363- rcar_sound,dvc : Should contain DVC feature.
364 The number of DVC subnode should be same as HW.
365 see below for detail.
Kuninori Morimoto8bab0dd2014-03-23 20:29:15 -0700366- rcar_sound,dai : DAI contents.
367 The number of DAI subnode should be same as HW.
368 see below for detail.
Kuninori Morimotoe3d2cec2015-09-10 06:49:54 +0000369- #sound-dai-cells : it must be 0 if your system is using single DAI
370 it must be 1 if your system is using multi DAI
Kuninori Morimoto209c0902015-10-29 07:42:40 +0000371
372Optional properties:
Kuninori Morimoto2a46db42015-09-10 07:04:45 +0000373- #clock-cells : it must be 0 if your system has audio_clkout
374 it must be 1 if your system has audio_clkout0/1/2/3
375- clock-frequency : for all audio_clkout0/1/2/3
Kuninori Morimoto90e8e502014-03-17 19:29:55 -0700376
377SSI subnode properties:
378- interrupts : Should contain SSI interrupt for PIO transfer
379- shared-pin : if shared clock pin
Kuninori Morimoto199e76882014-05-22 23:25:49 -0700380- pio-transfer : use PIO transfer mode
Kuninori Morimotod9288d02014-06-22 17:56:23 -0700381- no-busif : BUSIF is not ussed when [mem -> SSI] via DMA case
Kuninori Morimotoe80a2fb2015-02-20 10:32:49 +0000382- dma : Should contain Audio DMAC entry
383- dma-names : SSI case "rx" (=playback), "tx" (=capture)
384 SSIU case "rxu" (=playback), "txu" (=capture)
Kuninori Morimoto90e8e502014-03-17 19:29:55 -0700385
Kuninori Morimoto8bab0dd2014-03-23 20:29:15 -0700386SRC subnode properties:
Kuninori Morimotoe80a2fb2015-02-20 10:32:49 +0000387- dma : Should contain Audio DMAC entry
388- dma-names : "rx" (=playback), "tx" (=capture)
389
390DVC subnode properties:
391- dma : Should contain Audio DMAC entry
392- dma-names : "tx" (=playback/capture)
Kuninori Morimoto8bab0dd2014-03-23 20:29:15 -0700393
Kuninori Morimoto90e8e502014-03-17 19:29:55 -0700394DAI subnode properties:
395- playback : list of playback modules
396- capture : list of capture modules
397
Kuninori Morimotof1511a12016-03-10 05:29:21 +0000398
399=============================================
Kuninori Morimoto90e8e502014-03-17 19:29:55 -0700400Example:
Kuninori Morimotof1511a12016-03-10 05:29:21 +0000401=============================================
Kuninori Morimoto90e8e502014-03-17 19:29:55 -0700402
Geert Uytterhoeven596f74e2015-04-27 14:49:09 +0200403rcar_sound: sound@ec500000 {
Kuninori Morimoto90e8e502014-03-17 19:29:55 -0700404 #sound-dai-cells = <1>;
Geert Uytterhoeven56ba98a2014-11-10 20:00:42 +0100405 compatible = "renesas,rcar_sound-r8a7791", "renesas,rcar_sound-gen2";
Kuninori Morimoto90e8e502014-03-17 19:29:55 -0700406 reg = <0 0xec500000 0 0x1000>, /* SCU */
407 <0 0xec5a0000 0 0x100>, /* ADG */
408 <0 0xec540000 0 0x1000>, /* SSIU */
Kuninori Morimotod3b1c0b2015-02-20 10:33:09 +0000409 <0 0xec541000 0 0x1280>, /* SSI */
410 <0 0xec740000 0 0x200>; /* Audio DMAC peri peri*/
411 reg-names = "scu", "adg", "ssiu", "ssi", "audmapp";
Kuninori Morimoto90e8e502014-03-17 19:29:55 -0700412
Kuninori Morimotobb02714f2015-02-20 10:32:15 +0000413 clocks = <&mstp10_clks R8A7790_CLK_SSI_ALL>,
414 <&mstp10_clks R8A7790_CLK_SSI9>, <&mstp10_clks R8A7790_CLK_SSI8>,
415 <&mstp10_clks R8A7790_CLK_SSI7>, <&mstp10_clks R8A7790_CLK_SSI6>,
416 <&mstp10_clks R8A7790_CLK_SSI5>, <&mstp10_clks R8A7790_CLK_SSI4>,
417 <&mstp10_clks R8A7790_CLK_SSI3>, <&mstp10_clks R8A7790_CLK_SSI2>,
418 <&mstp10_clks R8A7790_CLK_SSI1>, <&mstp10_clks R8A7790_CLK_SSI0>,
419 <&mstp10_clks R8A7790_CLK_SCU_SRC9>, <&mstp10_clks R8A7790_CLK_SCU_SRC8>,
420 <&mstp10_clks R8A7790_CLK_SCU_SRC7>, <&mstp10_clks R8A7790_CLK_SCU_SRC6>,
421 <&mstp10_clks R8A7790_CLK_SCU_SRC5>, <&mstp10_clks R8A7790_CLK_SCU_SRC4>,
422 <&mstp10_clks R8A7790_CLK_SCU_SRC3>, <&mstp10_clks R8A7790_CLK_SCU_SRC2>,
423 <&mstp10_clks R8A7790_CLK_SCU_SRC1>, <&mstp10_clks R8A7790_CLK_SCU_SRC0>,
424 <&mstp10_clks R8A7790_CLK_SCU_DVC0>, <&mstp10_clks R8A7790_CLK_SCU_DVC1>,
425 <&audio_clk_a>, <&audio_clk_b>, <&audio_clk_c>, <&m2_clk>;
426 clock-names = "ssi-all",
427 "ssi.9", "ssi.8", "ssi.7", "ssi.6", "ssi.5",
428 "ssi.4", "ssi.3", "ssi.2", "ssi.1", "ssi.0",
429 "src.9", "src.8", "src.7", "src.6", "src.5",
430 "src.4", "src.3", "src.2", "src.1", "src.0",
431 "dvc.0", "dvc.1",
432 "clk_a", "clk_b", "clk_c", "clk_i";
433
Kuninori Morimoto34cb6122014-06-22 17:59:28 -0700434 rcar_sound,dvc {
Kuninori Morimotoe80a2fb2015-02-20 10:32:49 +0000435 dvc0: dvc@0 {
436 dmas = <&audma0 0xbc>;
437 dma-names = "tx";
438 };
439 dvc1: dvc@1 {
440 dmas = <&audma0 0xbe>;
441 dma-names = "tx";
442 };
Kuninori Morimoto34cb6122014-06-22 17:59:28 -0700443 };
444
Kuninori Morimoto70fb1052015-07-15 07:17:36 +0000445 rcar_sound,mix {
446 mix0: mix@0 { };
447 mix1: mix@1 { };
448 };
449
Kuninori Morimoto9269e3c2015-07-15 07:17:17 +0000450 rcar_sound,ctu {
451 ctu00: ctu@0 { };
452 ctu01: ctu@1 { };
453 ctu02: ctu@2 { };
454 ctu03: ctu@3 { };
455 ctu10: ctu@4 { };
456 ctu11: ctu@5 { };
457 ctu12: ctu@6 { };
458 ctu13: ctu@7 { };
459 };
460
Kuninori Morimoto90e8e502014-03-17 19:29:55 -0700461 rcar_sound,src {
Kuninori Morimoto5cf4f682015-02-20 10:31:55 +0000462 src0: src@0 {
463 interrupts = <0 352 IRQ_TYPE_LEVEL_HIGH>;
Kuninori Morimotoe80a2fb2015-02-20 10:32:49 +0000464 dmas = <&audma0 0x85>, <&audma1 0x9a>;
465 dma-names = "rx", "tx";
Kuninori Morimoto5cf4f682015-02-20 10:31:55 +0000466 };
467 src1: src@1 {
468 interrupts = <0 353 IRQ_TYPE_LEVEL_HIGH>;
Kuninori Morimotoe80a2fb2015-02-20 10:32:49 +0000469 dmas = <&audma0 0x87>, <&audma1 0x9c>;
470 dma-names = "rx", "tx";
Kuninori Morimoto5cf4f682015-02-20 10:31:55 +0000471 };
472 src2: src@2 {
473 interrupts = <0 354 IRQ_TYPE_LEVEL_HIGH>;
Kuninori Morimotoe80a2fb2015-02-20 10:32:49 +0000474 dmas = <&audma0 0x89>, <&audma1 0x9e>;
475 dma-names = "rx", "tx";
Kuninori Morimoto5cf4f682015-02-20 10:31:55 +0000476 };
477 src3: src@3 {
478 interrupts = <0 355 IRQ_TYPE_LEVEL_HIGH>;
Kuninori Morimotoe80a2fb2015-02-20 10:32:49 +0000479 dmas = <&audma0 0x8b>, <&audma1 0xa0>;
480 dma-names = "rx", "tx";
Kuninori Morimoto5cf4f682015-02-20 10:31:55 +0000481 };
482 src4: src@4 {
483 interrupts = <0 356 IRQ_TYPE_LEVEL_HIGH>;
Kuninori Morimotoe80a2fb2015-02-20 10:32:49 +0000484 dmas = <&audma0 0x8d>, <&audma1 0xb0>;
485 dma-names = "rx", "tx";
Kuninori Morimoto5cf4f682015-02-20 10:31:55 +0000486 };
487 src5: src@5 {
488 interrupts = <0 357 IRQ_TYPE_LEVEL_HIGH>;
Kuninori Morimotoe80a2fb2015-02-20 10:32:49 +0000489 dmas = <&audma0 0x8f>, <&audma1 0xb2>;
490 dma-names = "rx", "tx";
Kuninori Morimoto5cf4f682015-02-20 10:31:55 +0000491 };
492 src6: src@6 {
493 interrupts = <0 358 IRQ_TYPE_LEVEL_HIGH>;
Kuninori Morimotoe80a2fb2015-02-20 10:32:49 +0000494 dmas = <&audma0 0x91>, <&audma1 0xb4>;
495 dma-names = "rx", "tx";
Kuninori Morimoto5cf4f682015-02-20 10:31:55 +0000496 };
497 src7: src@7 {
498 interrupts = <0 359 IRQ_TYPE_LEVEL_HIGH>;
Kuninori Morimotoe80a2fb2015-02-20 10:32:49 +0000499 dmas = <&audma0 0x93>, <&audma1 0xb6>;
500 dma-names = "rx", "tx";
Kuninori Morimoto5cf4f682015-02-20 10:31:55 +0000501 };
502 src8: src@8 {
503 interrupts = <0 360 IRQ_TYPE_LEVEL_HIGH>;
Kuninori Morimotoe80a2fb2015-02-20 10:32:49 +0000504 dmas = <&audma0 0x95>, <&audma1 0xb8>;
505 dma-names = "rx", "tx";
Kuninori Morimoto5cf4f682015-02-20 10:31:55 +0000506 };
507 src9: src@9 {
508 interrupts = <0 361 IRQ_TYPE_LEVEL_HIGH>;
Kuninori Morimotoe80a2fb2015-02-20 10:32:49 +0000509 dmas = <&audma0 0x97>, <&audma1 0xba>;
510 dma-names = "rx", "tx";
Kuninori Morimoto5cf4f682015-02-20 10:31:55 +0000511 };
Kuninori Morimoto90e8e502014-03-17 19:29:55 -0700512 };
513
514 rcar_sound,ssi {
515 ssi0: ssi@0 {
516 interrupts = <0 370 IRQ_TYPE_LEVEL_HIGH>;
Kuninori Morimotoe80a2fb2015-02-20 10:32:49 +0000517 dmas = <&audma0 0x01>, <&audma1 0x02>, <&audma0 0x15>, <&audma1 0x16>;
518 dma-names = "rx", "tx", "rxu", "txu";
Kuninori Morimoto90e8e502014-03-17 19:29:55 -0700519 };
520 ssi1: ssi@1 {
521 interrupts = <0 371 IRQ_TYPE_LEVEL_HIGH>;
Kuninori Morimotoe80a2fb2015-02-20 10:32:49 +0000522 dmas = <&audma0 0x03>, <&audma1 0x04>, <&audma0 0x49>, <&audma1 0x4a>;
523 dma-names = "rx", "tx", "rxu", "txu";
Kuninori Morimoto90e8e502014-03-17 19:29:55 -0700524 };
525 ssi2: ssi@2 {
526 interrupts = <0 372 IRQ_TYPE_LEVEL_HIGH>;
Kuninori Morimotoe80a2fb2015-02-20 10:32:49 +0000527 dmas = <&audma0 0x05>, <&audma1 0x06>, <&audma0 0x63>, <&audma1 0x64>;
528 dma-names = "rx", "tx", "rxu", "txu";
Kuninori Morimoto90e8e502014-03-17 19:29:55 -0700529 };
530 ssi3: ssi@3 {
531 interrupts = <0 373 IRQ_TYPE_LEVEL_HIGH>;
Kuninori Morimotoe80a2fb2015-02-20 10:32:49 +0000532 dmas = <&audma0 0x07>, <&audma1 0x08>, <&audma0 0x6f>, <&audma1 0x70>;
533 dma-names = "rx", "tx", "rxu", "txu";
Kuninori Morimoto90e8e502014-03-17 19:29:55 -0700534 };
535 ssi4: ssi@4 {
536 interrupts = <0 374 IRQ_TYPE_LEVEL_HIGH>;
Kuninori Morimotoe80a2fb2015-02-20 10:32:49 +0000537 dmas = <&audma0 0x09>, <&audma1 0x0a>, <&audma0 0x71>, <&audma1 0x72>;
538 dma-names = "rx", "tx", "rxu", "txu";
Kuninori Morimoto90e8e502014-03-17 19:29:55 -0700539 };
540 ssi5: ssi@5 {
541 interrupts = <0 375 IRQ_TYPE_LEVEL_HIGH>;
Kuninori Morimotoe80a2fb2015-02-20 10:32:49 +0000542 dmas = <&audma0 0x0b>, <&audma1 0x0c>, <&audma0 0x73>, <&audma1 0x74>;
543 dma-names = "rx", "tx", "rxu", "txu";
Kuninori Morimoto90e8e502014-03-17 19:29:55 -0700544 };
545 ssi6: ssi@6 {
546 interrupts = <0 376 IRQ_TYPE_LEVEL_HIGH>;
Kuninori Morimotoe80a2fb2015-02-20 10:32:49 +0000547 dmas = <&audma0 0x0d>, <&audma1 0x0e>, <&audma0 0x75>, <&audma1 0x76>;
548 dma-names = "rx", "tx", "rxu", "txu";
Kuninori Morimoto90e8e502014-03-17 19:29:55 -0700549 };
550 ssi7: ssi@7 {
551 interrupts = <0 377 IRQ_TYPE_LEVEL_HIGH>;
Kuninori Morimotoe80a2fb2015-02-20 10:32:49 +0000552 dmas = <&audma0 0x0f>, <&audma1 0x10>, <&audma0 0x79>, <&audma1 0x7a>;
553 dma-names = "rx", "tx", "rxu", "txu";
Kuninori Morimoto90e8e502014-03-17 19:29:55 -0700554 };
555 ssi8: ssi@8 {
556 interrupts = <0 378 IRQ_TYPE_LEVEL_HIGH>;
Kuninori Morimotoe80a2fb2015-02-20 10:32:49 +0000557 dmas = <&audma0 0x11>, <&audma1 0x12>, <&audma0 0x7b>, <&audma1 0x7c>;
558 dma-names = "rx", "tx", "rxu", "txu";
Kuninori Morimoto90e8e502014-03-17 19:29:55 -0700559 };
560 ssi9: ssi@9 {
561 interrupts = <0 379 IRQ_TYPE_LEVEL_HIGH>;
Kuninori Morimotoe80a2fb2015-02-20 10:32:49 +0000562 dmas = <&audma0 0x13>, <&audma1 0x14>, <&audma0 0x7d>, <&audma1 0x7e>;
563 dma-names = "rx", "tx", "rxu", "txu";
Kuninori Morimoto90e8e502014-03-17 19:29:55 -0700564 };
565 };
566
567 rcar_sound,dai {
568 dai0 {
569 playback = <&ssi5 &src5>;
570 capture = <&ssi6>;
571 };
572 dai1 {
573 playback = <&ssi3>;
574 };
575 dai2 {
576 capture = <&ssi4>;
577 };
578 dai3 {
579 playback = <&ssi7>;
580 };
581 dai4 {
582 capture = <&ssi8>;
583 };
584 };
585};
Kuninori Morimotof3f17d32015-12-17 02:59:09 +0000586
Kuninori Morimotof1511a12016-03-10 05:29:21 +0000587=============================================
Kuninori Morimotof3f17d32015-12-17 02:59:09 +0000588Example: simple sound card
Kuninori Morimotof1511a12016-03-10 05:29:21 +0000589=============================================
Kuninori Morimotof3f17d32015-12-17 02:59:09 +0000590
591 rsnd_ak4643: sound {
592 compatible = "simple-audio-card";
593
594 simple-audio-card,format = "left_j";
595 simple-audio-card,bitclock-master = <&sndcodec>;
596 simple-audio-card,frame-master = <&sndcodec>;
597
598 sndcpu: simple-audio-card,cpu {
599 sound-dai = <&rcar_sound>;
600 };
601
602 sndcodec: simple-audio-card,codec {
603 sound-dai = <&ak4643>;
604 clocks = <&audio_clock>;
605 };
606 };
607
608&rcar_sound {
609 pinctrl-0 = <&sound_pins &sound_clk_pins>;
610 pinctrl-names = "default";
611
612 /* Single DAI */
613 #sound-dai-cells = <0>;
614
615 status = "okay";
616
617 rcar_sound,dai {
618 dai0 {
619 playback = <&ssi0 &src2 &dvc0>;
620 capture = <&ssi1 &src3 &dvc1>;
621 };
622 };
623};
624
625&ssi1 {
626 shared-pin;
627};
Kuninori Morimoto44bf53612015-12-17 02:59:31 +0000628
Kuninori Morimotof1511a12016-03-10 05:29:21 +0000629=============================================
Kuninori Morimoto44bf53612015-12-17 02:59:31 +0000630Example: simple sound card for TDM
Kuninori Morimotof1511a12016-03-10 05:29:21 +0000631=============================================
Kuninori Morimoto44bf53612015-12-17 02:59:31 +0000632
633 rsnd_tdm: sound {
634 compatible = "simple-audio-card";
635
636 simple-audio-card,format = "left_j";
637 simple-audio-card,bitclock-master = <&sndcodec>;
638 simple-audio-card,frame-master = <&sndcodec>;
639
640 sndcpu: simple-audio-card,cpu {
641 sound-dai = <&rcar_sound>;
642 dai-tdm-slot-num = <6>;
643 };
644
645 sndcodec: simple-audio-card,codec {
646 sound-dai = <&xxx>;
647 };
648 };
Kuninori Morimotob4c83b12015-12-17 03:00:10 +0000649
Kuninori Morimotof1511a12016-03-10 05:29:21 +0000650=============================================
Kuninori Morimotob4c83b12015-12-17 03:00:10 +0000651Example: simple sound card for Multi channel
Kuninori Morimotof1511a12016-03-10 05:29:21 +0000652=============================================
Kuninori Morimotob4c83b12015-12-17 03:00:10 +0000653
654&rcar_sound {
655 pinctrl-0 = <&sound_pins &sound_clk_pins>;
656 pinctrl-names = "default";
657
658 /* Single DAI */
659 #sound-dai-cells = <0>;
660
661 status = "okay";
662
663 rcar_sound,dai {
664 dai0 {
665 playback = <&ssi0 &ssi1 &ssi2 &src0 &dvc0>;
666 };
667 };
668};