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