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. |
2942a0e2 | 25 | |
b3ca11ff JS |
26 | Optional subnodes: |
27 | ||
28 | - simple-audio-card,dai-link : Container for dai-link level | |
29 | properties and the CPU and CODEC | |
30 | sub-nodes. This container may be | |
31 | omitted when the card has only one | |
32 | DAI link. See the examples and the | |
33 | section bellow. | |
34 | ||
35 | Dai-link subnode properties and subnodes: | |
36 | ||
37 | If dai-link subnode is omitted and the subnode properties are directly | |
38 | under "sound"-node the subnode property and subnode names have to be | |
39 | prefixed with "simple-audio-card,"-prefix. | |
d4c22094 | 40 | |
b3ca11ff | 41 | Required dai-link subnodes: |
fa558c28 | 42 | |
b3ca11ff JS |
43 | - cpu : CPU sub-node |
44 | - codec : CODEC sub-node | |
015f630d | 45 | |
b3ca11ff JS |
46 | Optional dai-link subnode properties: |
47 | ||
48 | - format : CPU/CODEC common audio format. | |
49 | "i2s", "right_j", "left_j" , "dsp_a" | |
50 | "dsp_b", "ac97", "pdm", "msb", "lsb" | |
51 | - frame-master : Indicates dai-link frame master. | |
52 | phandle to a cpu or codec subnode. | |
53 | - bitclock-master : Indicates dai-link bit clock master. | |
54 | phandle to a cpu or codec subnode. | |
55 | - bitclock-inversion : bool property. Add this if the | |
56 | dai-link uses bit clock inversion. | |
57 | - frame-inversion : bool property. Add this if the | |
58 | dai-link uses frame clock inversion. | |
85a4bfd8 AP |
59 | - mclk-fs : Multiplication factor between stream |
60 | rate and codec mclk, applied only for | |
61 | the dai-link. | |
b3ca11ff JS |
62 | |
63 | For backward compatibility the frame-master and bitclock-master | |
64 | properties can be used as booleans in codec subnode to indicate if the | |
65 | codec is the dai-link frame or bit clock master. In this case there | |
66 | should be no dai-link node, the same properties should not be present | |
67 | at sound-node level, and the bitclock-inversion and frame-inversion | |
68 | properties should also be placed in the codec node if needed. | |
fa558c28 KM |
69 | |
70 | Required CPU/CODEC subnodes properties: | |
71 | ||
72 | - sound-dai : phandle and port of CPU/CODEC | |
73 | ||
74 | Optional CPU/CODEC subnodes properties: | |
75 | ||
b3ca11ff JS |
76 | - dai-tdm-slot-num : Please refer to tdm-slot.txt. |
77 | - dai-tdm-slot-width : Please refer to tdm-slot.txt. | |
fa558c28 KM |
78 | - clocks / system-clock-frequency : specify subnode's clock if needed. |
79 | it can be specified via "clocks" if system has | |
80 | clock node (= common clock), or "system-clock-frequency" | |
81 | (if system doens't support common clock) | |
f9911803 JS |
82 | If a clock is specified, it is |
83 | enabled with clk_prepare_enable() | |
84 | in dai startup() and disabled with | |
85 | clk_disable_unprepare() in dai | |
86 | shutdown(). | |
fa558c28 | 87 | |
015f630d | 88 | Example 1 - single DAI link: |
fa558c28 KM |
89 | |
90 | sound { | |
91 | compatible = "simple-audio-card"; | |
66841345 | 92 | simple-audio-card,name = "VF610-Tower-Sound-Card"; |
fa558c28 | 93 | simple-audio-card,format = "left_j"; |
b3ca11ff JS |
94 | simple-audio-card,bitclock-master = <&dailink0_master>; |
95 | simple-audio-card,frame-master = <&dailink0_master>; | |
66841345 XL |
96 | simple-audio-card,widgets = |
97 | "Microphone", "Microphone Jack", | |
98 | "Headphone", "Headphone Jack", | |
99 | "Speaker", "External Speaker"; | |
bb651b3d | 100 | simple-audio-card,routing = |
66841345 | 101 | "MIC_IN", "Microphone Jack", |
d4c22094 | 102 | "Headphone Jack", "HP_OUT", |
66841345 | 103 | "External Speaker", "LINE_OUT"; |
fa558c28 KM |
104 | |
105 | simple-audio-card,cpu { | |
106 | sound-dai = <&sh_fsi2 0>; | |
107 | }; | |
108 | ||
b3ca11ff | 109 | dailink0_master: simple-audio-card,codec { |
fa558c28 | 110 | sound-dai = <&ak4648>; |
fa558c28 KM |
111 | clocks = <&osc>; |
112 | }; | |
113 | }; | |
114 | ||
115 | &i2c0 { | |
116 | ak4648: ak4648@12 { | |
117 | #sound-dai-cells = <0>; | |
118 | compatible = "asahi-kasei,ak4648"; | |
119 | reg = <0x12>; | |
120 | }; | |
121 | }; | |
122 | ||
123 | sh_fsi2: sh_fsi2@ec230000 { | |
124 | #sound-dai-cells = <1>; | |
125 | compatible = "renesas,sh_fsi2"; | |
126 | reg = <0xec230000 0x400>; | |
127 | interrupt-parent = <&gic>; | |
128 | interrupts = <0 146 0x4>; | |
129 | }; | |
015f630d JFM |
130 | |
131 | Example 2 - many DAI links: | |
132 | ||
133 | sound { | |
134 | compatible = "simple-audio-card"; | |
135 | simple-audio-card,name = "Cubox Audio"; | |
015f630d JFM |
136 | |
137 | simple-audio-card,dai-link@0 { /* I2S - HDMI */ | |
b3ca11ff JS |
138 | format = "i2s"; |
139 | cpu { | |
015f630d JFM |
140 | sound-dai = <&audio1 0>; |
141 | }; | |
b3ca11ff | 142 | codec { |
015f630d JFM |
143 | sound-dai = <&tda998x 0>; |
144 | }; | |
145 | }; | |
146 | ||
147 | simple-audio-card,dai-link@1 { /* S/PDIF - HDMI */ | |
b3ca11ff | 148 | cpu { |
015f630d JFM |
149 | sound-dai = <&audio1 1>; |
150 | }; | |
b3ca11ff | 151 | codec { |
015f630d JFM |
152 | sound-dai = <&tda998x 1>; |
153 | }; | |
154 | }; | |
155 | ||
156 | simple-audio-card,dai-link@2 { /* S/PDIF - S/PDIF */ | |
b3ca11ff | 157 | cpu { |
015f630d JFM |
158 | sound-dai = <&audio1 1>; |
159 | }; | |
b3ca11ff | 160 | codec { |
015f630d JFM |
161 | sound-dai = <&spdif_codec>; |
162 | }; | |
163 | }; | |
164 | }; |