Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[cris-mirror.git] / Documentation / devicetree / bindings / sound / simple-card.txt
blob17c13e74667da8d2135fa3360926909b6dbc569b
1 Simple-Card:
3 Simple-Card specifies audio DAI connections of SoC <-> codec.
5 Required properties:
7 - compatible                            : "simple-audio-card"
9 Optional properties:
11 - simple-audio-card,name                : User specified audio sound card name, one string
12                                           property.
13 - simple-audio-card,widgets             : Please refer to widgets.txt.
14 - simple-audio-card,routing             : A list of the connections between audio components.
15                                           Each entry is a pair of strings, the first being the
16                                           connection's sink, the second being the connection's
17                                           source.
18 - simple-audio-card,mclk-fs             : Multiplication factor between stream rate and codec
19                                           mclk. When defined, mclk-fs property defined in
20                                           dai-link sub nodes are ignored.
21 - simple-audio-card,hp-det-gpio         : Reference to GPIO that signals when
22                                           headphones are attached.
23 - simple-audio-card,mic-det-gpio        : Reference to GPIO that signals when
24                                           a microphone is attached.
25 - simple-audio-card,aux-devs            : List of phandles pointing to auxiliary devices, such
26                                           as amplifiers, to be added to the sound card.
28 Optional subnodes:
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
35                                           section below.
37 Dai-link subnode properties and subnodes:
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.
43 Required dai-link subnodes:
45 - cpu                                   : CPU   sub-node
46 - codec                                 : CODEC sub-node
48 Optional dai-link subnode properties:
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.
61 - mclk-fs                               : Multiplication factor between stream
62                                           rate and codec mclk, applied only for
63                                           the dai-link.
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.
72 Required CPU/CODEC subnodes properties:
74 - sound-dai                             : phandle and port of CPU/CODEC
76 Optional CPU/CODEC subnodes properties:
78 - dai-tdm-slot-num                      : Please refer to tdm-slot.txt.
79 - dai-tdm-slot-width                    : Please refer to tdm-slot.txt.
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)
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().
89 - system-clock-direction-out            : specifies clock direction as 'out' on
90                                           initialization. It is useful for some aCPUs with
91                                           fixed clocks.
93 Example 1 - single DAI link:
95 sound {
96         compatible = "simple-audio-card";
97         simple-audio-card,name = "VF610-Tower-Sound-Card";
98         simple-audio-card,format = "left_j";
99         simple-audio-card,bitclock-master = <&dailink0_master>;
100         simple-audio-card,frame-master = <&dailink0_master>;
101         simple-audio-card,widgets =
102                 "Microphone", "Microphone Jack",
103                 "Headphone", "Headphone Jack",
104                 "Speaker", "External Speaker";
105         simple-audio-card,routing =
106                 "MIC_IN", "Microphone Jack",
107                 "Headphone Jack", "HP_OUT",
108                 "External Speaker", "LINE_OUT";
110         simple-audio-card,cpu {
111                 sound-dai = <&sh_fsi2 0>;
112         };
114         dailink0_master: simple-audio-card,codec {
115                 sound-dai = <&ak4648>;
116                 clocks = <&osc>;
117         };
120 &i2c0 {
121         ak4648: ak4648@12 {
122                 #sound-dai-cells = <0>;
123                 compatible = "asahi-kasei,ak4648";
124                 reg = <0x12>;
125         };
128 sh_fsi2: sh_fsi2@ec230000 {
129         #sound-dai-cells = <1>;
130         compatible = "renesas,sh_fsi2";
131         reg = <0xec230000 0x400>;
132         interrupt-parent = <&gic>;
133         interrupts = <0 146 0x4>;
136 Example 2 - many DAI links:
138 sound {
139         compatible = "simple-audio-card";
140         simple-audio-card,name = "Cubox Audio";
142         simple-audio-card,dai-link@0 {          /* I2S - HDMI */
143                 reg = <0>;
144                 format = "i2s";
145                 cpu {
146                         sound-dai = <&audio1 0>;
147                 };
148                 codec {
149                         sound-dai = <&tda998x 0>;
150                 };
151         };
153         simple-audio-card,dai-link@1 {          /* S/PDIF - HDMI */
154                 reg = <1>;
155                 cpu {
156                         sound-dai = <&audio1 1>;
157                 };
158                 codec {
159                         sound-dai = <&tda998x 1>;
160                 };
161         };
163         simple-audio-card,dai-link@2 {          /* S/PDIF - S/PDIF */
164                 reg = <2>;
165                 cpu {
166                         sound-dai = <&audio1 1>;
167                 };
168                 codec {
169                         sound-dai = <&spdif_codec>;
170                 };
171         };
174 Example 3 - route audio from IMX6 SSI2 through TLV320DAC3100 codec
175 through TPA6130A2 amplifier to headphones:
177 &i2c0 {
178         codec: tlv320dac3100@18 {
179                 compatible = "ti,tlv320dac3100";
180                 ...
181         }
183         amp: tpa6130a2@60 {
184                 compatible = "ti,tpa6130a2";
185                 ...
186         }
189 sound {
190         compatible = "simple-audio-card";
191         ...
192         simple-audio-card,widgets =
193                 "Headphone", "Headphone Jack";
194         simple-audio-card,routing =
195                 "Headphone Jack", "HPLEFT",
196                 "Headphone Jack", "HPRIGHT",
197                 "LEFTIN", "HPL",
198                 "RIGHTIN", "HPR";
199         simple-audio-card,aux-devs = <&amp>;
200         simple-audio-card,cpu {
201                 sound-dai = <&ssi2>;
202         };
203         simple-audio-card,codec {
204                 sound-dai = <&codec>;
205                 clocks = ...
206         };