xref: /linux/Documentation/devicetree/bindings/mfd/dlg,da9063.yaml (revision 4b660dbd9ee2059850fd30e0df420ca7a38a1856)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/mfd/dlg,da9063.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Dialog DA906{3L,3,2,1} Power Management Integrated Circuit (PMIC)
8
9maintainers:
10  - Steve Twiss <stwiss.opensource@diasemi.com>
11
12description: |
13  For device-tree bindings of other sub-modules refer to the binding documents
14  under the respective sub-system directories.
15  Using regulator-{uv,ov}-{warn,error,protection}-microvolt requires special
16  handling: First, when GP_FB2 is used, it must be ensured that there is no
17  moment where all voltage monitors are disabled. Next, as da9063 only supports
18  UV *and* OV monitoring, both must be set to the same severity and value
19  (0: disable, 1: enable).
20  Product information for the DA906{3L,3,2,1} devices can be found here:
21  - https://www.dialog-semiconductor.com/products/da9063l
22  - https://www.dialog-semiconductor.com/products/da9063
23  - https://www.dialog-semiconductor.com/products/da9062
24  - https://www.dialog-semiconductor.com/products/da9061
25
26properties:
27  compatible:
28    enum:
29      - dlg,da9061
30      - dlg,da9062
31      - dlg,da9063
32      - dlg,da9063l
33
34  reg:
35    maxItems: 1
36
37  interrupts:
38    maxItems: 1
39
40  interrupt-controller: true
41
42  "#interrupt-cells":
43    const: 2
44
45  gpio-controller: true
46
47  "#gpio-cells":
48    const: 2
49
50  gpio:
51    type: object
52    additionalProperties: false
53    properties:
54      compatible:
55        const: dlg,da9062-gpio
56
57  onkey:
58    $ref: /schemas/input/dlg,da9062-onkey.yaml
59
60  regulators:
61    type: object
62    additionalProperties: false
63    patternProperties:
64      "^(ldo([1-9]|1[01])|bcore([1-2]|s-merged)|b(pro|mem|io|peri)|bmem-bio-merged|buck[1-4])$":
65        $ref: /schemas/regulator/regulator.yaml
66        unevaluatedProperties: false
67
68  rtc:
69    type: object
70    $ref: /schemas/rtc/rtc.yaml#
71    unevaluatedProperties: false
72    properties:
73      compatible:
74        enum:
75          - dlg,da9062-rtc
76          - dlg,da9063-rtc
77
78  thermal:
79    $ref: /schemas/thermal/dlg,da9062-thermal.yaml
80
81  watchdog:
82    $ref: /schemas/watchdog/dlg,da9062-watchdog.yaml
83
84patternProperties:
85  "^(.+-hog(-[0-9]+)?)$":
86    type: object
87
88    required:
89      - gpio-hog
90
91required:
92  - compatible
93  - reg
94
95allOf:
96  - if:
97      properties:
98        compatible:
99          contains:
100            enum:
101              - dlg,da9063
102              - dlg,da9063l
103    then:
104      properties:
105        gpio-controller: false
106        "#gpio-cells": false
107        gpio: false
108        regulators:
109          patternProperties:
110            "^buck[1-4]$": false
111        thermal: false
112      required:
113        - interrupts
114        - interrupt-controller
115        - '#interrupt-cells'
116
117  - if:
118      properties:
119        compatible:
120          contains:
121            enum:
122              - dlg,da9062
123    then:
124      properties:
125        regulators:
126          patternProperties:
127            "^(ldo([5-9]|10|11)|bcore([1-2]|s-merged)|b(pro|mem|io|peri)|bmem-bio-merged)$": false
128      required:
129        - gpio
130        - onkey
131        - rtc
132        - thermal
133        - watchdog
134
135  - if:
136      properties:
137        compatible:
138          contains:
139            enum:
140              - dlg,da9061
141    then:
142      properties:
143        gpio-controller: false
144        "#gpio-cells": false
145        gpio: false
146        regulators:
147          patternProperties:
148            "^(ldo([5-9]|10|11)|bcore([1-2]|s-merged)|b(pro|mem|io|peri)|bmem-bio-merged|buck4)$": false
149        rtc: false
150      required:
151        - onkey
152        - thermal
153        - watchdog
154
155additionalProperties: false
156
157examples:
158  - |
159    #include <dt-bindings/interrupt-controller/irq.h>
160    i2c {
161      #address-cells = <1>;
162      #size-cells = <0>;
163      pmic@58 {
164        compatible = "dlg,da9063";
165        reg = <0x58>;
166        interrupt-parent = <&gpio6>;
167        interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
168        interrupt-controller;
169        #interrupt-cells = <2>;
170
171        rtc {
172          compatible = "dlg,da9063-rtc";
173        };
174
175        watchdog {
176          compatible = "dlg,da9063-watchdog";
177        };
178
179        onkey {
180          compatible = "dlg,da9063-onkey";
181          dlg,disable-key-power;
182        };
183
184        regulators {
185          bcore1 {
186            regulator-name = "BCORE1";
187            regulator-min-microvolt = <300000>;
188            regulator-max-microvolt = <1570000>;
189            regulator-min-microamp = <500000>;
190            regulator-max-microamp = <2000000>;
191            regulator-boot-on;
192          };
193          ldo6 {
194            /* UNUSED */
195            regulator-name = "LDO_6";
196            regulator-uv-protection-microvolt = <0>;
197            regulator-ov-protection-microvolt = <0>;
198          };
199          ldo11 {
200            regulator-name = "LDO_11";
201            regulator-min-microvolt = <900000>;
202            regulator-max-microvolt = <900000>;
203            regulator-uv-protection-microvolt = <1>;
204            regulator-ov-protection-microvolt = <1>;
205            regulator-always-on;
206          };
207        };
208      };
209    };
210
211  - |
212    #include <dt-bindings/interrupt-controller/irq.h>
213    #include <dt-bindings/regulator/dlg,da9063-regulator.h>
214    i2c {
215      #address-cells = <1>;
216      #size-cells = <0>;
217      pmic@58 {
218        compatible = "dlg,da9062";
219        reg = <0x58>;
220        gpio-controller;
221        #gpio-cells = <2>;
222
223        sd0-pwr-sel-hog {
224          gpio-hog;
225          gpios = <1 0>;
226          input;
227          line-name = "SD0_PWR_SEL";
228        };
229
230        sd1-pwr-sel-hog {
231          gpio-hog;
232          gpios = <2 0>;
233          input;
234          line-name = "SD1_PWR_SEL";
235        };
236
237        sw-et0-en-hog {
238          gpio-hog;
239          gpios = <3 0>;
240          input;
241          line-name = "SW_ET0_EN#";
242        };
243
244        pmic-good-hog {
245          gpio-hog;
246          gpios = <4 0>;
247          output-high;
248          line-name = "PMIC_PGOOD";
249        };
250
251        gpio {
252          compatible = "dlg,da9062-gpio";
253        };
254
255        onkey {
256          compatible = "dlg,da9062-onkey";
257        };
258
259        regulators {
260          buck1 {
261            regulator-name = "vdd_arm";
262            regulator-min-microvolt = <925000>;
263            regulator-max-microvolt = <1380000>;
264            regulator-initial-mode = <DA9063_BUCK_MODE_SYNC>;
265            regulator-always-on;
266          };
267          buck2 {
268            regulator-name = "vdd_soc";
269            regulator-min-microvolt = <1150000>;
270            regulator-max-microvolt = <1380000>;
271            regulator-initial-mode = <DA9063_BUCK_MODE_SYNC>;
272            regulator-always-on;
273          };
274          buck3 {
275            regulator-name = "vdd_ddr3";
276            regulator-min-microvolt = <1500000>;
277            regulator-max-microvolt = <1500000>;
278            regulator-initial-mode = <DA9063_BUCK_MODE_SYNC>;
279            regulator-always-on;
280          };
281          buck4 {
282            regulator-name = "vdd_eth";
283            regulator-min-microvolt = <1200000>;
284            regulator-max-microvolt = <1200000>;
285            regulator-initial-mode = <DA9063_BUCK_MODE_SYNC>;
286            regulator-always-on;
287          };
288          ldo1 {
289            regulator-name = "vdd_snvs";
290            regulator-min-microvolt = <3000000>;
291            regulator-max-microvolt = <3000000>;
292            regulator-always-on;
293          };
294          ldo2 {
295            regulator-name = "vdd_high";
296            regulator-min-microvolt = <3000000>;
297            regulator-max-microvolt = <3000000>;
298            regulator-always-on;
299          };
300          ldo3 {
301            regulator-name = "vdd_eth_io";
302            regulator-min-microvolt = <2500000>;
303            regulator-max-microvolt = <2500000>;
304          };
305          ldo4 {
306            regulator-name = "vdd_emmc";
307            regulator-min-microvolt = <1800000>;
308            regulator-max-microvolt = <1800000>;
309            regulator-always-on;
310          };
311        };
312
313        rtc {
314          compatible = "dlg,da9062-rtc";
315        };
316
317        thermal {
318          compatible = "dlg,da9062-thermal";
319        };
320
321        watchdog {
322          compatible = "dlg,da9062-watchdog";
323          dlg,use-sw-pm;
324        };
325      };
326    };
327...
328