dt-bindings: regulator: qcom,rpmh-regulator: allow i, j, l, m & n as RPMh resource...
[platform/kernel/linux-starfive.git] / Documentation / devicetree / bindings / regulator / qcom,rpmh-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,rpmh-regulator.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: Qualcomm Technologies, Inc. RPMh Regulators
8
9 maintainers:
10   - Bjorn Andersson <bjorn.andersson@linaro.org>
11   - Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
12
13 description: |
14     rpmh-regulator devices support PMIC regulator management via the Voltage
15     Regulator Manager (VRM) and Oscillator Buffer (XOB) RPMh accelerators.
16     The APPS processor communicates with these hardware blocks via a
17     Resource State Coordinator (RSC) using command packets.  The VRM allows
18     changing three parameters for a given regulator, enable state, output
19     voltage, and operating mode.  The XOB allows changing only a single
20     parameter for a given regulator, its enable state.  Despite its name,
21     the XOB is capable of controlling the enable state of any PMIC peripheral.
22     It is used for clock buffers, low-voltage switches, and LDO/SMPS regulators
23     which have a fixed voltage and mode.
24
25     =======================
26     Required Node Structure
27     =======================
28
29     RPMh regulators must be described in two levels of device nodes.  The first
30     level describes the PMIC containing the regulators and must reside within an
31     RPMh device node.  The second level describes each regulator within the PMIC
32     which is to be used on the board.  Each of these regulators maps to a single
33     RPMh resource.
34
35     The names used for regulator nodes must match those supported by a given
36     PMIC. Supported regulator node names are
37       For PM6150, smps1 - smps5, ldo1 - ldo19
38       For PM6150L, smps1 - smps8, ldo1 - ldo11, bob
39       For PM6350, smps1 - smps5, ldo1 - ldo22
40       For PM660, smps1 - smps6, ldo1 - ldo3, ldo5 - ldo19
41       For PM660L, smps1 - smps3, smps5, ldo1 - ldo8, bob
42       For PM7325, smps1 - smps8, ldo1 - ldo19
43       For PM8005, smps1 - smps4
44       For PM8009, smps1 - smps2, ldo1 - ldo7
45       For PM8150, smps1 - smps10, ldo1 - ldo18
46       For PM8150L, smps1 - smps8, ldo1 - ldo11, bob, flash, rgb
47       For PM8350, smps1 - smps12, ldo1 - ldo10
48       For PM8350C, smps1 - smps10, ldo1 - ldo13, bob
49       For PM8450, smps1 - smps6, ldo1 - ldo4
50       For PM8550, smps1 - smps6, ldo1 - ldo17, bob1 - bob2
51       For PM8998, smps1 - smps13, ldo1 - ldo28, lvs1 - lvs2
52       For PMI8998, bob
53       For PMR735A, smps1 - smps3, ldo1 - ldo7
54       For PMX55, smps1 - smps7, ldo1 - ldo16
55       For PMX65, smps1 - smps8, ldo1 - ldo21
56       For PMX75, smps1 - smps10, ldo1 - ldo21
57
58 properties:
59   compatible:
60     enum:
61       - qcom,pm6150-rpmh-regulators
62       - qcom,pm6150l-rpmh-regulators
63       - qcom,pm6350-rpmh-regulators
64       - qcom,pm660-rpmh-regulators
65       - qcom,pm660l-rpmh-regulators
66       - qcom,pm7325-rpmh-regulators
67       - qcom,pm8005-rpmh-regulators
68       - qcom,pm8009-rpmh-regulators
69       - qcom,pm8009-1-rpmh-regulators
70       - qcom,pm8150-rpmh-regulators
71       - qcom,pm8150l-rpmh-regulators
72       - qcom,pm8350-rpmh-regulators
73       - qcom,pm8350c-rpmh-regulators
74       - qcom,pm8450-rpmh-regulators
75       - qcom,pm8550-rpmh-regulators
76       - qcom,pm8550ve-rpmh-regulators
77       - qcom,pm8550vs-rpmh-regulators
78       - qcom,pm8998-rpmh-regulators
79       - qcom,pmc8180-rpmh-regulators
80       - qcom,pmc8180c-rpmh-regulators
81       - qcom,pmg1110-rpmh-regulators
82       - qcom,pmi8998-rpmh-regulators
83       - qcom,pmm8155au-rpmh-regulators
84       - qcom,pmm8654au-rpmh-regulators
85       - qcom,pmr735a-rpmh-regulators
86       - qcom,pmx55-rpmh-regulators
87       - qcom,pmx65-rpmh-regulators
88       - qcom,pmx75-rpmh-regulators
89
90   qcom,pmic-id:
91     description: |
92         RPMh resource name suffix used for the regulators found
93         on this PMIC.
94     $ref: /schemas/types.yaml#/definitions/string
95     enum: [a, b, c, d, e, f, g, h, i, j, k, l, m, n]
96
97   qcom,always-wait-for-ack:
98     description: |
99         Boolean flag which indicates that the application processor
100         must wait for an ACK or a NACK from RPMh for every request
101         sent for this regulator including those which are for a
102         strictly lower power state.
103     $ref: /schemas/types.yaml#/definitions/flag
104
105   vdd-flash-supply:
106     description: Input supply phandle of flash.
107
108   vdd-rgb-supply:
109     description: Input supply phandle of rgb.
110
111   bob:
112     type: object
113     $ref: regulator.yaml#
114     unevaluatedProperties: false
115     description: BOB regulator node.
116     dependencies:
117       regulator-allow-set-load: [ regulator-allowed-modes ]
118
119 patternProperties:
120   "^(smps|ldo|lvs|bob)[0-9]+$":
121     type: object
122     $ref: regulator.yaml#
123     unevaluatedProperties: false
124     description: smps/ldo regulator nodes(s).
125     dependencies:
126       regulator-allow-set-load: [ regulator-allowed-modes ]
127
128 required:
129   - compatible
130   - qcom,pmic-id
131
132 allOf:
133   - if:
134       properties:
135         compatible:
136           enum:
137             - qcom,pm6150-rpmh-regulators
138     then:
139       properties:
140         vdd-l2-l3-supply: true
141         vdd-l4-l7-l8-supply: true
142         vdd-l5-l16-l17-l18-l19-supply: true
143         vdd-l10-l14-l15-supply: true
144         vdd-l11-l12-l13-supply: true
145       patternProperties:
146         "^vdd-l[169]-supply$": true
147         "^vdd-s[1-5]-supply$": true
148
149   - if:
150       properties:
151         compatible:
152           enum:
153             - qcom,pm6150l-rpmh-regulators
154             - qcom,pm8150l-rpmh-regulators
155             - qcom,pmc8180c-rpmh-regulators
156     then:
157       properties:
158         vdd-bob-supply:
159           description: BOB regulator parent supply phandle.
160         vdd-l1-l8-supply: true
161         vdd-l2-l3-supply: true
162         vdd-l4-l5-l6-supply: true
163         vdd-l7-l11-supply: true
164         vdd-l9-l10-supply: true
165       patternProperties:
166         "^vdd-s[1-8]-supply$": true
167
168   - if:
169       properties:
170         compatible:
171           enum:
172             - qcom,pm660-rpmh-regulators
173     then:
174       properties:
175         vdd-l1-l6-l7-supply: true
176         vdd-l2-l3-supply: true
177         vdd-l5-supply: true
178         vdd-l8-l9-l10-l11-l12-l13-l14-supply: true
179         vdd-l15-l16-l17-l18-l19-supply: true
180       patternProperties:
181         "^vdd-s[1-6]-supply$": true
182
183   - if:
184       properties:
185         compatible:
186           enum:
187             - qcom,pm660l-rpmh-regulators
188     then:
189       properties:
190         vdd-bob-supply:
191           description: BOB regulator parent supply phandle.
192         vdd-l1-l9-l10-supply: true
193         vdd-l2-supply: true
194         vdd-l3-l5-l7-l8-supply: true
195         vdd-l4-l6-supply: true
196         vdd-s3-s4-supply: true
197       patternProperties:
198         "^vdd-s[125]-supply$": true
199
200   - if:
201       properties:
202         compatible:
203           enum:
204             - qcom,pm7325-rpmh-regulators
205     then:
206       properties:
207         vdd-l1-l4-l12-l15-supply: true
208         vdd-l2-l7-supply: true
209         vdd-l6-l9-l10-supply: true
210         vdd-l11-l17-l18-l19-supply: true
211         vdd-l13-supply: true
212         vdd-l14-l16-supply: true
213       patternProperties:
214         "^vdd-l[358]-supply$": true
215         "^vdd-s[1-8]-supply$": true
216
217   - if:
218       properties:
219         compatible:
220           enum:
221             - qcom,pm8005-rpmh-regulators
222     then:
223       patternProperties:
224         "^vdd-s[1-4]-supply$": true
225
226   - if:
227       properties:
228         compatible:
229           enum:
230             - qcom,pm8009-rpmh-regulators
231             - qcom,pm8009-1-rpmh-regulators
232     then:
233       properties:
234         vdd-l5-l6-supply: true
235       patternProperties:
236         "^vdd-l[1-47]-supply$": true
237         "^vdd-s[1-2]-supply$": true
238
239   - if:
240       properties:
241         compatible:
242           enum:
243             - qcom,pm8150-rpmh-regulators
244             - qcom,pmc8180-rpmh-regulators
245             - qcom,pmm8155au-rpmh-regulators
246     then:
247       properties:
248         vdd-l1-l8-l11-supply: true
249         vdd-l2-l10-supply: true
250         vdd-l3-l4-l5-l18-supply: true
251         vdd-l6-l9-supply: true
252         vdd-l7-l12-l14-l15-supply: true
253         vdd-l13-l16-l17-supply: true
254       patternProperties:
255         "^vdd-s([1-9]|10)-supply$": true
256
257   - if:
258       properties:
259         compatible:
260           enum:
261             - qcom,pmm8654au-rpmh-regulators
262     then:
263       properties:
264         vdd-l1-supply: true
265         vdd-l2-l3-supply: true
266         vdd-l4-supply: true
267         vdd-l5-supply: true
268         vdd-l6-l7-supply: true
269         vdd-l8-l9-supply: true
270       patternProperties:
271         "^vdd-s[1-9]-supply$": true
272
273   - if:
274       properties:
275         compatible:
276           enum:
277             - qcom,pm8350-rpmh-regulators
278     then:
279       properties:
280         vdd-l1-l4-supply: true
281         vdd-l2-l7-supply: true
282         vdd-l3-l5-supply: true
283         vdd-l6-l9-l10-supply: true
284         vdd-l8-supply: true
285       patternProperties:
286         "^vdd-s([1-9]|1[0-2])-supply$": true
287
288   - if:
289       properties:
290         compatible:
291           enum:
292             - qcom,pm8350c-rpmh-regulators
293     then:
294       properties:
295         vdd-bob-supply:
296           description: BOB regulator parent supply phandle.
297         vdd-l1-l12-supply: true
298         vdd-l2-l8-supply: true
299         vdd-l3-l4-l5-l7-l13-supply: true
300         vdd-l6-l9-l11-supply: true
301         vdd-l10-supply: true
302       patternProperties:
303         "^vdd-s([1-9]|10)-supply$": true
304
305   - if:
306       properties:
307         compatible:
308           enum:
309             - qcom,pm8450-rpmh-regulators
310     then:
311       patternProperties:
312         "^vdd-l[1-4]-supply$": true
313         "^vdd-s[1-6]-supply$": true
314
315   - if:
316       properties:
317         compatible:
318           enum:
319             - qcom,pm8550-rpmh-regulators
320     then:
321       properties:
322         vdd-l1-l4-l10-supply: true
323         vdd-l2-l13-l14-supply: true
324         vdd-l5-l16-supply: true
325         vdd-l6-l7-supply: true
326         vdd-l8-l9-supply: true
327       patternProperties:
328         "^vdd-l(3|1[1-7])-supply$": true
329         "^vdd-s[1-6]-supply$": true
330         "^vdd-bob[1-2]-supply$": true
331
332   - if:
333       properties:
334         compatible:
335           enum:
336             - qcom,pm8550ve-rpmh-regulators
337             - qcom,pm8550vs-rpmh-regulators
338     then:
339       patternProperties:
340         "^vdd-l[1-3]-supply$": true
341         "^vdd-s[1-6]-supply$": true
342
343   - if:
344       properties:
345         compatible:
346           enum:
347             - qcom,pm8998-rpmh-regulators
348     then:
349       properties:
350         vdd-l1-l27-supply: true
351         vdd-l2-l8-l17-supply: true
352         vdd-l3-l11-supply: true
353         vdd-l4-l5-supply: true
354         vdd-l6-supply: true
355         vdd-l7-l12-l14-l15-supply: true
356         vdd-l9-supply: true
357         vdd-l10-l23-l25-supply: true
358         vdd-l13-l19-l21-supply: true
359         vdd-l16-l28-supply: true
360         vdd-l18-l22-supply: true
361         vdd-l20-l24-supply: true
362         vdd-l26-supply: true
363         vin-lvs-1-2-supply: true
364       patternProperties:
365         "^vdd-s([1-9]|1[0-3])-supply$": true
366
367   - if:
368       properties:
369         compatible:
370           enum:
371             - qcom,pmg1110-rpmh-regulators
372     then:
373       properties:
374         vdd-s1-supply: true
375
376   - if:
377       properties:
378         compatible:
379           enum:
380             - qcom,pmi8998-rpmh-regulators
381     then:
382       properties:
383         vdd-bob-supply:
384           description: BOB regulator parent supply phandle.
385
386   - if:
387       properties:
388         compatible:
389           enum:
390             - qcom,pmr735a-rpmh-regulators
391     then:
392       properties:
393         vdd-l1-l2-supply: true
394         vdd-l3-supply: true
395         vdd-l4-supply: true
396         vdd-l5-l6-supply: true
397         vdd-l7-bob-supply: true
398       patternProperties:
399         "^vdd-s[1-3]-supply$": true
400
401   - if:
402       properties:
403         compatible:
404           enum:
405             - qcom,pmx55-rpmh-regulators
406     then:
407       properties:
408         vdd-l1-l2-supply: true
409         vdd-l3-l9-supply: true
410         vdd-l4-l12-supply: true
411         vdd-l5-l6-supply: true
412         vdd-l7-l8-supply: true
413         vdd-l10-l11-l13-supply: true
414       patternProperties:
415         "^vdd-l1[4-6]-supply$": true
416         "^vdd-s[1-7]-supply$": true
417
418   - if:
419       properties:
420         compatible:
421           enum:
422             - qcom,pmx65-rpmh-regulators
423     then:
424       properties:
425         vdd-l2-l18-supply: true
426         vdd-l5-l6-l16-supply: true
427         vdd-l8-l9-supply: true
428         vdd-l11-l13-supply: true
429       patternProperties:
430         "^vdd-l[1347]-supply$": true
431         "^vdd-l1[024579]-supply$": true
432         "^vdd-l2[01]-supply$": true
433         "^vdd-s[1-8]-supply$": true
434
435   - if:
436       properties:
437         compatible:
438           enum:
439             - qcom,pmx75-rpmh-regulators
440     then:
441       properties:
442         vdd-l2-l18-supply: true
443         vdd-l4-l16-supply: true
444         vdd-l5-l6-supply: true
445         vdd-l8-l9-supply: true
446         vdd-l11-l13-supply: true
447         vdd-l20-l21-supply: true
448       patternProperties:
449         "^vdd-l[137]-supply$": true
450         "^vdd-l1[024579]-supply$": true
451         "^vdd-s([1-9]|10)-supply$": true
452
453 unevaluatedProperties: false
454
455 examples:
456   - |
457     #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
458
459     pm8998-rpmh-regulators {
460         compatible = "qcom,pm8998-rpmh-regulators";
461         qcom,pmic-id = "a";
462
463         vdd-l7-l12-l14-l15-supply = <&pm8998_s5>;
464
465         smps2 {
466             regulator-min-microvolt = <1100000>;
467             regulator-max-microvolt = <1100000>;
468         };
469
470         ldo7 {
471             regulator-min-microvolt = <1800000>;
472             regulator-max-microvolt = <1800000>;
473             regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
474             regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
475                                        RPMH_REGULATOR_MODE_HPM>;
476             regulator-allow-set-load;
477         };
478
479         lvs1 {
480             regulator-min-microvolt = <1800000>;
481             regulator-max-microvolt = <1800000>;
482         };
483     };
484
485     pmi8998-rpmh-regulators {
486         compatible = "qcom,pmi8998-rpmh-regulators";
487         qcom,pmic-id = "b";
488
489         bob {
490             regulator-min-microvolt = <3312000>;
491             regulator-max-microvolt = <3600000>;
492             regulator-allowed-modes = <RPMH_REGULATOR_MODE_AUTO
493                                        RPMH_REGULATOR_MODE_HPM>;
494             regulator-initial-mode = <RPMH_REGULATOR_MODE_AUTO>;
495         };
496     };
497 ...