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