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,pm8004
47          - qcom,pm8005
48          - qcom,pm8009
49          - qcom,pm8010
50          - qcom,pm8019
51          - qcom,pm8028
52          - qcom,pm8110
53          - qcom,pm8150
54          - qcom,pm8150b
55          - qcom,pm8150c
56          - qcom,pm8150l
57          - qcom,pm8226
58          - qcom,pm8350
59          - qcom,pm8350b
60          - qcom,pm8350c
61          - qcom,pm8550
62          - qcom,pm8550b
63          - qcom,pm8550ve
64          - qcom,pm8550vs
65          - qcom,pm8841
66          - qcom,pm8909
67          - qcom,pm8916
68          - qcom,pm8941
69          - qcom,pm8950
70          - qcom,pm8953
71          - qcom,pm8994
72          - qcom,pm8998
73          - qcom,pma8084
74          - qcom,pmc8180
75          - qcom,pmc8180c
76          - qcom,pmd9635
77          - qcom,pmi632
78          - qcom,pmi8950
79          - qcom,pmi8962
80          - qcom,pmi8994
81          - qcom,pmi8998
82          - qcom,pmk8002
83          - qcom,pmk8350
84          - qcom,pmk8550
85          - qcom,pmm8155au
86          - qcom,pmm8654au
87          - qcom,pmp8074
88          - qcom,pmr735a
89          - qcom,pmr735b
90          - qcom,pmr735d
91          - qcom,pms405
92          - qcom,pmx55
93          - qcom,pmx65
94          - qcom,pmx75
95          - qcom,smb2351
96      - const: qcom,spmi-pmic
97
98  reg:
99    minItems: 1
100    maxItems: 2
101
102  '#address-cells':
103    const: 1
104
105  '#size-cells':
106    const: 0
107
108  labibb:
109    type: object
110    $ref: /schemas/regulator/qcom-labibb-regulator.yaml#
111
112  regulators:
113    type: object
114    $ref: /schemas/regulator/qcom,spmi-regulator.yaml#
115
116  pwm:
117    type: object
118    $ref: /schemas/leds/leds-qcom-lpg.yaml#
119
120patternProperties:
121  "^adc@[0-9a-f]+$":
122    type: object
123    oneOf:
124      - $ref: /schemas/iio/adc/qcom,spmi-iadc.yaml#
125      - $ref: /schemas/iio/adc/qcom,spmi-rradc.yaml#
126      - $ref: /schemas/iio/adc/qcom,spmi-vadc.yaml#
127
128  "^adc-tm@[0-9a-f]+$":
129    type: object
130    # ref depends on compatible, see allOf below
131
132  "^audio-codec@[0-9a-f]+$":
133    type: object
134    $ref: /schemas/sound/qcom,pm8916-wcd-analog-codec.yaml#
135
136  "^charger@[0-9a-f]+$":
137    type: object
138    oneOf:
139      - $ref: /schemas/power/supply/qcom,pm8941-charger.yaml#
140      - $ref: /schemas/power/supply/qcom,pm8941-coincell.yaml#
141      - $ref: /schemas/power/supply/qcom,pmi8998-charger.yaml#
142
143  "gpio@[0-9a-f]+$":
144    type: object
145    $ref: /schemas/pinctrl/qcom,pmic-gpio.yaml#
146
147  "^led-controller@[0-9a-f]+$":
148    type: object
149    $ref: /schemas/leds/qcom,spmi-flash-led.yaml#
150
151  "^nvram@[0-9a-f]+$":
152    type: object
153    $ref: /schemas/nvmem/qcom,spmi-sdam.yaml#
154
155  "phy@[0-9a-f]+$":
156    type: object
157    $ref: /schemas/phy/qcom,snps-eusb2-repeater.yaml#
158
159  "pon@[0-9a-f]+$":
160    type: object
161    $ref: /schemas/power/reset/qcom,pon.yaml#
162
163  "^rtc@[0-9a-f]+$":
164    type: object
165    $ref: /schemas/rtc/qcom-pm8xxx-rtc.yaml#
166
167  "^temp-alarm@[0-9a-f]+$":
168    type: object
169    $ref: /schemas/thermal/qcom,spmi-temp-alarm.yaml#
170
171  "^usb-detect@[0-9a-f]+$":
172    type: object
173    $ref: /schemas/extcon/qcom,pm8941-misc.yaml#
174
175  "^usb-vbus-regulator@[0-9a-f]+$":
176    type: object
177    $ref: /schemas/regulator/qcom,usb-vbus-regulator.yaml#
178
179  "^vibrator@[0-9a-f]+$":
180    type: object
181    $ref: /schemas/input/qcom,pm8xxx-vib.yaml#
182
183  "^mpps@[0-9a-f]+$":
184    type: object
185    $ref: /schemas/pinctrl/qcom,pmic-mpp.yaml#
186
187  "(.*)?(wled|leds)@[0-9a-f]+$":
188    type: object
189    $ref: /schemas/leds/backlight/qcom-wled.yaml#
190    unevaluatedProperties: false
191
192required:
193  - compatible
194  - reg
195
196allOf:
197  - if:
198      properties:
199        compatible:
200          contains:
201            enum:
202              - qcom,pm8998
203    then:
204      patternProperties:
205        "^adc-tm@[0-9a-f]+$":
206          $ref: /schemas/thermal/qcom-spmi-adc-tm-hc.yaml#
207    else:
208      patternProperties:
209        "^adc-tm@[0-9a-f]+$":
210          $ref: /schemas/thermal/qcom-spmi-adc-tm5.yaml#
211
212additionalProperties: false
213
214examples:
215  - |
216    #include <dt-bindings/spmi/spmi.h>
217    #include <dt-bindings/interrupt-controller/irq.h>
218    #include <dt-bindings/interrupt-controller/arm-gic.h>
219
220    spmi@c440000 {
221        compatible = "qcom,spmi-pmic-arb";
222        reg = <0x0c440000 0x1100>,
223              <0x0c600000 0x2000000>,
224              <0x0e600000 0x100000>,
225              <0x0e700000 0xa0000>,
226              <0x0c40a000 0x26000>;
227        reg-names = "core", "chnls", "obsrvr", "intr", "cnfg";
228        interrupt-names = "periph_irq";
229        interrupts = <GIC_SPI 481 IRQ_TYPE_LEVEL_HIGH>;
230        qcom,ee = <0>;
231        qcom,channel = <0>;
232        #address-cells = <2>;
233        #size-cells = <0>;
234        interrupt-controller;
235        #interrupt-cells = <4>;
236
237        pmi8998_lsid0: pmic@2 {
238            compatible = "qcom,pmi8998", "qcom,spmi-pmic";
239            reg = <0x2 SPMI_USID>;
240            #address-cells = <1>;
241            #size-cells = <0>;
242
243            pmi8998_gpio: gpio@c000 {
244                compatible = "qcom,pmi8998-gpio", "qcom,spmi-gpio";
245                reg = <0xc000>;
246                gpio-controller;
247                gpio-ranges = <&pmi8998_gpio 0 0 14>;
248                #gpio-cells = <2>;
249                interrupt-controller;
250                #interrupt-cells = <2>;
251            };
252        };
253    };
254
255  - |
256    #include <dt-bindings/input/input.h>
257    #include <dt-bindings/interrupt-controller/irq.h>
258    #include <dt-bindings/interrupt-controller/arm-gic.h>
259    #include <dt-bindings/iio/qcom,spmi-vadc.h>
260    #include <dt-bindings/spmi/spmi.h>
261
262    pmic@0 {
263        compatible = "qcom,pm6150", "qcom,spmi-pmic";
264        reg = <0x0 SPMI_USID>;
265        #address-cells = <1>;
266        #size-cells = <0>;
267
268        pon@800 {
269            compatible = "qcom,pm8998-pon";
270            reg = <0x800>;
271            mode-bootloader = <0x2>;
272            mode-recovery = <0x1>;
273
274            pwrkey {
275                compatible = "qcom,pm8941-pwrkey";
276                interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
277                debounce = <15625>;
278                bias-pull-up;
279                linux,code = <KEY_POWER>;
280            };
281        };
282
283        temp-alarm@2400 {
284            compatible = "qcom,spmi-temp-alarm";
285            reg = <0x2400>;
286            interrupts = <0x0 0x24 0x0 IRQ_TYPE_EDGE_RISING>;
287            io-channels = <&pm6150_adc ADC5_DIE_TEMP>;
288            io-channel-names = "thermal";
289            #thermal-sensor-cells = <0>;
290        };
291
292        pm6150_adc: adc@3100 {
293            compatible = "qcom,spmi-adc5";
294            reg = <0x3100>;
295            interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
296            #address-cells = <1>;
297            #size-cells = <0>;
298            #io-channel-cells = <1>;
299
300            channel@6 {
301                reg = <ADC5_DIE_TEMP>;
302                label = "die_temp";
303            };
304
305            channel@4f {
306                reg = <ADC5_AMUX_THM3_100K_PU>;
307                qcom,ratiometric;
308                qcom,hw-settle-time = <200>;
309            };
310        };
311
312        adc-tm@3500 {
313            compatible = "qcom,spmi-adc-tm5";
314            reg = <0x3500>;
315            interrupts = <0x0 0x35 0x0 IRQ_TYPE_EDGE_RISING>;
316            #thermal-sensor-cells = <1>;
317            #address-cells = <1>;
318            #size-cells = <0>;
319
320            charger-thermistor@0 {
321                reg = <0>;
322                io-channels = <&pm6150_adc ADC5_AMUX_THM3_100K_PU>;
323                qcom,ratiometric;
324                qcom,hw-settle-time-us = <200>;
325            };
326        };
327
328        pm6150_gpio: gpio@c000 {
329            compatible = "qcom,pm6150-gpio", "qcom,spmi-gpio";
330            reg = <0xc000>;
331            gpio-controller;
332            gpio-ranges = <&pm6150_gpio 0 0 10>;
333            #gpio-cells = <2>;
334            interrupt-controller;
335            #interrupt-cells = <2>;
336        };
337    };
338