Commit | Line | Data |
---|---|---|
fa558c28 KM |
1 | Simple-Card: |
2 | ||
b3ca11ff | 3 | Simple-Card specifies audio DAI connections of SoC <-> codec. |
fa558c28 KM |
4 | |
5 | Required properties: | |
6 | ||
7 | - compatible : "simple-audio-card" | |
8 | ||
9 | Optional properties: | |
10 | ||
66841345 XL |
11 | - simple-audio-card,name : User specified audio sound card name, one string |
12 | property. | |
66841345 | 13 | - simple-audio-card,widgets : Please refer to widgets.txt. |
8c0b8230 | 14 | - simple-audio-card,routing : A list of the connections between audio components. |
d4c22094 XL |
15 | Each entry is a pair of strings, the first being the |
16 | connection's sink, the second being the connection's | |
17 | source. | |
2942a0e2 | 18 | - simple-audio-card,mclk-fs : Multiplication factor between stream rate and codec |
85a4bfd8 AP |
19 | mclk. When defined, mclk-fs property defined in |
20 | dai-link sub nodes are ignored. | |
872bbb3a | 21 | - simple-audio-card,hp-det-gpio : Reference to GPIO that signals when |
3fe24032 | 22 | headphones are attached. |
872bbb3a | 23 | - simple-audio-card,mic-det-gpio : Reference to GPIO that signals when |
3fe24032 | 24 | a microphone is attached. |
899a247c NY |
25 | - simple-audio-card,aux-devs : List of phandles pointing to auxiliary devices, such |
26 | as amplifiers, to be added to the sound card. | |
2942a0e2 | 27 | |
b3ca11ff JS |
28 | Optional subnodes: |
29 | ||
30 | - simple-audio-card,dai-link : Container for dai-link level | |
31 | properties and the CPU and CODEC | |
32 | sub-nodes. This container may be | |
33 | omitted when the card has only one | |
34 | DAI link. See the examples and the | |
7587eb18 | 35 | section below. |
b3ca11ff JS |
36 | |
37 | Dai-link subnode properties and subnodes: | |
38 | ||
39 | If dai-link subnode is omitted and the subnode properties are directly | |
40 | under "sound"-node the subnode property and subnode names have to be | |
41 | prefixed with "simple-audio-card,"-prefix. | |
d4c22094 | 42 | |
b3ca11ff | 43 | Required dai-link subnodes: |
fa558c28 | 44 | |
b3ca11ff JS |
45 | - cpu : CPU sub-node |
46 | - codec : CODEC sub-node | |
015f630d | 47 | |
b3ca11ff JS |
48 | Optional dai-link subnode properties: |
49 | ||
50 | - format : CPU/CODEC common audio format. | |
51 | "i2s", "right_j", "left_j" , "dsp_a" | |
52 | "dsp_b", "ac97", "pdm", "msb", "lsb" | |
53 | - frame-master : Indicates dai-link frame master. | |
54 | phandle to a cpu or codec subnode. | |
55 | - bitclock-master : Indicates dai-link bit clock master. | |
56 | phandle to a cpu or codec subnode. | |
57 | - bitclock-inversion : bool property. Add this if the | |
58 | dai-link uses bit clock inversion. | |
59 | - frame-inversion : bool property. Add this if the | |
60 | dai-link uses frame clock inversion. | |
85a4bfd8 AP |
61 | - mclk-fs : Multiplication factor between stream |
62 | rate and codec mclk, applied only for | |
63 | the dai-link. | |
b3ca11ff JS |
64 | |
65 | For backward compatibility the frame-master and bitclock-master | |
66 | properties can be used as booleans in codec subnode to indicate if the | |
67 | codec is the dai-link frame or bit clock master. In this case there | |
68 | should be no dai-link node, the same properties should not be present | |
69 | at sound-node level, and the bitclock-inversion and frame-inversion | |
70 | properties should also be placed in the codec node if needed. | |
fa558c28 KM |
71 | |
72 | Required CPU/CODEC subnodes properties: | |
73 | ||
74 | - sound-dai : phandle and port of CPU/CODEC | |
75 | ||
76 | Optional CPU/CODEC subnodes properties: | |
77 | ||
b3ca11ff JS |
78 | - dai-tdm-slot-num : Please refer to tdm-slot.txt. |
79 | - dai-tdm-slot-width : Please refer to tdm-slot.txt. | |
fa558c28 KM |
80 | - clocks / system-clock-frequency : specify subnode's clock if needed. |
81 | it can be specified via "clocks" if system has | |
82 | clock node (= common clock), or "system-clock-frequency" | |
83 | (if system doens't support common clock) | |
f9911803 JS |
84 | If a clock is specified, it is |
85 | enabled with clk_prepare_enable() | |
86 | in dai startup() and disabled with | |
87 | clk_disable_unprepare() in dai | |
88 | shutdown(). | |
e9be4ffd DM |
89 | If a clock is specified and a |
90 | multiplication factor is given with | |
91 | mclk-fs, the clock will be set to the | |
92 | calculated mclk frequency when the | |
93 | stream starts. | |
a728f560 VW |
94 | - system-clock-direction-out : specifies clock direction as 'out' on |
95 | initialization. It is useful for some aCPUs with | |
96 | fixed clocks. | |
fa558c28 | 97 | |
c4e8ebb9 | 98 | ------------------------------------------- |
015f630d | 99 | Example 1 - single DAI link: |
c4e8ebb9 | 100 | ------------------------------------------- |
fa558c28 KM |
101 | |
102 | sound { | |
103 | compatible = "simple-audio-card"; | |
66841345 | 104 | simple-audio-card,name = "VF610-Tower-Sound-Card"; |
fa558c28 | 105 | simple-audio-card,format = "left_j"; |
b3ca11ff JS |
106 | simple-audio-card,bitclock-master = <&dailink0_master>; |
107 | simple-audio-card,frame-master = <&dailink0_master>; | |
66841345 XL |
108 | simple-audio-card,widgets = |
109 | "Microphone", "Microphone Jack", | |
110 | "Headphone", "Headphone Jack", | |
111 | "Speaker", "External Speaker"; | |
bb651b3d | 112 | simple-audio-card,routing = |
66841345 | 113 | "MIC_IN", "Microphone Jack", |
d4c22094 | 114 | "Headphone Jack", "HP_OUT", |
66841345 | 115 | "External Speaker", "LINE_OUT"; |
fa558c28 KM |
116 | |
117 | simple-audio-card,cpu { | |
118 | sound-dai = <&sh_fsi2 0>; | |
119 | }; | |
120 | ||
b3ca11ff | 121 | dailink0_master: simple-audio-card,codec { |
fa558c28 | 122 | sound-dai = <&ak4648>; |
fa558c28 KM |
123 | clocks = <&osc>; |
124 | }; | |
125 | }; | |
126 | ||
127 | &i2c0 { | |
128 | ak4648: ak4648@12 { | |
129 | #sound-dai-cells = <0>; | |
130 | compatible = "asahi-kasei,ak4648"; | |
131 | reg = <0x12>; | |
132 | }; | |
133 | }; | |
134 | ||
135 | sh_fsi2: sh_fsi2@ec230000 { | |
136 | #sound-dai-cells = <1>; | |
137 | compatible = "renesas,sh_fsi2"; | |
138 | reg = <0xec230000 0x400>; | |
139 | interrupt-parent = <&gic>; | |
140 | interrupts = <0 146 0x4>; | |
141 | }; | |
015f630d | 142 | |
c4e8ebb9 | 143 | ------------------------------------------- |
015f630d | 144 | Example 2 - many DAI links: |
c4e8ebb9 | 145 | ------------------------------------------- |
015f630d JFM |
146 | |
147 | sound { | |
148 | compatible = "simple-audio-card"; | |
149 | simple-audio-card,name = "Cubox Audio"; | |
015f630d JFM |
150 | |
151 | simple-audio-card,dai-link@0 { /* I2S - HDMI */ | |
ef42e355 | 152 | reg = <0>; |
b3ca11ff JS |
153 | format = "i2s"; |
154 | cpu { | |
015f630d JFM |
155 | sound-dai = <&audio1 0>; |
156 | }; | |
b3ca11ff | 157 | codec { |
015f630d JFM |
158 | sound-dai = <&tda998x 0>; |
159 | }; | |
160 | }; | |
161 | ||
162 | simple-audio-card,dai-link@1 { /* S/PDIF - HDMI */ | |
ef42e355 | 163 | reg = <1>; |
b3ca11ff | 164 | cpu { |
015f630d JFM |
165 | sound-dai = <&audio1 1>; |
166 | }; | |
b3ca11ff | 167 | codec { |
015f630d JFM |
168 | sound-dai = <&tda998x 1>; |
169 | }; | |
170 | }; | |
171 | ||
172 | simple-audio-card,dai-link@2 { /* S/PDIF - S/PDIF */ | |
ef42e355 | 173 | reg = <2>; |
b3ca11ff | 174 | cpu { |
015f630d JFM |
175 | sound-dai = <&audio1 1>; |
176 | }; | |
b3ca11ff | 177 | codec { |
015f630d JFM |
178 | sound-dai = <&spdif_codec>; |
179 | }; | |
180 | }; | |
181 | }; | |
899a247c | 182 | |
c4e8ebb9 | 183 | ------------------------------------------- |
899a247c NY |
184 | Example 3 - route audio from IMX6 SSI2 through TLV320DAC3100 codec |
185 | through TPA6130A2 amplifier to headphones: | |
c4e8ebb9 | 186 | ------------------------------------------- |
899a247c NY |
187 | |
188 | &i2c0 { | |
189 | codec: tlv320dac3100@18 { | |
190 | compatible = "ti,tlv320dac3100"; | |
191 | ... | |
192 | } | |
193 | ||
194 | amp: tpa6130a2@60 { | |
195 | compatible = "ti,tpa6130a2"; | |
196 | ... | |
197 | } | |
198 | } | |
199 | ||
200 | sound { | |
201 | compatible = "simple-audio-card"; | |
202 | ... | |
203 | simple-audio-card,widgets = | |
204 | "Headphone", "Headphone Jack"; | |
205 | simple-audio-card,routing = | |
206 | "Headphone Jack", "HPLEFT", | |
207 | "Headphone Jack", "HPRIGHT", | |
208 | "LEFTIN", "HPL", | |
209 | "RIGHTIN", "HPR"; | |
210 | simple-audio-card,aux-devs = <&>; | |
211 | simple-audio-card,cpu { | |
212 | sound-dai = <&ssi2>; | |
213 | }; | |
214 | simple-audio-card,codec { | |
215 | sound-dai = <&codec>; | |
216 | clocks = ... | |
217 | }; | |
218 | }; | |
c4e8ebb9 KM |
219 | |
220 | ------------------------------------------- | |
221 | Example 4. Sampling Rate Conversion | |
222 | ------------------------------------------- | |
223 | ||
224 | sound { | |
225 | compatible = "simple-audio-card"; | |
226 | ||
227 | simple-audio-card,name = "rsnd-ak4643"; | |
228 | simple-audio-card,format = "left_j"; | |
229 | simple-audio-card,bitclock-master = <&sndcodec>; | |
230 | simple-audio-card,frame-master = <&sndcodec>; | |
231 | ||
232 | simple-audio-card,convert-rate = <48000>; | |
233 | ||
234 | simple-audio-card,prefix = "ak4642"; | |
235 | simple-audio-card,routing = "ak4642 Playback", "DAI0 Playback", | |
236 | "DAI0 Capture", "ak4642 Capture"; | |
237 | ||
238 | sndcpu: simple-audio-card,cpu { | |
239 | sound-dai = <&rcar_sound>; | |
240 | }; | |
241 | ||
242 | sndcodec: simple-audio-card,codec { | |
243 | sound-dai = <&ak4643>; | |
244 | system-clock-frequency = <11289600>; | |
245 | }; | |
246 | }; | |
247 | ||
248 | ------------------------------------------- | |
249 | Example 5. 2 CPU 1 Codec (Mixing) | |
250 | ------------------------------------------- | |
251 | sound { | |
252 | compatible = "simple-audio-card"; | |
253 | ||
254 | simple-audio-card,name = "rsnd-ak4643"; | |
255 | simple-audio-card,format = "left_j"; | |
256 | simple-audio-card,bitclock-master = <&dpcmcpu>; | |
257 | simple-audio-card,frame-master = <&dpcmcpu>; | |
258 | ||
259 | simple-audio-card,routing = "ak4642 Playback", "DAI0 Playback", | |
260 | "ak4642 Playback", "DAI1 Playback"; | |
261 | ||
262 | dpcmcpu: cpu@0 { | |
263 | sound-dai = <&rcar_sound 0>; | |
264 | }; | |
265 | ||
266 | cpu@1 { | |
267 | sound-dai = <&rcar_sound 1>; | |
268 | }; | |
269 | ||
270 | codec { | |
271 | prefix = "ak4642"; | |
272 | sound-dai = <&ak4643>; | |
273 | clocks = <&audio_clock>; | |
274 | }; | |
275 | }; | |
276 | ||
277 | ------------------------------------------- | |
278 | Example 6 - many DAI links with DPCM: | |
279 | ------------------------------------------- | |
280 | ||
281 | CPU0 ------ ak4613 | |
282 | CPU1 ------ PCM3168A-p /* DPCM 1ch/2ch */ | |
283 | CPU2 --/ /* DPCM 3ch/4ch */ | |
284 | CPU3 --/ /* DPCM 5ch/6ch */ | |
285 | CPU4 --/ /* DPCM 7ch/8ch */ | |
286 | CPU5 ------ PCM3168A-c | |
287 | ||
288 | sound { | |
289 | compatible = "simple-audio-card"; | |
290 | ||
291 | simple-audio-card,routing = | |
292 | "pcm3168a Playback", "DAI1 Playback", | |
293 | "pcm3168a Playback", "DAI2 Playback", | |
294 | "pcm3168a Playback", "DAI3 Playback", | |
295 | "pcm3168a Playback", "DAI4 Playback"; | |
296 | ||
297 | simple-audio-card,dai-link@0 { | |
298 | format = "left_j"; | |
299 | bitclock-master = <&sndcpu0>; | |
300 | frame-master = <&sndcpu0>; | |
301 | ||
302 | sndcpu0: cpu { | |
303 | sound-dai = <&rcar_sound 0>; | |
304 | }; | |
305 | codec { | |
306 | sound-dai = <&ak4613>; | |
307 | }; | |
308 | }; | |
309 | simple-audio-card,dai-link@1 { | |
310 | format = "i2s"; | |
311 | bitclock-master = <&sndcpu1>; | |
312 | frame-master = <&sndcpu1>; | |
313 | ||
314 | convert-channels = <8>; /* TDM Split */ | |
315 | ||
316 | sndcpu1: cpu@0 { | |
317 | sound-dai = <&rcar_sound 1>; | |
318 | }; | |
319 | cpu@1 { | |
320 | sound-dai = <&rcar_sound 2>; | |
321 | }; | |
322 | cpu@2 { | |
323 | sound-dai = <&rcar_sound 3>; | |
324 | }; | |
325 | cpu@3 { | |
326 | sound-dai = <&rcar_sound 4>; | |
327 | }; | |
328 | codec { | |
329 | mclk-fs = <512>; | |
330 | prefix = "pcm3168a"; | |
331 | dai-tdm-slot-num = <8>; | |
332 | sound-dai = <&pcm3168a 0>; | |
333 | }; | |
334 | }; | |
335 | simple-audio-card,dai-link@2 { | |
336 | format = "i2s"; | |
337 | bitclock-master = <&sndcpu2>; | |
338 | frame-master = <&sndcpu2>; | |
339 | ||
340 | sndcpu2: cpu { | |
341 | sound-dai = <&rcar_sound 5>; | |
342 | }; | |
343 | codec { | |
344 | mclk-fs = <512>; | |
345 | prefix = "pcm3168a"; | |
346 | sound-dai = <&pcm3168a 1>; | |
347 | }; | |
348 | }; | |
349 | }; |