xref: /freebsd/sys/contrib/device-tree/Bindings/mfd/maxim,max8998.yaml (revision 95eb4b873b6a8b527c5bd78d7191975dfca38998)
1# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/mfd/maxim,max8998.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Maxim MAX8998, National/TI LP3974 Power Management IC
8
9maintainers:
10  - Krzysztof Kozlowski <krzk@kernel.org>
11
12description:
13  The Maxim MAX8998 is a Power Management IC which includes voltage/current
14  regulators, real time clock, battery charging controller and several other
15  sub-blocks. It is interfaced using an I2C interface. Each sub-block is
16  addressed by the host system using different i2c slave address.
17
18properties:
19  compatible:
20    enum:
21      - maxim,max8998
22      - national,lp3974
23      - ti,lp3974
24
25  reg:
26    maxItems: 1
27
28  interrupts:
29    minItems: 1
30    items:
31      - description: Main interrupt
32      - description: Power-on/-off interrupt
33
34  max8998,pmic-buck1-dvs-gpios:
35    maxItems: 2
36    description:
37      Two host gpios used for buck1 DVS.
38
39  max8998,pmic-buck2-dvs-gpio:
40    maxItems: 1
41    description:
42      Host gpio used for buck2 DVS.
43
44  max8998,pmic-buck1-default-dvs-idx:
45    $ref: /schemas/types.yaml#/definitions/uint32
46    enum: [0, 1, 2, 3]
47    default: 0
48    description:
49      Default voltage setting selected from the possible 4 options selectable
50      by the DVS gpios.
51
52  max8998,pmic-buck2-default-dvs-idx:
53    $ref: /schemas/types.yaml#/definitions/uint32
54    enum: [0, 1]
55    default: 0
56    description:
57      Default voltage setting selected from the possible 2 options selectable
58      by the DVS GPIOs.
59
60  max8998,pmic-buck-voltage-lock:
61    type: boolean
62    description:
63      If present, disallows changing of preprogrammed buck DVS voltages.
64
65  max8998,pmic-buck1-dvs-voltage:
66    $ref: /schemas/types.yaml#/definitions/uint32-array
67    maxItems: 4
68    description:
69      Four voltage values in microvolts for buck1 regulator that can be
70      selected using DVS GPIO.
71
72  max8998,pmic-buck2-dvs-voltage:
73    $ref: /schemas/types.yaml#/definitions/uint32-array
74    maxItems: 2
75    description:
76      Two voltage values in microvolts for buck2 regulator that can be
77      selected using DVS GPIO.
78
79  regulators:
80    type: object
81    additionalProperties: false
82
83    properties:
84      CHARGER:
85        type: object
86        $ref: /schemas/regulator/regulator.yaml#
87        unevaluatedProperties: false
88        description:
89          CHARGER is main battery charger current control, wrongly represented
90          as regulator.
91
92        properties:
93          regulator-min-microamp:
94            minimum: 90000
95            maximum: 800000
96
97          regulator-max-microamp:
98            minimum: 90000
99            maximum: 800000
100
101          regulator-min-microvolt: false
102          regulator-max-microvolt: false
103
104        required:
105          - regulator-name
106
107    patternProperties:
108      "^(LDO([2-9]|1[0-7])|BUCK[1-4])$":
109        type: object
110        $ref: /schemas/regulator/regulator.yaml#
111        unevaluatedProperties: false
112
113        required:
114          - regulator-name
115
116      "^(EN32KHz-AP|EN32KHz-CP|ENVICHG|ESAFEOUT[12])$":
117        type: object
118        $ref: /schemas/regulator/regulator.yaml#
119        unevaluatedProperties: false
120        description: |
121          EN32KHz-AP and EN32KHz-CP are 32768 Hz clocks, wrongly represented as
122          regulators.
123          ENVICHG is a Battery Charging Current Monitor Output.
124
125        properties:
126          regulator-min-microvolt: false
127          regulator-max-microvolt: false
128
129        required:
130          - regulator-name
131
132dependencies:
133  max8998,pmic-buck1-dvs-gpios: [ "max8998,pmic-buck1-dvs-voltage" ]
134  max8998,pmic-buck2-dvs-gpio: [ "max8998,pmic-buck2-dvs-voltage" ]
135
136required:
137  - compatible
138  - reg
139  - regulators
140
141additionalProperties: false
142
143examples:
144  - |
145    #include <dt-bindings/gpio/gpio.h>
146    #include <dt-bindings/interrupt-controller/irq.h>
147
148    i2c {
149        #address-cells = <1>;
150        #size-cells = <0>;
151
152        pmic@66 {
153            compatible = "national,lp3974";
154            reg = <0x66>;
155            interrupts-extended = <&gpx0 7 IRQ_TYPE_LEVEL_LOW>,
156                                  <&gpx2 7 IRQ_TYPE_LEVEL_LOW>;
157            pinctrl-names = "default";
158            pinctrl-0 = <&lp3974_irq>;
159
160            max8998,pmic-buck1-default-dvs-idx = <0>;
161            max8998,pmic-buck1-dvs-gpios = <&gpx0 5 GPIO_ACTIVE_HIGH>,
162                                           <&gpx0 6 GPIO_ACTIVE_HIGH>;
163            max8998,pmic-buck1-dvs-voltage = <1100000>, <1000000>,
164                                             <1100000>, <1000000>;
165            max8998,pmic-buck2-default-dvs-idx = <0>;
166            max8998,pmic-buck2-dvs-gpio = <&gpe2 0 GPIO_ACTIVE_HIGH>;
167            max8998,pmic-buck2-dvs-voltage = <1200000>, <1100000>;
168
169            regulators {
170                LDO2 {
171                    regulator-name = "VALIVE_1.2V";
172                    regulator-min-microvolt = <1200000>;
173                    regulator-max-microvolt = <1200000>;
174                    regulator-always-on;
175                };
176
177                LDO3 {
178                    regulator-name = "VUSB+MIPI_1.1V";
179                    regulator-min-microvolt = <1100000>;
180                    regulator-max-microvolt = <1100000>;
181                    regulator-always-on;
182                };
183
184                LDO4 {
185                    regulator-name = "VADC_3.3V";
186                    regulator-min-microvolt = <3300000>;
187                    regulator-max-microvolt = <3300000>;
188                };
189
190                LDO5 {
191                    regulator-name = "VTF_2.8V";
192                    regulator-min-microvolt = <2800000>;
193                    regulator-max-microvolt = <2800000>;
194                };
195
196                LDO6 {
197                    regulator-name = "LDO6";
198                    regulator-min-microvolt = <2000000>;
199                    regulator-max-microvolt = <2000000>;
200                };
201
202                LDO7 {
203                    regulator-name = "VLCD+VMIPI_1.8V";
204                    regulator-min-microvolt = <1800000>;
205                    regulator-max-microvolt = <1800000>;
206                };
207
208                LDO8 {
209                    regulator-name = "VUSB+VDAC_3.3V";
210                    regulator-min-microvolt = <3300000>;
211                    regulator-max-microvolt = <3300000>;
212                    regulator-always-on;
213                };
214
215                LDO9 {
216                    regulator-name = "VCC_2.8V";
217                    regulator-min-microvolt = <2800000>;
218                    regulator-max-microvolt = <2800000>;
219                    regulator-always-on;
220                };
221
222                LDO10 {
223                    regulator-name = "VPLL_1.1V";
224                    regulator-min-microvolt = <1100000>;
225                    regulator-max-microvolt = <1100000>;
226                    regulator-boot-on;
227                    regulator-always-on;
228                };
229
230                LDO11 {
231                    regulator-name = "CAM_AF_3.3V";
232                    regulator-min-microvolt = <3300000>;
233                    regulator-max-microvolt = <3300000>;
234                };
235
236                LDO12 {
237                    regulator-name = "PS_2.8V";
238                    regulator-min-microvolt = <2800000>;
239                    regulator-max-microvolt = <2800000>;
240                };
241
242                LDO13 {
243                    regulator-name = "VHIC_1.2V";
244                    regulator-min-microvolt = <1200000>;
245                    regulator-max-microvolt = <1200000>;
246                };
247
248                LDO14 {
249                    regulator-name = "CAM_I_HOST_1.8V";
250                    regulator-min-microvolt = <1800000>;
251                    regulator-max-microvolt = <1800000>;
252                };
253
254                LDO15 {
255                    regulator-name = "CAM_S_DIG+FM33_CORE_1.2V";
256                    regulator-min-microvolt = <1200000>;
257                    regulator-max-microvolt = <1200000>;
258                };
259
260                LDO16 {
261                    regulator-name = "CAM_S_ANA_2.8V";
262                    regulator-min-microvolt = <2800000>;
263                    regulator-max-microvolt = <2800000>;
264                };
265
266                LDO17 {
267                    regulator-name = "VCC_3.0V_LCD";
268                    regulator-min-microvolt = <3000000>;
269                    regulator-max-microvolt = <3000000>;
270                };
271
272                BUCK1 {
273                    regulator-name = "VINT_1.1V";
274                    regulator-min-microvolt = <750000>;
275                    regulator-max-microvolt = <1500000>;
276                    regulator-boot-on;
277                    regulator-always-on;
278                };
279
280                BUCK2 {
281                    regulator-name = "VG3D_1.1V";
282                    regulator-min-microvolt = <750000>;
283                    regulator-max-microvolt = <1500000>;
284                    regulator-boot-on;
285                };
286
287                BUCK3 {
288                    regulator-name = "VCC_1.8V";
289                    regulator-min-microvolt = <1800000>;
290                    regulator-max-microvolt = <1800000>;
291                    regulator-always-on;
292                };
293
294                BUCK4 {
295                    regulator-name = "VMEM_1.2V";
296                    regulator-min-microvolt = <1200000>;
297                    regulator-max-microvolt = <1200000>;
298                    regulator-always-on;
299                };
300
301                EN32KHz-AP {
302                    regulator-name = "32KHz AP";
303                    regulator-always-on;
304                };
305
306                EN32KHz-CP {
307                    regulator-name = "32KHz CP";
308                };
309
310                ENVICHG {
311                    regulator-name = "VICHG";
312                };
313
314                ESAFEOUT1 {
315                    regulator-name = "SAFEOUT1";
316                };
317
318                ESAFEOUT2 {
319                    regulator-name = "SAFEOUT2";
320                    regulator-boot-on;
321                };
322            };
323        };
324    };
325