xref: /linux/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml (revision cb4eb6771c0f8fd1c52a8f6fdec7762fb087380a)
1# SPDX-License-Identifier: GPL-2.0-only
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/mfd/qcom,spmi-pmic.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Qualcomm SPMI PMICs multi-function device
8
9description: |
10  Some Qualcomm PMICs used with the Snapdragon series SoCs are interfaced
11  to the chip via the SPMI (System Power Management Interface) bus.
12  Support for multiple independent functions are implemented by splitting the
13  16-bit SPMI peripheral address space into 256 smaller fixed-size regions, 256 bytes
14  each. A function can consume one or more of these fixed-size register regions.
15
16  The Qualcomm SPMI series includes the PM8941, PM8841, PMA8084, PM8998 and other
17  PMICs.  These PMICs use a "QPNP" scheme through SPMI interface.
18  QPNP is effectively a partitioning scheme for dividing the SPMI extended
19  register space up into logical pieces, and set of fixed register
20  locations/definitions within these regions, with some of these regions
21  specifically used for interrupt handling.
22
23maintainers:
24  - Stephen Boyd <sboyd@kernel.org>
25
26properties:
27  $nodename:
28    oneOf:
29      - pattern: '^pmic@.*$'
30      - pattern: '^pm(a|s)?[0-9]*@.*$'
31        deprecated: true
32
33  compatible:
34    items:
35      - enum:
36          - qcom,pm2250
37          - qcom,pm6125
38          - qcom,pm6150
39          - qcom,pm6150l
40          - qcom,pm6350
41          - qcom,pm660
42          - qcom,pm660l
43          - qcom,pm7250b
44          - qcom,pm7550ba
45          - qcom,pm7325
46          - qcom,pm7550
47          - qcom,pm8004
48          - qcom,pm8005
49          - qcom,pm8009
50          - qcom,pm8010
51          - qcom,pm8019
52          - qcom,pm8028
53          - qcom,pm8110
54          - qcom,pm8150
55          - qcom,pm8150b
56          - qcom,pm8150c
57          - qcom,pm8150l
58          - qcom,pm8226
59          - qcom,pm8350
60          - qcom,pm8350b
61          - qcom,pm8350c
62          - qcom,pm8450
63          - qcom,pm8550
64          - qcom,pm8550b
65          - qcom,pm8550ve
66          - qcom,pm8550vs
67          - qcom,pm8841
68          - qcom,pm8909
69          - qcom,pm8916
70          - qcom,pm8937
71          - qcom,pm8941
72          - qcom,pm8950
73          - qcom,pm8953
74          - qcom,pm8994
75          - qcom,pm8998
76          - qcom,pma8084
77          - qcom,pmc8180
78          - qcom,pmc8180c
79          - qcom,pmc8380
80          - qcom,pmcx0102
81          - qcom,pmd8028
82          - qcom,pmd9635
83          - qcom,pmh0101
84          - qcom,pmh0104
85          - qcom,pmh0110
86          - qcom,pmi632
87          - qcom,pmi8950
88          - qcom,pmi8962
89          - qcom,pmi8994
90          - qcom,pmi8998
91          - qcom,pmih0108
92          - qcom,pmiv0104
93          - qcom,pmk8002
94          - qcom,pmk8350
95          - qcom,pmk8550
96          - qcom,pmk8850
97          - qcom,pmm8155au
98          - qcom,pmm8654au
99          - qcom,pmp8074
100          - qcom,pmr735a
101          - qcom,pmr735b
102          - qcom,pmr735d
103          - qcom,pms405
104          - qcom,pmx55
105          - qcom,pmx65
106          - qcom,pmx75
107          - qcom,smb2351
108          - qcom,smb2360
109          - qcom,smb2370
110      - const: qcom,spmi-pmic
111
112  reg:
113    minItems: 1
114    maxItems: 2
115
116  '#address-cells':
117    const: 1
118
119  '#size-cells':
120    const: 0
121
122  labibb:
123    type: object
124    $ref: /schemas/regulator/qcom-labibb-regulator.yaml#
125
126  regulators:
127    type: object
128    $ref: /schemas/regulator/qcom,spmi-regulator.yaml#
129
130  pwm:
131    type: object
132    $ref: /schemas/leds/leds-qcom-lpg.yaml#
133
134patternProperties:
135  "^adc@[0-9a-f]+$":
136    type: object
137    oneOf:
138      - $ref: /schemas/iio/adc/qcom,spmi-adc5-gen3.yaml#
139      - $ref: /schemas/iio/adc/qcom,spmi-iadc.yaml#
140      - $ref: /schemas/iio/adc/qcom,spmi-rradc.yaml#
141      - $ref: /schemas/iio/adc/qcom,spmi-vadc.yaml#
142
143  "^adc-tm@[0-9a-f]+$":
144    type: object
145    # ref depends on compatible, see allOf below
146
147  "^audio-codec@[0-9a-f]+$":
148    type: object
149    $ref: /schemas/sound/qcom,pm8916-wcd-analog-codec.yaml#
150
151  "^battery@[0-9a-f]+$":
152    type: object
153    oneOf:
154      - $ref: /schemas/power/supply/qcom,pm8916-bms-vm.yaml#
155
156  "^charger@[0-9a-f]+$":
157    type: object
158    oneOf:
159      - $ref: /schemas/power/supply/qcom,pm8916-lbc.yaml#
160      - $ref: /schemas/power/supply/qcom,pm8941-charger.yaml#
161      - $ref: /schemas/power/supply/qcom,pm8941-coincell.yaml#
162      - $ref: /schemas/power/supply/qcom,pmi8998-charger.yaml#
163
164  "gpio@[0-9a-f]+$":
165    type: object
166    $ref: /schemas/pinctrl/qcom,pmic-gpio.yaml#
167
168  "^led-controller@[0-9a-f]+$":
169    type: object
170    $ref: /schemas/leds/qcom,spmi-flash-led.yaml#
171
172  "^nvram@[0-9a-f]+$":
173    type: object
174    $ref: /schemas/nvmem/qcom,spmi-sdam.yaml#
175
176  "^pbs@[0-9a-f]+$":
177    type: object
178    $ref: /schemas/soc/qcom/qcom,pbs.yaml#
179
180  "phy@[0-9a-f]+$":
181    type: object
182    $ref: /schemas/phy/qcom,snps-eusb2-repeater.yaml#
183
184  "pon@[0-9a-f]+$":
185    type: object
186    $ref: /schemas/power/reset/qcom,pon.yaml#
187
188  "^rtc@[0-9a-f]+$":
189    type: object
190    $ref: /schemas/rtc/qcom-pm8xxx-rtc.yaml#
191
192  "^temp-alarm@[0-9a-f]+$":
193    type: object
194    $ref: /schemas/thermal/qcom,spmi-temp-alarm.yaml#
195
196  "^typec@[0-9a-f]+$":
197    type: object
198    $ref: /schemas/usb/qcom,pmic-typec.yaml#
199
200  "^usb-detect@[0-9a-f]+$":
201    type: object
202    $ref: /schemas/extcon/qcom,pm8941-misc.yaml#
203
204  "^usb-vbus-regulator@[0-9a-f]+$":
205    type: object
206    $ref: /schemas/regulator/qcom,usb-vbus-regulator.yaml#
207
208  "^vibrator@[0-9a-f]+$":
209    type: object
210    $ref: /schemas/input/qcom,pm8xxx-vib.yaml#
211
212  "^mpps@[0-9a-f]+$":
213    type: object
214    $ref: /schemas/pinctrl/qcom,pmic-mpp.yaml#
215
216  "(.*)?(wled|leds)@[0-9a-f]+$":
217    type: object
218    $ref: /schemas/leds/backlight/qcom-wled.yaml#
219    unevaluatedProperties: false
220
221required:
222  - compatible
223  - reg
224
225allOf:
226  - if:
227      properties:
228        compatible:
229          contains:
230            enum:
231              - qcom,pm8998
232    then:
233      patternProperties:
234        "^adc-tm@[0-9a-f]+$":
235          $ref: /schemas/thermal/qcom-spmi-adc-tm-hc.yaml#
236    else:
237      patternProperties:
238        "^adc-tm@[0-9a-f]+$":
239          $ref: /schemas/thermal/qcom-spmi-adc-tm5.yaml#
240
241additionalProperties: false
242
243examples:
244  - |
245    #include <dt-bindings/spmi/spmi.h>
246    #include <dt-bindings/interrupt-controller/irq.h>
247    #include <dt-bindings/interrupt-controller/arm-gic.h>
248
249    spmi@c440000 {
250        compatible = "qcom,spmi-pmic-arb";
251        reg = <0x0c440000 0x1100>,
252              <0x0c600000 0x2000000>,
253              <0x0e600000 0x100000>,
254              <0x0e700000 0xa0000>,
255              <0x0c40a000 0x26000>;
256        reg-names = "core", "chnls", "obsrvr", "intr", "cnfg";
257        interrupt-names = "periph_irq";
258        interrupts = <GIC_SPI 481 IRQ_TYPE_LEVEL_HIGH>;
259        qcom,ee = <0>;
260        qcom,channel = <0>;
261        #address-cells = <2>;
262        #size-cells = <0>;
263        interrupt-controller;
264        #interrupt-cells = <4>;
265
266        pmic@2 {
267            compatible = "qcom,pmi8998", "qcom,spmi-pmic";
268            reg = <0x2 SPMI_USID>;
269            #address-cells = <1>;
270            #size-cells = <0>;
271
272            gpio@c000 {
273                compatible = "qcom,pmi8998-gpio", "qcom,spmi-gpio";
274                reg = <0xc000>;
275                gpio-controller;
276                gpio-ranges = <&pmi8998_gpio 0 0 14>;
277                #gpio-cells = <2>;
278                interrupt-controller;
279                #interrupt-cells = <2>;
280            };
281        };
282    };
283
284  - |
285    #include <dt-bindings/input/input.h>
286    #include <dt-bindings/interrupt-controller/irq.h>
287    #include <dt-bindings/interrupt-controller/arm-gic.h>
288    #include <dt-bindings/iio/qcom,spmi-vadc.h>
289    #include <dt-bindings/spmi/spmi.h>
290
291    pmic@0 {
292        compatible = "qcom,pm6150", "qcom,spmi-pmic";
293        reg = <0x0 SPMI_USID>;
294        #address-cells = <1>;
295        #size-cells = <0>;
296
297        pon@800 {
298            compatible = "qcom,pm8998-pon";
299            reg = <0x800>;
300            mode-bootloader = <0x2>;
301            mode-recovery = <0x1>;
302
303            pwrkey {
304                compatible = "qcom,pm8941-pwrkey";
305                interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
306                debounce = <15625>;
307                bias-pull-up;
308                linux,code = <KEY_POWER>;
309            };
310        };
311
312        temp-alarm@2400 {
313            compatible = "qcom,spmi-temp-alarm";
314            reg = <0x2400>;
315            interrupts = <0x0 0x24 0x0 IRQ_TYPE_EDGE_RISING>;
316            io-channels = <&pm6150_adc ADC5_DIE_TEMP>;
317            io-channel-names = "thermal";
318            #thermal-sensor-cells = <0>;
319        };
320
321        pm6150_adc: adc@3100 {
322            compatible = "qcom,spmi-adc5";
323            reg = <0x3100>;
324            interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
325            #address-cells = <1>;
326            #size-cells = <0>;
327            #io-channel-cells = <1>;
328
329            channel@6 {
330                reg = <ADC5_DIE_TEMP>;
331                label = "die_temp";
332            };
333
334            channel@4f {
335                reg = <ADC5_AMUX_THM3_100K_PU>;
336                qcom,ratiometric;
337                qcom,hw-settle-time = <200>;
338            };
339        };
340
341        adc-tm@3500 {
342            compatible = "qcom,spmi-adc-tm5";
343            reg = <0x3500>;
344            interrupts = <0x0 0x35 0x0 IRQ_TYPE_EDGE_RISING>;
345            #thermal-sensor-cells = <1>;
346            #address-cells = <1>;
347            #size-cells = <0>;
348
349            charger-thermistor@0 {
350                reg = <0>;
351                io-channels = <&pm6150_adc ADC5_AMUX_THM3_100K_PU>;
352                qcom,ratiometric;
353                qcom,hw-settle-time-us = <200>;
354            };
355        };
356
357        gpio@c000 {
358            compatible = "qcom,pm6150-gpio", "qcom,spmi-gpio";
359            reg = <0xc000>;
360            gpio-controller;
361            gpio-ranges = <&pm6150_gpio 0 0 10>;
362            #gpio-cells = <2>;
363            interrupt-controller;
364            #interrupt-cells = <2>;
365        };
366    };
367