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