Merge tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / Documentation / devicetree / bindings / sound / simple-card.txt
1 Simple-Card:
2
3 Simple-Card specifies audio DAI connections of SoC <-> codec.
4
5 Required properties:
6
7 - compatible                            : "simple-audio-card"
8
9 Optional properties:
10
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.
20 - simple-audio-card,hp-det-gpio         : Reference to GPIO that signals when
21                                           headphones are attached.
22 - simple-audio-card,mic-det-gpio        : Reference to GPIO that signals when
23                                           a microphone is attached.
24
25 Optional subnodes:
26
27 - simple-audio-card,dai-link            : Container for dai-link level
28                                           properties and the CPU and CODEC
29                                           sub-nodes. This container may be
30                                           omitted when the card has only one
31                                           DAI link. See the examples and the
32                                           section bellow.
33
34 Dai-link subnode properties and subnodes:
35
36 If dai-link subnode is omitted and the subnode properties are directly
37 under "sound"-node the subnode property and subnode names have to be
38 prefixed with "simple-audio-card,"-prefix.
39
40 Required dai-link subnodes:
41
42 - cpu                                   : CPU   sub-node
43 - codec                                 : CODEC sub-node
44
45 Optional dai-link subnode properties:
46
47 - format                                : CPU/CODEC common audio format.
48                                           "i2s", "right_j", "left_j" , "dsp_a"
49                                           "dsp_b", "ac97", "pdm", "msb", "lsb"
50 - frame-master                          : Indicates dai-link frame master.
51                                           phandle to a cpu or codec subnode.
52 - bitclock-master                       : Indicates dai-link bit clock master.
53                                           phandle to a cpu or codec subnode.
54 - bitclock-inversion                    : bool property. Add this if the
55                                           dai-link uses bit clock inversion.
56 - frame-inversion                       : bool property. Add this if the
57                                           dai-link uses frame clock inversion.
58
59 For backward compatibility the frame-master and bitclock-master
60 properties can be used as booleans in codec subnode to indicate if the
61 codec is the dai-link frame or bit clock master. In this case there
62 should be no dai-link node, the same properties should not be present
63 at sound-node level, and the bitclock-inversion and frame-inversion
64 properties should also be placed in the codec node if needed.
65
66 Required CPU/CODEC subnodes properties:
67
68 - sound-dai                             : phandle and port of CPU/CODEC
69
70 Optional CPU/CODEC subnodes properties:
71
72 - dai-tdm-slot-num                      : Please refer to tdm-slot.txt.
73 - dai-tdm-slot-width                    : Please refer to tdm-slot.txt.
74 - clocks / system-clock-frequency       : specify subnode's clock if needed.
75                                           it can be specified via "clocks" if system has
76                                           clock node (= common clock), or "system-clock-frequency"
77                                           (if system doens't support common clock)
78
79 Example 1 - single DAI link:
80
81 sound {
82         compatible = "simple-audio-card";
83         simple-audio-card,name = "VF610-Tower-Sound-Card";
84         simple-audio-card,format = "left_j";
85         simple-audio-card,bitclock-master = <&dailink0_master>;
86         simple-audio-card,frame-master = <&dailink0_master>;
87         simple-audio-card,widgets =
88                 "Microphone", "Microphone Jack",
89                 "Headphone", "Headphone Jack",
90                 "Speaker", "External Speaker";
91         simple-audio-card,routing =
92                 "MIC_IN", "Microphone Jack",
93                 "Headphone Jack", "HP_OUT",
94                 "External Speaker", "LINE_OUT";
95
96         simple-audio-card,cpu {
97                 sound-dai = <&sh_fsi2 0>;
98         };
99
100         dailink0_master: simple-audio-card,codec {
101                 sound-dai = <&ak4648>;
102                 clocks = <&osc>;
103         };
104 };
105
106 &i2c0 {
107         ak4648: ak4648@12 {
108                 #sound-dai-cells = <0>;
109                 compatible = "asahi-kasei,ak4648";
110                 reg = <0x12>;
111         };
112 };
113
114 sh_fsi2: sh_fsi2@ec230000 {
115         #sound-dai-cells = <1>;
116         compatible = "renesas,sh_fsi2";
117         reg = <0xec230000 0x400>;
118         interrupt-parent = <&gic>;
119         interrupts = <0 146 0x4>;
120 };
121
122 Example 2 - many DAI links:
123
124 sound {
125         compatible = "simple-audio-card";
126         simple-audio-card,name = "Cubox Audio";
127
128         simple-audio-card,dai-link@0 {          /* I2S - HDMI */
129                 format = "i2s";
130                 cpu {
131                         sound-dai = <&audio1 0>;
132                 };
133                 codec {
134                         sound-dai = <&tda998x 0>;
135                 };
136         };
137
138         simple-audio-card,dai-link@1 {          /* S/PDIF - HDMI */
139                 cpu {
140                         sound-dai = <&audio1 1>;
141                 };
142                 codec {
143                         sound-dai = <&tda998x 1>;
144                 };
145         };
146
147         simple-audio-card,dai-link@2 {          /* S/PDIF - S/PDIF */
148                 cpu {
149                         sound-dai = <&audio1 1>;
150                 };
151                 codec {
152                         sound-dai = <&spdif_codec>;
153                 };
154         };
155 };