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