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