Merge tag 'regulator-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
[platform/kernel/linux-starfive.git] / Documentation / devicetree / bindings / regulator / qcom,spmi-regulator.yaml
1 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/regulator/qcom,spmi-regulator.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: Qualcomm SPMI Regulators
8
9 maintainers:
10   - Robert Marko <robimarko@gmail.com>
11
12 properties:
13   compatible:
14     enum:
15       - qcom,pm6125-regulators
16       - qcom,pm660-regulators
17       - qcom,pm660l-regulators
18       - qcom,pm8004-regulators
19       - qcom,pm8005-regulators
20       - qcom,pm8226-regulators
21       - qcom,pm8841-regulators
22       - qcom,pm8916-regulators
23       - qcom,pm8941-regulators
24       - qcom,pm8950-regulators
25       - qcom,pm8994-regulators
26       - qcom,pmi8994-regulators
27       - qcom,pmp8074-regulators
28       - qcom,pms405-regulators
29
30   qcom,saw-reg:
31     description: Reference to syscon node defining the SAW registers
32     $ref: /schemas/types.yaml#/definitions/phandle
33
34 patternProperties:
35   "^(5vs[1-2]|(l|s)[1-9][0-9]?|lvs[1-3])$":
36     description: List of regulators and its properties
37     type: object
38     $ref: regulator.yaml#
39     unevaluatedProperties: false
40
41     properties:
42       qcom,ocp-max-retries:
43         description:
44           Maximum number of times to try toggling a voltage switch off and
45           back on as a result of consecutive over current events
46         $ref: /schemas/types.yaml#/definitions/uint32
47
48       qcom,ocp-retry-delay:
49         description:
50           Time to delay in milliseconds between each voltage switch toggle
51           after an over current event takes place
52         $ref: /schemas/types.yaml#/definitions/uint32
53
54       qcom,pin-ctrl-enable:
55         description:
56           Bit mask specifying which hardware pins should be used to enable the
57           regulator, if any.
58           Supported bits are
59           0 = ignore all hardware enable signals
60           BIT(0) = follow HW0_EN signal
61           BIT(1) = follow HW1_EN signal
62           BIT(2) = follow HW2_EN signal
63           BIT(3) = follow HW3_EN signal
64         $ref: /schemas/types.yaml#/definitions/uint32
65         minimum: 0
66         maximum: 15
67
68       qcom,pin-ctrl-hpm:
69         description:
70           Bit mask specifying which hardware pins should be used to force the
71           regulator into high power mode, if any.
72           Supported bits are
73           0 = ignore all hardware enable signals
74           BIT(0) = follow HW0_EN signal
75           BIT(1) = follow HW1_EN signal
76           BIT(2) = follow HW2_EN signal
77           BIT(3) = follow HW3_EN signal
78           BIT(4) = follow PMIC awake state
79         $ref: /schemas/types.yaml#/definitions/uint32
80         minimum: 0
81         maximum: 31
82
83       qcom,vs-soft-start-strength:
84         description:
85           This property sets the soft start strength for voltage switch type
86           regulators.
87           Supported values are
88           0 = 0.05 uA
89           1 = 0.25 uA
90           2 = 0.55 uA
91           3 = 0.75 uA
92         $ref: /schemas/types.yaml#/definitions/uint32
93         minimum: 0
94         maximum: 3
95
96       qcom,saw-slave:
97         description: SAW controlled gang slave. Will not be configured.
98         type: boolean
99
100       qcom,saw-leader:
101         description:
102           SAW controlled gang leader. Will be configured as SAW regulator.
103         type: boolean
104
105 required:
106   - compatible
107
108 allOf:
109   - if:
110       properties:
111         compatible:
112           contains:
113             enum:
114               - qcom,pm6125-regulators
115     then:
116       properties:
117         vdd_l1_l7_l17_l18-supply: true
118         vdd_l2_l3_l4-supply: true
119         vdd_l5_l15_l19_l20_l21_l22-supply: true
120         vdd_l6_l8-supply: true
121         vdd_l9_l11-supply: true
122         vdd_l10_l13_l14-supply: true
123         vdd_l12_l16-supply: true
124         vdd_l23_l24-supply: true
125       patternProperties:
126         "^vdd_s[1-8]-supply$": true
127
128   - if:
129       properties:
130         compatible:
131           contains:
132             enum:
133               - qcom,pm660-regulators
134     then:
135       properties:
136         vdd_l15_l16_l17_l18_l19-supply: true
137         vdd_l1_l6_l7-supply: true
138         vdd_l2_l3-supply: true
139         vdd_l5-supply: true
140         vdd_l8_l9_l10_l11_l12_l13_l14-supply: true
141       patternProperties:
142         "^vdd_s[1-6]-supply$": true
143
144   - if:
145       properties:
146         compatible:
147           contains:
148             enum:
149               - qcom,pm660l-regulators
150     then:
151       properties:
152         vdd_l1_l9_l10-supply: true
153         vdd_l2-supply: true
154         vdd_l3_l5_l7_l8-supply: true
155         vdd_l4_l6-supply: true
156       patternProperties:
157         "^vdd_s[1-5]-supply$": true
158
159   - if:
160       properties:
161         compatible:
162           contains:
163             enum:
164               - qcom,pm8004-regulators
165     then:
166       patternProperties:
167         "^vdd_s[25]-supply$": true
168
169   - if:
170       properties:
171         compatible:
172           contains:
173             enum:
174               - qcom,pm8005-regulators
175     then:
176       patternProperties:
177         "^vdd_s[1-4]-supply$": true
178
179   - if:
180       properties:
181         compatible:
182           contains:
183             enum:
184               - qcom,pm8226-regulators
185     then:
186       properties:
187         vdd_l10_l11_l13-supply: true
188         vdd_l12_l14-supply: true
189         vdd_l15_l16_l17_l18-supply: true
190         vdd_l19_l20_l21_l22_l23_l28-supply: true
191         vdd_l1_l2_l4_l5-supply: true
192         vdd_l25-supply: true
193         vdd_l3_l24_l26-supply: true
194         vdd_l6_l7_l8_l9_l27-supply: true
195         vdd_lvs1-supply: true
196       patternProperties:
197         "^vdd_s[1-5]-supply$": true
198
199   - if:
200       properties:
201         compatible:
202           contains:
203             enum:
204               - qcom,pm8841-regulators
205     then:
206       patternProperties:
207         "^vdd_s[1-8]-supply$": true
208
209   - if:
210       properties:
211         compatible:
212           contains:
213             enum:
214               - qcom,pm8916-regulators
215     then:
216       properties:
217         vdd_l1_l3-supply: true
218         vdd_l4_l5_l6-supply: true
219         vdd_l8_l11_l14_l15_l16-supply: true
220         vdd_l9_l10_l12_l13_l17_l18-supply: true
221       patternProperties:
222         "^vdd_l[27]-supply$": true
223         "^vdd_s[1-4]-supply$": true
224
225   - if:
226       properties:
227         compatible:
228           contains:
229             enum:
230               - qcom,pm8941-regulators
231     then:
232       properties:
233         interrupts:
234           items:
235             - description: Over-current protection interrupt for 5V S1
236             - description: Over-current protection interrupt for 5V S2
237         interrupt-names:
238           items:
239             - const: ocp-5vs1
240             - const: ocp-5vs2
241         vdd_l13_l20_l23_l24-supply: true
242         vdd_l1_l3-supply: true
243         vdd_l21-supply: true
244         vdd_l2_lvs_1_2_3-supply: true
245         vdd_l4_l11-supply: true
246         vdd_l5_l7-supply: true
247         vdd_l6_l12_l14_l15-supply: true
248         vdd_l8_l16_l18_19-supply: true
249         vdd_l9_l10_l17_l22-supply: true
250         vin_5vs-supply: true
251       patternProperties:
252         "^vdd_s[1-3]-supply$": true
253
254   - if:
255       properties:
256         compatible:
257           contains:
258             enum:
259               - qcom,pm8950-regulators
260     then:
261       properties:
262         vdd_l1_l19-supply: true
263         vdd_l20-supply: true
264         vdd_l21-supply: true
265         vdd_l2_l23-supply: true
266         vdd_l3-supply: true
267         vdd_l4_l5_l6_l7_l16-supply: true
268         vdd_l8_l11_l12_l17_l22-supply: true
269         vdd_l9_l10_l13_l14_l15_l18-supply: true
270       patternProperties:
271         "^vdd_s[1-6]-supply$": true
272
273   - if:
274       properties:
275         compatible:
276           contains:
277             enum:
278               - qcom,pm8994-regulators
279     then:
280       properties:
281         vdd_l1-supply: true
282         vdd_l13_l19_l23_l24-supply: true
283         vdd_l14_l15-supply: true
284         vdd_l17_l29-supply: true
285         vdd_l20_l21-supply: true
286         vdd_l25-supply: true
287         vdd_l2_l26_l28-supply: true
288         vdd_l3_l11-supply: true
289         vdd_l4_l27_l31-supply: true
290         vdd_l5_l7-supply: true
291         vdd_l6_l12_l32-supply: true
292         vdd_l8_l16_l30-supply: true
293         vdd_l9_l10_l18_l22-supply: true
294         vdd_lvs_1_2-supply: true
295       patternProperties:
296         "^vdd_s[1-9][0-2]?-supply$": true
297
298   - if:
299       properties:
300         compatible:
301           contains:
302             enum:
303               - qcom,pmi8994-regulators
304     then:
305       properties:
306         vdd_l1-supply: true
307       patternProperties:
308         "^vdd_s[1-3]-supply$": true
309
310   - if:
311       properties:
312         compatible:
313           contains:
314             enum:
315               - qcom,pmp8074-regulators
316     then:
317       properties:
318         vdd_l10_l11_l12_l13-supply: true
319         vdd_l1_l2-supply: true
320         vdd_l3_l8-supply: true
321         vdd_l5_l6_l15-supply: true
322       patternProperties:
323         "^vdd_l[479]-supply$": true
324         "^vdd_s[1-5]-supply$": true
325
326   - if:
327       properties:
328         compatible:
329           contains:
330             enum:
331               - qcom,pms405-regulators
332     then:
333       properties:
334         vdd_s3-supply: true
335
336 unevaluatedProperties: false
337
338 examples:
339   - |
340     regulators {
341       compatible = "qcom,pm8941-regulators";
342       vdd_l1_l3-supply = <&s1>;
343
344       s1: s1 {
345         regulator-min-microvolt = <1300000>;
346         regulator-max-microvolt = <1400000>;
347       };
348
349       l1: l1 {
350         regulator-min-microvolt = <1225000>;
351         regulator-max-microvolt = <1300000>;
352       };
353     };
354 ...