Merge remote-tracking branch 'mkp-scsi/4.8/scsi-fixes' into fixes
[cascardo/linux.git] / Documentation / devicetree / bindings / sound / st,sti-asoc-card.txt
1 STMicroelectronics sti ASoC cards
2
3 The sti ASoC Sound Card can be used, for all sti SoCs using internal sti-sas
4 codec or external codecs.
5
6 sti sound drivers allows to expose sti SoC audio interface through the
7 generic ASoC simple card. For details about sound card declaration please refer to
8 Documentation/devicetree/bindings/sound/simple-card.txt.
9
10 1) sti-uniperiph-dai: audio dai device.
11 ---------------------------------------
12
13 Required properties:
14   - compatible: "st,sti-uni-player" or "st,sti-uni-reader"
15
16   - st,syscfg: phandle to boot-device system configuration registers
17
18   - clock-names: name of the clocks listed in clocks property in the same order
19
20   - reg: CPU DAI IP Base address and size entries, listed  in same
21          order than the CPU_DAI properties.
22
23   - reg-names: names of the mapped memory regions listed in regs property in
24                the same order.
25
26   - interrupts: CPU_DAI interrupt line, listed in the same order than the
27                 CPU_DAI properties.
28
29   - dma: CPU_DAI DMA controller phandle and DMA request line, listed in the same
30          order than the CPU_DAI properties.
31
32   - dma-names: identifier string for each DMA request line in the dmas property.
33         "tx" for "st,sti-uni-player" compatibility
34         "rx" for "st,sti-uni-reader" compatibility
35
36   - st,version: IP version integrated in SOC.
37
38   - dai-name: DAI name that describes the IP.
39
40   - st,mode: IP working mode depending on associated codec.
41         "HDMI" connected to HDMI codec and support IEC HDMI formats (player only).
42         "SPDIF" connected to SPDIF codec and support SPDIF formats (player only).
43         "PCM" PCM standard mode for I2S or TDM bus.
44         "TDM" TDM mode for TDM bus.
45
46 Required properties ("st,sti-uni-player" compatibility only):
47   - clocks: CPU_DAI IP clock source, listed in the same order than the
48             CPU_DAI properties.
49
50   - st,uniperiph-id: internal SOC IP instance ID.
51
52 Optional properties:
53   - pinctrl-0: defined for CPU_DAI@1 and CPU_DAI@4 to describe I2S PIOs for
54                external codecs connection.
55
56   - pinctrl-names: should contain only one value - "default".
57
58 Example:
59
60         sti_uni_player1: sti-uni-player@1 {
61                 compatible = "st,sti-uni-player";
62                 status = "okay";
63                 #sound-dai-cells = <0>;
64                 st,syscfg = <&syscfg_core>;
65                 clocks = <&clk_s_d0_flexgen CLK_PCM_1>;
66                 reg = <0x8D81000 0x158>;
67                 interrupts = <GIC_SPI 85 IRQ_TYPE_NONE>;
68                 dmas = <&fdma0 3 0 1>;
69                 st,dai-name = "Uni Player #1 (I2S)";
70                 dma-names = "tx";
71                 st,uniperiph-id = <1>;
72                 st,version = <5>;
73                 st,mode = "TDM";
74         };
75
76         sti_uni_player2: sti-uni-player@2 {
77                 compatible = "st,sti-uni-player";
78                 status = "okay";
79                 #sound-dai-cells = <0>;
80                 st,syscfg = <&syscfg_core>;
81                 clocks = <&clk_s_d0_flexgen CLK_PCM_2>;
82                 reg = <0x8D82000 0x158>;
83                 interrupts = <GIC_SPI 86 IRQ_TYPE_NONE>;
84                 dmas = <&fdma0 4 0 1>;
85                 dai-name = "Uni Player #2 (DAC)";
86                 dma-names = "tx";
87                 st,uniperiph-id = <2>;
88                 st,version = <5>;
89                 st,mode = "PCM";
90         };
91
92         sti_uni_player3: sti-uni-player@3 {
93                 compatible = "st,sti-uni-player";
94                 status = "okay";
95                 #sound-dai-cells = <0>;
96                 st,syscfg = <&syscfg_core>;
97                 clocks = <&clk_s_d0_flexgen CLK_SPDIFF>;
98                 reg = <0x8D85000 0x158>;
99                 interrupts = <GIC_SPI 89 IRQ_TYPE_NONE>;
100                 dmas = <&fdma0 7 0 1>;
101                 dma-names = "tx";
102                 dai-name = "Uni Player #3 (SPDIF)";
103                 st,uniperiph-id = <3>;
104                 st,version = <5>;
105                 st,mode = "SPDIF";
106         };
107
108         sti_uni_reader1: sti-uni-reader@1 {
109                 compatible = "st,sti-uni-reader";
110                 status = "disabled";
111                 #sound-dai-cells = <0>;
112                 st,syscfg = <&syscfg_core>;
113                 reg = <0x8D84000 0x158>;
114                 interrupts = <GIC_SPI 88 IRQ_TYPE_NONE>;
115                 dmas = <&fdma0 6 0 1>;
116                 dma-names = "rx";
117                 dai-name = "Uni Reader #1 (HDMI RX)";
118                 st,version = <3>;
119                 st,mode = "PCM";
120         };
121
122 2) sti-sas-codec: internal audio codec IPs driver
123 -------------------------------------------------
124
125 Required properties:
126   - compatible: "st,sti<chip>-sas-codec" .
127         Should be chip "st,stih416-sas-codec" or "st,stih407-sas-codec"
128
129   - st,syscfg: phandle to boot-device system configuration registers.
130
131   - pinctrl-0: SPDIF PIO description.
132
133   - pinctrl-names: should contain only one value - "default".
134
135 Example:
136         sti_sas_codec: sti-sas-codec {
137                 compatible = "st,stih407-sas-codec";
138                 #sound-dai-cells = <1>;
139                 st,reg_audio = <&syscfg_core>;
140                 pinctrl-names = "default";
141                 pinctrl-0 = <&pinctrl_spdif_out >;
142         };
143
144 Example of audio card declaration:
145         sound {
146                 compatible = "simple-audio-card";
147                 simple-audio-card,name = "sti audio card";
148                 status = "okay";
149
150                 simple-audio-card,dai-link@0 {
151                         /* DAC */
152                         format = "i2s";
153                         dai-tdm-slot-width = <32>;
154                         cpu {
155                                 sound-dai = <&sti_uni_player2>;
156                         };
157
158                         codec {
159                                 sound-dai = <&sti_sasg_codec 1>;
160                         };
161                 };
162                 simple-audio-card,dai-link@1 {
163                         /* SPDIF */
164                         format = "left_j";
165                         cpu {
166                                 sound-dai = <&sti_uni_player3>;
167                         };
168
169                         codec {
170                                 sound-dai = <&sti_sasg_codec 0>;
171                         };
172                 };
173                 simple-audio-card,dai-link@2 {
174                         /* TDM playback  */
175                         format = "left_j";
176                         frame-inversion = <1>;
177                         cpu {
178                                 sound-dai = <&sti_uni_player1>;
179                                 dai-tdm-slot-num = <16>;
180                                 dai-tdm-slot-width = <16>;
181                                 dai-tdm-slot-tx-mask =
182                                         <1 1 1 1 0 0 0 0 0 0 1 1 0 0 1 1>;
183                         };
184
185                         codec {
186                                 sound-dai = <&sti_sasg_codec 3>;
187                         };
188                 };
189         };