xref: /freebsd/sys/contrib/device-tree/Bindings/mfd/rohm,bd72720-pmic.yaml (revision 69ed3df4f588860308677cda76cbcce1f19a54c9)
1# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/mfd/rohm,bd72720-pmic.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: ROHM BD72720 and BD73900 Power Management Integrated Circuits
8
9maintainers:
10  - Matti Vaittinen <mazziesaccount@gmail.com>
11
12description:
13  BD72720 and BD73900 are single-chip power management ICs for
14  battery-powered portable devices. They integrate 10 bucks and 11 LDOs,
15  and a 3000 mA switching charger. ICs also include a Coulomb counter,
16  a real-time clock (RTC), GPIOs and a 32.768 kHz clock gate.
17
18# In addition to the properties found from the charger node, PMICs
19# use properties from a static battery node. Please see the:
20# Documentation/devicetree/bindings/power/supply/battery.yaml
21#
22# Following properties are used
23# when present:
24#
25# charge-full-design-microamp-hours: Battry capacity in mAh
26# voltage-max-design-microvolt:      Maximum voltage
27# voltage-min-design-microvolt:      Minimum voltage system is still operating.
28# degrade-cycle-microamp-hours:      Capacity lost due to aging at each full
29#                                    charge cycle.
30# ocv-capacity-celsius:              Array of OCV table temperatures. 1/table.
31# ocv-capacity-table-<N>:            Table of OCV voltage/SOC pairs. Corresponds
32#                                    N.th temperature in ocv-capacity-celsius
33#
34# volt-drop-thresh-microvolt: Threshold for starting the VDR correction
35# volt-drop-soc:                Table of capacity values matching the
36#                                    values in VDR tables.
37#
38# volt-drop-temperatures-millicelsius: Temperatures corresponding to the volage
39# drop values given in volt-drop-[0-9]-microvolt
40#
41# volt-drop-[0-9]-microvolt: VDR table for a temperature specified in
42# volt-drop-temperatures-millicelsius
43#
44# VDR tables are (usually) determined for a specific battery by ROHM.
45# The battery node would then be referred from the charger node:
46#
47# monitored-battery = <&battery>;
48
49properties:
50  compatible:
51    oneOf:
52      - const: rohm,bd72720
53
54      - items:
55          - const: rohm,bd73900
56          - const: rohm,bd72720
57
58  reg:
59    description:
60      I2C slave address.
61    maxItems: 1
62
63  interrupts:
64    maxItems: 1
65
66  gpio-controller: true
67
68  "#gpio-cells":
69    const: 2
70    description:
71      The first cell is the pin number and the second cell is used to specify
72      flags. See the gpio binding document for more information.
73
74  clocks:
75    maxItems: 1
76
77  "#clock-cells":
78    const: 0
79
80  clock-output-names:
81    const: bd71828-32k-out
82
83  rohm,clkout-open-drain:
84    description: clk32kout mode. Set to 1 for "open-drain" or 0 for "cmos".
85    $ref: /schemas/types.yaml#/definitions/uint32
86    maximum: 1
87
88  rohm,charger-sense-resistor-micro-ohms:
89    minimum: 10000
90    maximum: 50000
91    description:
92      PMIC has a SAR ADC for measuring charging currents. External sense
93      resistor (RSENSE in data sheet) should be used. If some other but
94      30 mOhm resistor is used the resistance value should be given here in
95      micro Ohms.
96
97  regulators:
98    $ref: /schemas/regulator/rohm,bd72720-regulator.yaml
99    description:
100      List of child nodes that specify the regulators.
101
102  leds:
103    $ref: /schemas/leds/rohm,bd71828-leds.yaml
104
105  rohm,pin-fault_b:
106    $ref: /schemas/types.yaml#/definitions/string
107    description:
108      PMIC has an OTP option to use fault_b-pin for different
109      purposes. Set this property accordingly. OTP options are
110      OTP0 - bi-directional FAULT_B or READY indicator depending on a
111      'sub option'
112      OTP1 - GPO
113      OTP2 - Power sequencer output.
114    enum:
115      - faultb
116      - readyind
117      - gpo
118      - pwrseq
119
120patternProperties:
121  "^rohm,pin-dvs[0-1]$":
122    $ref: /schemas/types.yaml#/definitions/string
123    description:
124      PMIC has 4 different OTP options to determine the use of dvs<X>-pins.
125      OTP0 - regulator RUN state control.
126      OTP1 - GPI.
127      OTP2 - GPO.
128      OTP3 - Power sequencer output.
129      This property specifies the use of the pin.
130    enum:
131      - dvs-input
132      - gpi
133      - gpo
134      - pwrseq
135
136  "^rohm,pin-exten[0-1]$":
137    $ref: /schemas/types.yaml#/definitions/string
138    description: PMIC has an OTP option to use exten0-pin for different
139      purposes. Set this property accordingly.
140      OTP0 - GPO
141      OTP1 - Power sequencer output.
142    enum:
143      - gpo
144      - pwrseq
145
146required:
147  - compatible
148  - reg
149  - interrupts
150  - clocks
151  - "#clock-cells"
152  - regulators
153  - gpio-controller
154  - "#gpio-cells"
155
156additionalProperties: false
157
158examples:
159  - |
160    #include <dt-bindings/interrupt-controller/irq.h>
161    #include <dt-bindings/leds/common.h>
162    i2c {
163        #address-cells = <1>;
164        #size-cells = <0>;
165        pmic: pmic@4b {
166            compatible = "rohm,bd72720";
167            reg = <0x4b>;
168
169            interrupt-parent = <&gpio1>;
170            interrupts = <29 IRQ_TYPE_LEVEL_LOW>;
171
172            clocks = <&osc 0>;
173            #clock-cells = <0>;
174            clock-output-names = "bd71828-32k-out";
175
176            gpio-controller;
177            #gpio-cells = <2>;
178
179            rohm,pin-dvs0 = "gpi";
180            rohm,pin-dvs1 = "gpi";
181            rohm,pin-exten0 = "gpo";
182            rohm,pin-exten1 = "gpo";
183            rohm,pin-fault_b = "faultb";
184
185            rohm,charger-sense-resistor-micro-ohms = <10000>;
186
187            regulators {
188                buck1 {
189                    regulator-name = "buck1";
190                    regulator-min-microvolt = <500000>;
191                    regulator-max-microvolt = <2000000>;
192                    regulator-ramp-delay = <2500>;
193                };
194                buck2 {
195                    regulator-name = "buck2";
196                    regulator-min-microvolt = <500000>;
197                    regulator-max-microvolt = <2000000>;
198                    regulator-ramp-delay = <2500>;
199                };
200                buck3 {
201                    regulator-name = "buck3";
202                    regulator-min-microvolt = <1200000>;
203                    regulator-max-microvolt = <2000000>;
204                };
205                buck4 {
206                    regulator-name = "buck4";
207                    regulator-min-microvolt = <1000000>;
208                    regulator-max-microvolt = <1800000>;
209                };
210                buck5 {
211                    regulator-name = "buck5";
212                    regulator-min-microvolt = <2500000>;
213                    regulator-max-microvolt = <3300000>;
214                };
215                buck6 {
216                    regulator-name = "buck6";
217                    regulator-min-microvolt = <500000>;
218                    regulator-max-microvolt = <2000000>;
219                    regulator-ramp-delay = <2500>;
220                };
221                buck7 {
222                    regulator-name = "buck7";
223                    regulator-min-microvolt = <500000>;
224                    regulator-max-microvolt = <2000000>;
225                    regulator-ramp-delay = <2500>;
226                };
227                buck8 {
228                    regulator-name = "buck8";
229                    regulator-min-microvolt = <500000>;
230                    regulator-max-microvolt = <1700000>;
231                    regulator-ramp-delay = <2500>;
232                    rohm,dvs-run-voltage = <1700000>;
233                    rohm,dvs-idle-voltage = <1>;
234                    rohm,dvs-suspend-voltage = <1>;
235                    rohm,dvs-lpsr-voltage = <0>;
236                    regulator-boot-on;
237                };
238                buck9 {
239                    regulator-name = "buck9";
240                    regulator-min-microvolt = <500000>;
241                    regulator-max-microvolt = <1700000>;
242                    regulator-ramp-delay = <2500>;
243                    rohm,dvs-run-voltage = <1700000>;
244                    rohm,dvs-idle-voltage = <1>;
245                    rohm,dvs-suspend-voltage = <1>;
246                    rohm,dvs-lpsr-voltage = <0>;
247                    regulator-boot-on;
248                };
249                buck10 {
250                    regulator-name = "buck10";
251                    regulator-min-microvolt = <500000>;
252                    regulator-max-microvolt = <1700000>;
253                    regulator-ramp-delay = <2500>;
254                    rohm,dvs-run-voltage = <1700000>;
255                    rohm,dvs-idle-voltage = <1>;
256                    rohm,dvs-suspend-voltage = <1>;
257                    rohm,dvs-lpsr-voltage = <0>;
258                    regulator-boot-on;
259                };
260                ldo1 {
261                    regulator-name = "ldo1";
262                    regulator-min-microvolt = <800000>;
263                    regulator-max-microvolt = <3300000>;
264                };
265                ldo2 {
266                    regulator-name = "ldo2";
267                    regulator-min-microvolt = <800000>;
268                    regulator-max-microvolt = <3300000>;
269                };
270                ldo3 {
271                    regulator-name = "ldo3";
272                    regulator-min-microvolt = <800000>;
273                    regulator-max-microvolt = <3300000>;
274                };
275                ldo4 {
276                    regulator-name = "ldo4";
277                    regulator-min-microvolt = <800000>;
278                    regulator-max-microvolt = <3300000>;
279                };
280                ldo5 {
281                    regulator-name = "ldo5";
282                    regulator-min-microvolt = <800000>;
283                    regulator-max-microvolt = <3300000>;
284                };
285                ldo6 {
286                    regulator-name = "ldo6";
287                    regulator-min-microvolt = <1800000>;
288                    regulator-max-microvolt = <1800000>;
289                };
290                ldo7 {
291                    regulator-name = "ldo7";
292                    regulator-min-microvolt = <800000>;
293                    regulator-max-microvolt = <3300000>;
294                };
295                ldo8 {
296                    regulator-name = "ldo8";
297                    regulator-min-microvolt = <750000>;
298                    regulator-max-microvolt = <3300000>;
299                    rohm,dvs-suspend-voltage = <0>;
300                    rohm,dvs-lpsr-voltage = <1>;
301                    rohm,dvs-run-voltage = <750000>;
302                };
303                ldo9 {
304                    regulator-name = "ldo9";
305                    regulator-min-microvolt = <750000>;
306                    regulator-max-microvolt = <3300000>;
307                    rohm,dvs-suspend-voltage = <0>;
308                    rohm,dvs-lpsr-voltage = <1>;
309                    rohm,dvs-run-voltage = <750000>;
310                };
311                ldo10 {
312                    regulator-name = "ldo10";
313                    regulator-min-microvolt = <750000>;
314                    regulator-max-microvolt = <3300000>;
315                    rohm,dvs-suspend-voltage = <0>;
316                    rohm,dvs-lpsr-voltage = <1>;
317                    rohm,dvs-run-voltage = <750000>;
318                };
319                ldo11 {
320                    regulator-name = "ldo11";
321                    regulator-min-microvolt = <750000>;
322                    regulator-max-microvolt = <3300000>;
323                    rohm,dvs-suspend-voltage = <0>;
324                    rohm,dvs-lpsr-voltage = <1>;
325                    rohm,dvs-run-voltage = <750000>;
326                };
327            };
328
329            leds {
330                compatible = "rohm,bd71828-leds";
331
332                led-1 {
333                    rohm,led-compatible = "bd71828-grnled";
334                    function = LED_FUNCTION_INDICATOR;
335                    color = <LED_COLOR_ID_GREEN>;
336                };
337                led-2 {
338                    rohm,led-compatible = "bd71828-ambled";
339                    function = LED_FUNCTION_CHARGING;
340                    color = <LED_COLOR_ID_AMBER>;
341                };
342            };
343        };
344    };
345