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