1# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/mfd/wlf,arizona.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Cirrus Logic/Wolfson Microelectronics Arizona class audio SoCs
8
9maintainers:
10  - patches@opensource.cirrus.com
11
12description: |
13  These devices are audio SoCs with extensive digital capabilities and a
14  range of analogue I/O.
15
16allOf:
17  - $ref: /schemas/spi/spi-peripheral-props.yaml
18  - $ref: /schemas/sound/wlf,arizona.yaml#
19  - $ref: /schemas/regulator/wlf,arizona.yaml#
20  - $ref: /schemas/extcon/wlf,arizona.yaml#
21  - if:
22      properties:
23        compatible:
24          contains:
25            enum:
26              - cirrus,cs47l24
27              - wlf,wm1831
28    then:
29      required:
30        - DCVDD-supply
31        - MICVDD-supply
32    else:
33      properties:
34        LDOVDD-supply:
35          description:
36            Digital power supply, used internally to generate DCVDD when
37            internally supplied.
38
39  - if:
40      properties:
41        compatible:
42          contains:
43            enum:
44              - wlf,wm1814
45              - wlf,wm5102
46              - wlf,wm5110
47              - wlf,wm8280
48              - wlf,wm8997
49              - wlf,wm8998
50    then:
51      properties:
52        DBVDD2-supply:
53          description:
54            Databus power supply.
55
56      required:
57        - DBVDD2-supply
58  - if:
59      properties:
60        compatible:
61          contains:
62            enum:
63              - wlf,wm1814
64              - wlf,wm5102
65              - wlf,wm5110
66              - wlf,wm8280
67              - wlf,wm8998
68    then:
69      properties:
70        DBVDD3-supply:
71          description:
72            Databus power supply.
73
74      required:
75        - DBVDD3-supply
76  - if:
77      properties:
78        compatible:
79          contains:
80            enum:
81              - cirrus,cs47l24
82              - wlf,wm1831
83              - wlf,wm8997
84    then:
85      properties:
86        SPKVDD-supply:
87          description:
88            Mono speaker driver power supply.
89
90      required:
91        - SPKVDD-supply
92    else:
93      properties:
94        SPKVDDL-supply:
95          description:
96            Left speaker driver power supply.
97
98        SPKVDDR-supply:
99          description:
100            Right speaker driver power supply.
101
102      required:
103        - SPKVDDL-supply
104        - SPKVDDR-supply
105
106properties:
107  compatible:
108    enum:
109      - cirrus,cs47l24
110      - wlf,wm1814
111      - wlf,wm1831
112      - wlf,wm5102
113      - wlf,wm5110
114      - wlf,wm8280
115      - wlf,wm8997
116      - wlf,wm8998
117
118  reg:
119    maxItems: 1
120
121  AVDD-supply:
122    description:
123      Analogue power supply.
124
125  CPVDD-supply:
126    description:
127      Charge pump power supply.
128
129  DBVDD1-supply:
130    description:
131      Databus power supply.
132
133  DCVDD-supply:
134    description:
135      Digital power supply, normally supplied internally except on cs47l24,
136      wm1831 where it is mandatory.
137
138  MICVDD-supply:
139    description:
140      Microphone power supply, normally supplied internally except on
141      cs47l24, wm1831 where it is mandatory.
142
143  gpio-controller: true
144
145  '#gpio-cells':
146    description:
147      The first cell is the pin number and the second cell is used to
148      specify optional parameters.
149    const: 2
150
151  wlf,gpio-defaults:
152    description:
153      A list of GPIO configuration register values. Defines for the
154      appropriate values can found in dt-bindings/mfd/arizona.h. If
155      absent, no configuration of these registers is performed. If any
156      entry has a value that is out of range for a 16 bit register then the
157      chip default will be used. If present exactly five values must be
158      specified.
159    $ref: /schemas/types.yaml#/definitions/uint32-array
160    minItems: 1
161    maxItems: 5
162
163  interrupt-controller: true
164
165  '#interrupt-cells':
166    description:
167      The first cell is the IRQ number.  The second cell is the flags,
168      encoded as trigger masks.
169    const: 2
170
171  interrupts:
172    maxItems: 1
173
174  clocks:
175    description:
176      Should reference the clocks supplied on MCLK1 and MCLK2.
177    minItems: 1
178    maxItems: 2
179
180  clock-names:
181    description:
182      Should contains two strings mclk1 for the clock supplied on MCLK1,
183      recommended to be a high quality audio reference clock mclk2 for the
184      clock supplied on MCLK2, recommended to be an always on 32k clock.
185    oneOf:
186      - items:
187          - const: mclk1
188      - items:
189          - const: mclk2
190      - items:
191          - const: mclk1
192          - const: mclk2
193
194  reset-gpios:
195    maxItems: 1
196
197  wlf,reset:
198    description:
199      GPIO specifier for the GPIO controlling RESET
200    deprecated: true
201    $ref: /schemas/types.yaml#/definitions/phandle-array
202    maxItems: 1
203
204required:
205  - compatible
206  - AVDD-supply
207  - CPVDD-supply
208  - DBVDD1-supply
209  - gpio-controller
210  - '#gpio-cells'
211  - interrupt-controller
212  - '#interrupt-cells'
213  - interrupts
214
215unevaluatedProperties: false
216
217examples:
218  - |
219    #include <dt-bindings/mfd/arizona.h>
220    i2c@e0004000 {
221        #address-cells = <1>;
222        #size-cells = <0>;
223        reg = <0xe0004000 0x1000>;
224
225        wm5102: codec@1a {
226            compatible = "wlf,wm5102";
227            reg = <0x1a>;
228
229            reset-gpios = <&gpio 0>;
230            wlf,ldoena = <&gpio 1>;
231
232            AVDD-supply = <&vdd1v8>;
233            DBVDD1-supply = <&vdd1v8>;
234            DBVDD2-supply = <&vdd1v8>;
235            DBVDD3-supply = <&vdd1v8>;
236            CPVDD-supply = <&vdd1v8>;
237            LDOVDD-supply = <&vdd1v8>;
238            SPKVDDL-supply = <&vdd5v>;
239            SPKVDDR-supply = <&vdd5v>;
240
241            interrupts = <347>;
242            interrupt-controller;
243            #interrupt-cells = <2>;
244            interrupt-parent = <&gic>;
245
246            gpio-controller;
247            #gpio-cells = <2>;
248
249            #sound-dai-cells = <1>;
250
251            wlf,gpio-defaults = <
252                ARIZONA_GP_FN_TXLRCLK
253                ARIZONA_GP_DEFAULT
254                ARIZONA_GP_DEFAULT
255                ARIZONA_GP_DEFAULT
256                ARIZONA_GP_DEFAULT
257            >;
258
259            clocks = <&clks 0>, <&clks 1>;
260            clock-names = "mclk1", "mclk2";
261
262            wlf,inmode = <ARIZONA_INMODE_DIFF ARIZONA_INMODE_DMIC>;
263            wlf,dmic-ref = <ARIZONA_DMIC_MICBIAS1 ARIZONA_DMIC_MICBIAS3>;
264
265            wlf,use-jd2;
266            wlf,use-jd2-nopull;
267            wlf,jd-invert;
268
269            wlf,micd-software-compare;
270            wlf,micd-detect-debounce = <0>;
271            wlf,micd-pol-gpio = <&codec 2 0>;
272            wlf,micd-rate = <ARIZONA_MICD_TIME_8MS>;
273            wlf,micd-dbtime = <4>;
274            wlf,micd-timeout-ms = <100>;
275            wlf,micd-force-micbias;
276            wlf,micd-configs = <0 ARIZONA_DMIC_MICBIAS1 0>,
277                               <0x2000 ARIZONA_DMIC_MICBIAS2 1>;
278
279            wlf,gpsw = <ARIZONA_GPSW_OPEN>;
280        };
281    };
282