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