summaryrefslogtreecommitdiffstats
path: root/Documentation/devicetree/bindings/power/supply/summit,smb347-charger.yaml
blob: 2d552becbfe6cb08c72f2a5584bdddc67443a2e4 (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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/summit,smb347-charger.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Battery charger driver for SMB345, SMB347 and SMB358

maintainers:
  - David Heidelberg <david@ixit.cz>
  - Dmitry Osipenko <digetx@gmail.com>

properties:
  compatible:
    enum:
      - summit,smb345
      - summit,smb347
      - summit,smb358

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  monitored-battery:
    description: phandle to the battery node
    $ref: /schemas/types.yaml#/definitions/phandle

  summit,enable-usb-charging:
    type: boolean
    description: Enable charging through USB.

  summit,enable-otg-charging:
    type: boolean
    description: Provide power for USB OTG

  summit,enable-mains-charging:
    type: boolean
    description: Enable charging through mains

  summit,enable-charge-control:
    description: Enable charging control
    $ref: /schemas/types.yaml#/definitions/uint32
    enum:
      - 0 # SMB3XX_CHG_ENABLE_SW SW (I2C interface)
      - 1 # SMB3XX_CHG_ENABLE_PIN_ACTIVE_LOW Pin control (Active Low)
      - 2 # SMB3XX_CHG_ENABLE_PIN_ACTIVE_HIGH Pin control (Active High)

  summit,fast-voltage-threshold-microvolt:
    description: Voltage threshold to transit to fast charge mode (in uV)
    minimum: 2400000
    maximum: 3000000

  summit,mains-current-limit-microamp:
    description: Maximum input current from AC/DC input (in uA)

  summit,usb-current-limit-microamp:
    description: Maximum input current from USB input (in uA)

  summit,charge-current-compensation-microamp:
    description: Charge current compensation (in uA)

  summit,chip-temperature-threshold-celsius:
    description: Chip temperature for thermal regulation in °C.
    enum: [100, 110, 120, 130]

  summit,soft-compensation-method:
    description: Soft temperature limit compensation method
    $ref: /schemas/types.yaml#/definitions/uint32
    enum:
      - 0 # SMB3XX_SOFT_TEMP_COMPENSATE_NONE Compensation none
      - 1 # SMB3XX_SOFT_TEMP_COMPENSATE_CURRENT Current compensation
      - 2 # SMB3XX_SOFT_TEMP_COMPENSATE_VOLTAGE Voltage compensation

  summit,inok-polarity:
    description: |
      Polarity of INOK signal indicating presence of external power supply.
    $ref: /schemas/types.yaml#/definitions/uint32
    enum:
      - 0 # SMB3XX_SYSOK_INOK_ACTIVE_LOW
      - 1 # SMB3XX_SYSOK_INOK_ACTIVE_HIGH

  usb-vbus:
    $ref: /schemas/regulator/regulator.yaml#
    type: object

    properties:
      summit,needs-inok-toggle:
        type: boolean
        description: INOK signal is fixed and polarity needs to be toggled
                     in order to enable/disable output mode.

    unevaluatedProperties: false

allOf:
  - if:
      properties:
        compatible:
          enum:
            - summit,smb345
            - summit,smb358

    then:
      properties:
        summit,mains-current-limit-microamp:
          enum: [ 300000, 500000, 700000, 1000000,
                  1500000, 1800000, 2000000]

        summit,usb-current-limit-microamp:
          enum: [ 300000, 500000, 700000, 1000000,
                  1500000, 1800000, 2000000]

        summit,charge-current-compensation-microamp:
          enum: [200000, 450000, 600000, 900000]

    else:
      properties:
        summit,mains-current-limit-microamp:
          enum: [ 300000, 500000, 700000, 900000, 1200000,
                  1500000, 1800000, 2000000, 2200000, 2500000]

        summit,usb-current-limit-microamp:
          enum: [ 300000, 500000, 700000, 900000, 1200000,
                  1500000, 1800000, 2000000, 2200000, 2500000]

        summit,charge-current-compensation-microamp:
          enum: [250000, 700000, 900000, 1200000]

required:
  - compatible
  - reg

anyOf:
  - required:
      - summit,enable-usb-charging
  - required:
      - summit,enable-otg-charging
  - required:
      - summit,enable-mains-charging

additionalProperties: false

examples:
  - |
    #include <dt-bindings/power/summit,smb347-charger.h>

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

        charger@7f {
            compatible = "summit,smb347";
            reg = <0x7f>;

            summit,enable-charge-control = <SMB3XX_CHG_ENABLE_PIN_ACTIVE_HIGH>;
            summit,inok-polarity = <SMB3XX_SYSOK_INOK_ACTIVE_LOW>;
            summit,chip-temperature-threshold-celsius = <110>;
            summit,mains-current-limit-microamp = <2000000>;
            summit,usb-current-limit-microamp = <500000>;
            summit,enable-usb-charging;
            summit,enable-mains-charging;

            monitored-battery = <&battery>;

            usb-vbus {
                regulator-name = "usb_vbus";
                regulator-min-microvolt = <5000000>;
                regulator-max-microvolt = <5000000>;
                regulator-min-microamp = <750000>;
                regulator-max-microamp = <750000>;
                summit,needs-inok-toggle;
            };
        };
    };

    battery: battery-cell {
        compatible = "simple-battery";
        constant-charge-current-max-microamp = <1800000>;
        operating-range-celsius = <0 45>;
        alert-celsius = <3 42>;
    };