blob: 59df8a832310da21acab762924d6a012ea836ee7 [file] [log] [blame]
Tom Rini53633a82024-02-29 12:33:36 -05001# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/sound/st,stm32-sai.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: STMicroelectronics STM32 Serial Audio Interface (SAI)
8
9maintainers:
10 - Olivier Moysan <olivier.moysan@foss.st.com>
11
12description:
13 The SAI interface (Serial Audio Interface) offers a wide set of audio
14 protocols as I2S standards, LSB or MSB-justified, PCM/DSP, TDM, and AC'97.
15 The SAI contains two independent audio sub-blocks. Each sub-block has
16 its own clock generator and I/O lines controller.
17
18properties:
19 compatible:
20 enum:
21 - st,stm32f4-sai
22 - st,stm32h7-sai
23
24 reg:
25 items:
26 - description: Base address and size of SAI common register set.
27 - description: Base address and size of SAI identification register set.
28 minItems: 1
29
30 ranges:
31 maxItems: 1
32
33 interrupts:
34 maxItems: 1
35
36 resets:
37 maxItems: 1
38
39 "#address-cells":
40 const: 1
41
42 "#size-cells":
43 const: 1
44
45 clocks:
46 maxItems: 3
47
48 clock-names:
49 maxItems: 3
50
51required:
52 - compatible
53 - reg
54 - ranges
55 - "#address-cells"
56 - "#size-cells"
57 - clocks
58 - clock-names
59
60patternProperties:
61 "^audio-controller@[0-9a-f]+$":
62 type: object
63 additionalProperties: false
64 description:
65 Two subnodes corresponding to SAI sub-block instances A et B
66 can be defined. Subnode can be omitted for unused sub-block.
67
68 properties:
69 compatible:
70 description: Compatible for SAI sub-block A or B.
71 pattern: "st,stm32-sai-sub-[ab]"
72
73 "#sound-dai-cells":
74 const: 0
75
76 reg:
77 maxItems: 1
78
79 clocks:
80 items:
81 - description: sai_ck clock feeding the internal clock generator.
82 - description: MCLK clock from a SAI set as master clock provider.
83 minItems: 1
84
85 clock-names:
86 items:
87 - const: sai_ck
88 - const: MCLK
89 minItems: 1
90
91 dmas:
92 maxItems: 1
93
94 dma-names:
95 description: |
96 rx: SAI sub-block is configured as a capture DAI.
97 tx: SAI sub-block is configured as a playback DAI.
98 enum: [ rx, tx ]
99
100 st,sync:
101 description:
102 Configure the SAI sub-block as slave of another SAI sub-block.
103 By default SAI sub-block is in asynchronous mode.
104 Must contain the phandle and index of the SAI sub-block providing
105 the synchronization.
106 $ref: /schemas/types.yaml#/definitions/phandle-array
107 items:
108 - items:
109 - description: phandle of the SAI sub-block
110 - description: index of the SAI sub-block
111
112 st,iec60958:
113 description:
114 If set, support S/PDIF IEC6958 protocol for playback.
115 IEC60958 protocol is not available for capture.
116 By default, custom protocol is assumed, meaning that protocol is
117 configured according to protocol defined in related DAI link node,
118 such as i2s, left justified, right justified, dsp and pdm protocols.
119 $ref: /schemas/types.yaml#/definitions/flag
120
121 "#clock-cells":
122 description: Configure the SAI device as master clock provider.
123 const: 0
124
125 port:
126 $ref: audio-graph-port.yaml#
127 unevaluatedProperties: false
128
129 required:
130 - compatible
131 - "#sound-dai-cells"
132 - reg
133 - clocks
134 - clock-names
135 - dmas
136 - dma-names
137
138allOf:
139 - if:
140 properties:
141 compatible:
142 contains:
143 const: st,stm32f4-sai
144 then:
145 properties:
146 clocks:
147 items:
148 - description: x8k, SAI parent clock for sampling rates multiple of 8kHz.
149 - description: x11k, SAI parent clock for sampling rates multiple of 11.025kHz.
150
151 clock-names:
152 items:
153 - const: x8k
154 - const: x11k
155 else:
156 properties:
157 clocks:
158 items:
159 - description: pclk feeds the peripheral bus interface.
160 - description: x8k, SAI parent clock for sampling rates multiple of 8kHz.
161 - description: x11k, SAI parent clock for sampling rates multiple of 11.025kHz.
162
163 clock-names:
164 items:
165 - const: pclk
166 - const: x8k
167 - const: x11k
168
169additionalProperties: false
170
171examples:
172 - |
173 #include <dt-bindings/interrupt-controller/arm-gic.h>
174 #include <dt-bindings/clock/stm32mp1-clks.h>
175 #include <dt-bindings/reset/stm32mp1-resets.h>
176 sai2: sai@4400b000 {
177 compatible = "st,stm32h7-sai";
178 #address-cells = <1>;
179 #size-cells = <1>;
180 ranges = <0 0x4400b000 0x400>;
181 reg = <0x4400b000 0x4>, <0x4400b3f0 0x10>;
182 clocks = <&rcc SAI2>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
183 clock-names = "pclk", "x8k", "x11k";
184 pinctrl-names = "default", "sleep";
185 pinctrl-0 = <&sai2a_pins_a>, <&sai2b_pins_b>;
186 pinctrl-1 = <&sai2a_sleep_pins_a>, <&sai2b_sleep_pins_b>;
187
188 sai2a: audio-controller@4400b004 {
189 #sound-dai-cells = <0>;
190 compatible = "st,stm32-sai-sub-a";
191 reg = <0x4 0x1c>;
192 dmas = <&dmamux1 89 0x400 0x01>;
193 dma-names = "tx";
194 clocks = <&rcc SAI2_K>;
195 clock-names = "sai_ck";
196 };
197 };
198
199...