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