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
7title: Qualcomm Technologies, Inc. RPMh Regulators
8
9maintainers:
10  - Bjorn Andersson <bjorn.andersson@linaro.org>
11  - Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
12
13description: |
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
57properties:
58  compatible:
59    enum:
60      - qcom,pm6150-rpmh-regulators
61      - qcom,pm6150l-rpmh-regulators
62      - qcom,pm6350-rpmh-regulators
63      - qcom,pm660-rpmh-regulators
64      - qcom,pm660l-rpmh-regulators
65      - qcom,pm7325-rpmh-regulators
66      - qcom,pm8005-rpmh-regulators
67      - qcom,pm8009-rpmh-regulators
68      - qcom,pm8009-1-rpmh-regulators
69      - qcom,pm8150-rpmh-regulators
70      - qcom,pm8150l-rpmh-regulators
71      - qcom,pm8350-rpmh-regulators
72      - qcom,pm8350c-rpmh-regulators
73      - qcom,pm8450-rpmh-regulators
74      - qcom,pm8550-rpmh-regulators
75      - qcom,pm8550ve-rpmh-regulators
76      - qcom,pm8550vs-rpmh-regulators
77      - qcom,pm8998-rpmh-regulators
78      - qcom,pmg1110-rpmh-regulators
79      - qcom,pmi8998-rpmh-regulators
80      - qcom,pmm8155au-rpmh-regulators
81      - qcom,pmr735a-rpmh-regulators
82      - qcom,pmx55-rpmh-regulators
83      - qcom,pmx65-rpmh-regulators
84
85  qcom,pmic-id:
86    description: |
87        RPMh resource name suffix used for the regulators found
88        on this PMIC.
89    $ref: /schemas/types.yaml#/definitions/string
90    enum: [a, b, c, d, e, f, g, h, k]
91
92  qcom,always-wait-for-ack:
93    description: |
94        Boolean flag which indicates that the application processor
95        must wait for an ACK or a NACK from RPMh for every request
96        sent for this regulator including those which are for a
97        strictly lower power state.
98    $ref: /schemas/types.yaml#/definitions/flag
99
100  vdd-flash-supply:
101    description: Input supply phandle of flash.
102
103  vdd-rgb-supply:
104    description: Input supply phandle of rgb.
105
106  bob:
107    type: object
108    $ref: "regulator.yaml#"
109    description: BOB regulator node.
110    dependencies:
111      regulator-allow-set-load: ["regulator-allowed-modes"]
112
113patternProperties:
114  "^(smps|ldo|lvs|bob)[0-9]+$":
115    type: object
116    $ref: "regulator.yaml#"
117    description: smps/ldo regulator nodes(s).
118    dependencies:
119      regulator-allow-set-load: ["regulator-allowed-modes"]
120
121required:
122  - compatible
123  - qcom,pmic-id
124
125allOf:
126  - if:
127      properties:
128        compatible:
129          enum:
130            - qcom,pm6150-rpmh-regulators
131    then:
132      properties:
133        vdd-l2-l3-supply: true
134        vdd-l4-l7-l8-supply: true
135        vdd-l5-l16-l17-l18-l19-supply: true
136        vdd-l10-l14-l15-supply: true
137        vdd-l11-l12-l13-supply: true
138      patternProperties:
139        "^vdd-l[169]-supply$": true
140        "^vdd-s[1-5]-supply$": true
141
142  - if:
143      properties:
144        compatible:
145          enum:
146            - qcom,pm6150l-rpmh-regulators
147    then:
148      properties:
149        vdd-bob-supply:
150          description: BOB regulator parent supply phandle.
151        vdd-l1-l8-supply: true
152        vdd-l2-l3-supply: true
153        vdd-l4-l5-l6-supply: true
154        vdd-l7-l11-supply: true
155        vdd-l9-l10-supply: true
156      patternProperties:
157        "^vdd-s[1-8]-supply$": true
158
159  - if:
160      properties:
161        compatible:
162          enum:
163            - qcom,pm660-rpmh-regulators
164    then:
165      properties:
166        vdd-l1-l6-l7-supply: true
167        vdd-l2-l3-supply: true
168        vdd-l5-supply: true
169        vdd-l8-l9-l10-l11-l12-l13-l14-supply: true
170        vdd-l15-l16-l17-l18-l19-supply: true
171      patternProperties:
172        "^vdd-s[1-6]-supply$": true
173
174  - if:
175      properties:
176        compatible:
177          enum:
178            - qcom,pm660l-rpmh-regulators
179    then:
180      properties:
181        vdd-bob-supply:
182          description: BOB regulator parent supply phandle.
183        vdd-l1-l9-l10-supply: true
184        vdd-l2-supply: true
185        vdd-l3-l5-l7-l8-supply: true
186        vdd-l4-l6-supply: true
187        vdd-s3-s4-supply: true
188      patternProperties:
189        "^vdd-s[125]-supply$": true
190
191  - if:
192      properties:
193        compatible:
194          enum:
195            - qcom,pm7325-rpmh-regulators
196    then:
197      properties:
198        vdd-l1-l4-l12-l15-supply: true
199        vdd-l2-l7-supply: true
200        vdd-l6-l9-l10-supply: true
201        vdd-l11-l17-l18-l19-supply: true
202        vdd-l13-supply: true
203        vdd-l14-l16-supply: true
204      patternProperties:
205        "^vdd-l[358]-supply$": true
206        "^vdd-s[1-8]-supply$": true
207
208  - if:
209      properties:
210        compatible:
211          enum:
212            - qcom,pm8005-rpmh-regulators
213    then:
214      patternProperties:
215        "^vdd-s[1-4]-supply$": true
216
217  - if:
218      properties:
219        compatible:
220          enum:
221            - qcom,pm8009-rpmh-regulators
222            - qcom,pm8009-1-rpmh-regulators
223    then:
224      properties:
225        vdd-l5-l6-supply: true
226      patternProperties:
227        "^vdd-l[1-47]-supply$": true
228        "^vdd-s[1-2]-supply$": true
229
230  - if:
231      properties:
232        compatible:
233          enum:
234            - qcom,pm8150-rpmh-regulators
235            - qcom,pmm8155au-rpmh-regulators
236    then:
237      properties:
238        vdd-l1-l8-l11-supply: true
239        vdd-l2-l10-supply: true
240        vdd-l3-l4-l5-l18-supply: true
241        vdd-l6-l9-supply: true
242        vdd-l7-l12-l14-l15-supply: true
243        vdd-l13-l16-l17-supply: true
244      patternProperties:
245        "^vdd-s([1-9]|10)-supply$": true
246
247  - if:
248      properties:
249        compatible:
250          enum:
251            - qcom,pm8150l-rpmh-regulators
252    then:
253      properties:
254        vdd-bob-supply:
255          description: BOB regulator parent supply phandle.
256        vdd-l1-l8-supply: true
257        vdd-l2-l3-supply: true
258        vdd-l4-l5-l6-supply: true
259        vdd-l7-l11-supply: true
260        vdd-l9-l10-supply: true
261      patternProperties:
262        "^vdd-s[1-8]-supply$": true
263
264  - if:
265      properties:
266        compatible:
267          enum:
268            - qcom,pm8350-rpmh-regulators
269    then:
270      properties:
271        vdd-l1-l4-supply: true
272        vdd-l2-l7-supply: true
273        vdd-l3-l5-supply: true
274        vdd-l6-l9-l10-supply: true
275        vdd-l8-supply: true
276      patternProperties:
277        "^vdd-s([1-9]|1[0-2])-supply$": true
278
279  - if:
280      properties:
281        compatible:
282          enum:
283            - qcom,pm8350c-rpmh-regulators
284    then:
285      properties:
286        vdd-bob-supply:
287          description: BOB regulator parent supply phandle.
288        vdd-l1-l12-supply: true
289        vdd-l2-l8-supply: true
290        vdd-l3-l4-l5-l7-l13-supply: true
291        vdd-l6-l9-l11-supply: true
292        vdd-l10-supply: true
293      patternProperties:
294        "^vdd-s([1-9]|10)-supply$": true
295
296  - if:
297      properties:
298        compatible:
299          enum:
300            - qcom,pm8450-rpmh-regulators
301    then:
302      patternProperties:
303        "^vdd-l[1-4]-supply$": true
304        "^vdd-s[1-6]-supply$": true
305
306  - if:
307      properties:
308        compatible:
309          enum:
310            - qcom,pm8550-rpmh-regulators
311            - qcom,pm8550ve-rpmh-regulators
312            - qcom,pm8550vs-rpmh-regulators
313    then:
314      properties:
315        vdd-l2-l13-l14-supply: true
316        vdd-l5-l16-supply: true
317        vdd-l6-l7-supply: true
318        vdd-l8-l9-supply: true
319      patternProperties:
320        "^vdd-l([1-4]|1[0-7])-supply$": true
321        "^vdd-s[1-6]-supply$": true
322        "^vdd-bob[1-2]-supply$": true
323
324  - if:
325      properties:
326        compatible:
327          enum:
328            - qcom,pm8998-rpmh-regulators
329    then:
330      properties:
331        vdd-l1-l27-supply: true
332        vdd-l2-l8-l17-supply: true
333        vdd-l3-l11-supply: true
334        vdd-l4-l5-supply: true
335        vdd-l6-supply: true
336        vdd-l7-l12-l14-l15-supply: true
337        vdd-l9-supply: true
338        vdd-l10-l23-l25-supply: true
339        vdd-l13-l19-l21-supply: true
340        vdd-l16-l28-supply: true
341        vdd-l18-l22-supply: true
342        vdd-l20-l24-supply: true
343        vdd-l26-supply: true
344        vin-lvs-1-2-supply: true
345      patternProperties:
346        "^vdd-s([1-9]|1[0-3])-supply$": true
347
348  - if:
349      properties:
350        compatible:
351          enum:
352            - qcom,pmg1110-rpmh-regulators
353    then:
354      properties:
355        vdd-s1-supply: true
356
357  - if:
358      properties:
359        compatible:
360          enum:
361            - qcom,pmi8998-rpmh-regulators
362    then:
363      properties:
364        vdd-bob-supply:
365          description: BOB regulator parent supply phandle.
366
367  - if:
368      properties:
369        compatible:
370          enum:
371            - qcom,pmr735a-rpmh-regulators
372    then:
373      properties:
374        vdd-l1-l2-supply: true
375        vdd-l3-supply: true
376        vdd-l4-supply: true
377        vdd-l5-l6-supply: true
378        vdd-l7-bob-supply: true
379      patternProperties:
380        "^vdd-s[1-3]-supply$": true
381
382  - if:
383      properties:
384        compatible:
385          enum:
386            - qcom,pmx55-rpmh-regulators
387    then:
388      properties:
389        vdd-l1-l2-supply: true
390        vdd-l3-l9-supply: true
391        vdd-l4-l12-supply: true
392        vdd-l5-l6-supply: true
393        vdd-l7-l8-supply: true
394        vdd-l10-l11-l13-supply: true
395      patternProperties:
396        "^vdd-l1[4-6]-supply$": true
397        "^vdd-s[1-7]-supply$": true
398
399  - if:
400      properties:
401        compatible:
402          enum:
403            - qcom,pmx65-rpmh-regulators
404    then:
405      properties:
406        vdd-l2-l18-supply: true
407        vdd-l5-l6-l16-supply: true
408        vdd-l8-l9-supply: true
409        vdd-l11-l13-supply: true
410      patternProperties:
411        "^vdd-l[1347]-supply$": true
412        "^vdd-l1[0245789]-supply$": true
413        "^vdd-l2[01]-supply$": true
414        "^vdd-s[1-8]-supply$": true
415
416unevaluatedProperties: false
417
418examples:
419  - |
420    #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
421
422    pm8998-rpmh-regulators {
423        compatible = "qcom,pm8998-rpmh-regulators";
424        qcom,pmic-id = "a";
425
426        vdd-l7-l12-l14-l15-supply = <&pm8998_s5>;
427
428        smps2 {
429            regulator-min-microvolt = <1100000>;
430            regulator-max-microvolt = <1100000>;
431        };
432
433        ldo7 {
434            regulator-min-microvolt = <1800000>;
435            regulator-max-microvolt = <1800000>;
436            regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
437            regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
438                                       RPMH_REGULATOR_MODE_HPM>;
439            regulator-allow-set-load;
440        };
441
442        lvs1 {
443            regulator-min-microvolt = <1800000>;
444            regulator-max-microvolt = <1800000>;
445        };
446    };
447
448    pmi8998-rpmh-regulators {
449        compatible = "qcom,pmi8998-rpmh-regulators";
450        qcom,pmic-id = "b";
451
452        bob {
453            regulator-min-microvolt = <3312000>;
454            regulator-max-microvolt = <3600000>;
455            regulator-allowed-modes = <RPMH_REGULATOR_MODE_AUTO
456                                       RPMH_REGULATOR_MODE_HPM>;
457            regulator-initial-mode = <RPMH_REGULATOR_MODE_AUTO>;
458        };
459    };
460...
461