summaryrefslogtreecommitdiffstats
path: root/Documentation/devicetree/bindings/mfd/richtek,rt5033.yaml
blob: 386b1a50158a6125ba083d3d9b706077d460c48b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/mfd/richtek,rt5033.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Richtek RT5033 Power Management Integrated Circuit

maintainers:
  - Jakob Hauser <jahau@rocketmail.com>

description:
  RT5033 is a multifunction device which includes battery charger, fuel gauge,
  flash LED current source, LDO and synchronous Buck converter for portable
  applications. It is interfaced to host controller using I2C interface. The
  battery fuel gauge uses a separate I2C bus.

properties:
  compatible:
    const: richtek,rt5033

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  regulators:
    description:
      The regulators of RT5033 have to be instantiated under a sub-node named
      "regulators". For SAFE_LDO voltage there is only one value of 4.9 V. LDO
      voltage ranges from 1.2 V to 3.0 V in 0.1 V steps. BUCK voltage ranges
      from 1.0 V to 3.0 V in 0.1 V steps.
    type: object
    patternProperties:
      "^(SAFE_LDO|LDO|BUCK)$":
        type: object
        $ref: /schemas/regulator/regulator.yaml#
        unevaluatedProperties: false
    additionalProperties: false

  charger:
    type: object
    $ref: /schemas/power/supply/richtek,rt5033-charger.yaml#

required:
  - compatible
  - reg
  - interrupts

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>

    battery: battery {
        compatible = "simple-battery";
        precharge-current-microamp = <450000>;
        constant-charge-current-max-microamp = <1000000>;
        charge-term-current-microamp = <150000>;
        precharge-upper-limit-microvolt = <3500000>;
        constant-charge-voltage-max-microvolt = <4350000>;
    };

    extcon {
        usb_con: connector {
            compatible = "usb-b-connector";
            label = "micro-USB";
            type = "micro";
        };
    };

    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        i2c@0 {
            #address-cells = <1>;
            #size-cells = <0>;
            reg = <0>;

            fuel-gauge@35 {
                compatible = "richtek,rt5033-battery";
                reg = <0x35>;

                interrupt-parent = <&msmgpio>;
                interrupts = <121 IRQ_TYPE_EDGE_FALLING>;

                pinctrl-names = "default";
                pinctrl-0 = <&fg_alert_default>;

                power-supplies = <&rt5033_charger>;
            };
        };

        i2c@1 {
            #address-cells = <1>;
            #size-cells = <0>;
            reg = <1>;

            pmic@34 {
                compatible = "richtek,rt5033";
                reg = <0x34>;

                interrupt-parent = <&msmgpio>;
                interrupts = <62 IRQ_TYPE_EDGE_FALLING>;

                pinctrl-names = "default";
                pinctrl-0 = <&pmic_int_default>;

                regulators {
                    safe_ldo_reg: SAFE_LDO {
                        regulator-name = "SAFE_LDO";
                        regulator-min-microvolt = <4900000>;
                        regulator-max-microvolt = <4900000>;
                        regulator-always-on;
                    };
                    ldo_reg: LDO {
                        regulator-name = "LDO";
                        regulator-min-microvolt = <2800000>;
                        regulator-max-microvolt = <2800000>;
                    };
                    buck_reg: BUCK {
                        regulator-name = "BUCK";
                        regulator-min-microvolt = <1200000>;
                        regulator-max-microvolt = <1200000>;
                    };
                };

                rt5033_charger: charger {
                    compatible = "richtek,rt5033-charger";
                    monitored-battery = <&battery>;
                    richtek,usb-connector = <&usb_con>;
                };
            };
        };
    };