1# SPDX-License-Identifier: GPL-2.0
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/mfd/hisilicon,hi6421-spmi-pmic.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: HiSilicon 6421v600 SPMI PMIC
8
9maintainers:
10  - Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
11
12description: |
13  HiSilicon 6421v600 should be connected inside a MIPI System Power Management
14  (SPMI) bus. It provides interrupts and power supply.
15
16  The GPIO and interrupt settings are represented as part of the top-level PMIC
17  node.
18
19  The SPMI controller part is provided by
20  drivers/staging/hikey9xx/hisilicon,hisi-spmi-controller.yaml.
21
22properties:
23  $nodename:
24    pattern: "pmic@[0-9a-f]"
25
26  compatible:
27    const: hisilicon,hi6421v600-spmi
28
29  reg:
30    maxItems: 1
31
32  '#interrupt-cells':
33    const: 2
34
35  interrupt-controller:
36    description:
37      Identify that the PMIC is capable of behaving as an interrupt controller.
38
39  gpios:
40    maxItems: 1
41
42  regulators:
43    type: object
44
45    properties:
46      '#address-cells':
47        const: 1
48
49      '#size-cells':
50        const: 0
51
52    patternProperties:
53      '^ldo[0-9]+@[0-9a-f]$':
54        type: object
55
56        $ref: "/schemas/regulator/regulator.yaml#"
57
58        properties:
59          reg:
60            description: Enable register.
61
62          '#address-cells':
63            const: 1
64
65          '#size-cells':
66            const: 0
67
68          vsel-reg:
69            description: Voltage selector register.
70
71          enable-mask:
72            description: Bitmask used to enable the regulator.
73
74          voltage-table:
75            description: Table with the selector items for the voltage regulator.
76            minItems: 2
77            maxItems: 16
78
79          off-on-delay-us:
80            description: Time required for changing state to enabled in microseconds.
81
82          startup-delay-us:
83            description: Startup time in microseconds.
84
85          idle-mode-mask:
86            description: Bitmask used to put the regulator on idle mode.
87
88          eco-microamp:
89            description: Maximum current while on idle mode.
90
91        required:
92          - reg
93          - vsel-reg
94          - enable-mask
95          - voltage-table
96          - off-on-delay-us
97          - startup-delay-us
98
99required:
100  - compatible
101  - reg
102  - regulators
103
104examples:
105  - |
106    /* pmic properties */
107
108    pmic: pmic@0 {
109      compatible = "hisilicon,hi6421-spmi";
110      reg = <0 0>;
111
112      #interrupt-cells = <2>;
113      interrupt-controller;
114      gpios = <&gpio28 0 0>;
115
116      regulators {
117        #address-cells = <1>;
118        #size-cells = <0>;
119
120        ldo3: ldo3@16 {
121          reg = <0x16>;
122          vsel-reg = <0x51>;
123
124          regulator-name = "ldo3";
125          regulator-min-microvolt = <1500000>;
126          regulator-max-microvolt = <2000000>;
127          regulator-boot-on;
128
129          enable-mask = <0x01>;
130
131          voltage-table = <1500000>, <1550000>, <1600000>, <1650000>,
132                          <1700000>, <1725000>, <1750000>, <1775000>,
133                          <1800000>, <1825000>, <1850000>, <1875000>,
134                          <1900000>, <1925000>, <1950000>, <2000000>;
135          off-on-delay-us = <20000>;
136          startup-delay-us = <120>;
137        };
138
139        ldo4: ldo4@17 { /* 40 PIN */
140          reg = <0x17>;
141          vsel-reg = <0x52>;
142
143          regulator-name = "ldo4";
144          regulator-min-microvolt = <1725000>;
145          regulator-max-microvolt = <1900000>;
146          regulator-boot-on;
147
148          enable-mask = <0x01>;
149          idle-mode-mask = <0x10>;
150          eco-microamp = <10000>;
151
152          hi6421-vsel = <0x52 0x07>;
153          voltage-table = <1725000>, <1750000>, <1775000>, <1800000>,
154                          <1825000>, <1850000>, <1875000>, <1900000>;
155          off-on-delay-us = <20000>;
156          startup-delay-us = <120>;
157        };
158      };
159    };
160