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