xref: /openbmc/linux/Documentation/devicetree/bindings/power/supply/charger-manager.yaml (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
1a5afc760SSebastian Reichel# SPDX-License-Identifier: GPL-2.0
2a5afc760SSebastian Reichel%YAML 1.2
3a5afc760SSebastian Reichel---
4a5afc760SSebastian Reichel$id: http://devicetree.org/schemas/power/supply/charger-manager.yaml#
5a5afc760SSebastian Reichel$schema: http://devicetree.org/meta-schemas/core.yaml#
6a5afc760SSebastian Reichel
7a5afc760SSebastian Reicheltitle: Charger Manager
8a5afc760SSebastian Reichel
9a5afc760SSebastian Reichelmaintainers:
10a5afc760SSebastian Reichel  - Sebastian Reichel <sre@kernel.org>
11a5afc760SSebastian Reichel
12a5afc760SSebastian Reicheldescription: |
13a5afc760SSebastian Reichel  Binding for the legacy charger manager driver.
14a5afc760SSebastian Reichel  Please do not use for new products.
15a5afc760SSebastian Reichel
16a5afc760SSebastian Reichelproperties:
17a5afc760SSebastian Reichel  compatible:
18a5afc760SSebastian Reichel    const: charger-manager
19a5afc760SSebastian Reichel
20a5afc760SSebastian Reichel  cm-chargers:
21a5afc760SSebastian Reichel    description: name of chargers
22a5afc760SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/string-array
23a5afc760SSebastian Reichel
24a5afc760SSebastian Reichel  cm-num-chargers:
25a5afc760SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/uint32
26a5afc760SSebastian Reichel    deprecated: true
27a5afc760SSebastian Reichel
28a5afc760SSebastian Reichel  cm-fuel-gauge:
29a5afc760SSebastian Reichel    description: name of battery fuel gauge
30a5afc760SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/string
31a5afc760SSebastian Reichel
32a5afc760SSebastian Reichel  cm-name:
33a5afc760SSebastian Reichel    description: name of the charger manager
34a5afc760SSebastian Reichel    default: battery
35a5afc760SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/string
36a5afc760SSebastian Reichel
37a5afc760SSebastian Reichel  cm-poll-mode:
38a5afc760SSebastian Reichel    description: polling mode
394e71ed98SRob Herring    $ref: /schemas/types.yaml#/definitions/uint32
40a5afc760SSebastian Reichel    default: 0
41a5afc760SSebastian Reichel    enum:
42a5afc760SSebastian Reichel      - 0 # disabled
43a5afc760SSebastian Reichel      - 1 # always
44a5afc760SSebastian Reichel      - 2 # when external power is connected
45a5afc760SSebastian Reichel      - 3 # when charging
46a5afc760SSebastian Reichel
47a5afc760SSebastian Reichel  cm-poll-interval:
48a5afc760SSebastian Reichel    description: polling interval (in ms)
49a5afc760SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/uint32
50a5afc760SSebastian Reichel
51a5afc760SSebastian Reichel  cm-battery-stat:
52a5afc760SSebastian Reichel    description: battery status
53*fe75ac87SRob Herring    $ref: /schemas/types.yaml#/definitions/uint32
54a5afc760SSebastian Reichel    enum:
55a5afc760SSebastian Reichel      - 0 # battery always present
56a5afc760SSebastian Reichel      - 1 # no battery
57a5afc760SSebastian Reichel      - 2 # check presence via fuel gauge
58a5afc760SSebastian Reichel      - 3 # check presence via charger
59a5afc760SSebastian Reichel
60a5afc760SSebastian Reichel  cm-fullbatt-vchkdrop-volt:
61a5afc760SSebastian Reichel    description: voltage drop before restarting charging in uV
62a5afc760SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/uint32
63a5afc760SSebastian Reichel
64a5afc760SSebastian Reichel  cm-fullbatt-vchkdrop-ms:
65a5afc760SSebastian Reichel    deprecated: true
66a5afc760SSebastian Reichel
67a5afc760SSebastian Reichel  cm-fullbatt-voltage:
68a5afc760SSebastian Reichel    description: voltage of full battery in uV
69a5afc760SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/uint32
70a5afc760SSebastian Reichel
71a5afc760SSebastian Reichel  cm-fullbatt-soc:
72a5afc760SSebastian Reichel    description: state of charge to consider as full battery in %
73a5afc760SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/uint32
74a5afc760SSebastian Reichel
75a5afc760SSebastian Reichel  cm-fullbatt-capacity:
76a5afc760SSebastian Reichel    description: capcity to consider as full battery in uAh
77a5afc760SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/uint32
78a5afc760SSebastian Reichel
79a5afc760SSebastian Reichel  cm-thermal-zone:
80a5afc760SSebastian Reichel    description: name of external thermometer's thermal zone
81a5afc760SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/string
82a5afc760SSebastian Reichel
83a5afc760SSebastian Reichel  cm-discharging-max:
84a5afc760SSebastian Reichel    description: limits of discharging duration in ms
85a5afc760SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/uint32
86a5afc760SSebastian Reichel
87a5afc760SSebastian Reichel  cm-charging-max:
88a5afc760SSebastian Reichel    description: limits of charging duration in ms
89a5afc760SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/uint32
90a5afc760SSebastian Reichel
91a5afc760SSebastian Reichel  cm-battery-cold:
92a5afc760SSebastian Reichel    description: critical cold temperature of battery for charging in deci-degree celsius
93a5afc760SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/uint32
94a5afc760SSebastian Reichel
95a5afc760SSebastian Reichel  cm-battery-cold-in-minus:
96a5afc760SSebastian Reichel    description: if set cm-battery-cold temperature is in minus degrees
97a5afc760SSebastian Reichel    type: boolean
98a5afc760SSebastian Reichel
99a5afc760SSebastian Reichel  cm-battery-hot:
100a5afc760SSebastian Reichel    description: critical hot temperature of battery for charging in deci-degree celsius
101a5afc760SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/uint32
102a5afc760SSebastian Reichel
103a5afc760SSebastian Reichel  cm-battery-temp-diff:
104a5afc760SSebastian Reichel    description: temperature difference to allow recharging in deci-degree celsius
105a5afc760SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/uint32
106a5afc760SSebastian Reichel
107a5afc760SSebastian ReichelpatternProperties:
108a5afc760SSebastian Reichel  "-supply$":
109a5afc760SSebastian Reichel    description: regulator consumer, named according to cm-regulator-name
110a5afc760SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/phandle
111a5afc760SSebastian Reichel
112a5afc760SSebastian Reichel  "^regulator[@-][0-9]$":
113a5afc760SSebastian Reichel    type: object
114a5afc760SSebastian Reichel    properties:
115a5afc760SSebastian Reichel      cm-regulator-name:
116a5afc760SSebastian Reichel        description: name of charger regulator
117a5afc760SSebastian Reichel        $ref: /schemas/types.yaml#/definitions/string
118a5afc760SSebastian Reichel
119a5afc760SSebastian Reichel    required:
120a5afc760SSebastian Reichel      - cm-regulator-name
121a5afc760SSebastian Reichel
122a5afc760SSebastian Reichel    additionalProperties: false
123a5afc760SSebastian Reichel
124a5afc760SSebastian Reichel    patternProperties:
125a5afc760SSebastian Reichel      "^cable[@-][0-9]$":
126a5afc760SSebastian Reichel        type: object
127a5afc760SSebastian Reichel        properties:
128a5afc760SSebastian Reichel          cm-cable-name:
129a5afc760SSebastian Reichel            description: name of charger cable
130a5afc760SSebastian Reichel            enum:
131a5afc760SSebastian Reichel              - USB
132a5afc760SSebastian Reichel              - USB-HOST
133a5afc760SSebastian Reichel              - SDP
134a5afc760SSebastian Reichel              - DCP
135a5afc760SSebastian Reichel              - CDP
136a5afc760SSebastian Reichel              - ACA
137a5afc760SSebastian Reichel              - FAST-CHARGER
138a5afc760SSebastian Reichel              - SLOW-CHARGER
139a5afc760SSebastian Reichel              - WPT
140a5afc760SSebastian Reichel              - PD
141a5afc760SSebastian Reichel              - DOCK
142a5afc760SSebastian Reichel              - JIG
143a5afc760SSebastian Reichel              - MECHANICAL
144a5afc760SSebastian Reichel
145a5afc760SSebastian Reichel          cm-cable-extcon:
146a5afc760SSebastian Reichel            description: name of extcon dev
147a5afc760SSebastian Reichel            $ref: /schemas/types.yaml#/definitions/string
148a5afc760SSebastian Reichel
149a5afc760SSebastian Reichel          cm-cable-min:
150a5afc760SSebastian Reichel            description: minimum current of cable in uA
151a5afc760SSebastian Reichel            $ref: /schemas/types.yaml#/definitions/uint32
152a5afc760SSebastian Reichel
153a5afc760SSebastian Reichel          cm-cable-max:
154a5afc760SSebastian Reichel            description: maximum current of cable in uA
155a5afc760SSebastian Reichel            $ref: /schemas/types.yaml#/definitions/uint32
156a5afc760SSebastian Reichel
157a5afc760SSebastian Reichel        required:
158a5afc760SSebastian Reichel          - cm-cable-name
159a5afc760SSebastian Reichel          - cm-cable-extcon
160a5afc760SSebastian Reichel
161a5afc760SSebastian Reichel        additionalProperties: false
162a5afc760SSebastian Reichel
163a5afc760SSebastian Reichelrequired:
164a5afc760SSebastian Reichel  - compatible
165a5afc760SSebastian Reichel  - cm-chargers
166a5afc760SSebastian Reichel  - cm-fuel-gauge
167a5afc760SSebastian Reichel
168a5afc760SSebastian ReicheladditionalProperties: false
169a5afc760SSebastian Reichel
170a5afc760SSebastian Reichelexamples:
171a5afc760SSebastian Reichel  - |
172a5afc760SSebastian Reichel    charger-manager {
173a5afc760SSebastian Reichel        compatible = "charger-manager";
174a5afc760SSebastian Reichel        chg-reg-supply = <&charger_regulator>;
175a5afc760SSebastian Reichel
176a5afc760SSebastian Reichel        cm-name = "battery";
177a5afc760SSebastian Reichel        /* Always polling ON : 30s */
178a5afc760SSebastian Reichel        cm-poll-mode = <1>;
179a5afc760SSebastian Reichel        cm-poll-interval = <30000>;
180a5afc760SSebastian Reichel
181a5afc760SSebastian Reichel        cm-fullbatt-vchkdrop-volt = <150000>;
182a5afc760SSebastian Reichel        cm-fullbatt-soc = <100>;
183a5afc760SSebastian Reichel
184a5afc760SSebastian Reichel        cm-battery-stat = <3>;
185a5afc760SSebastian Reichel
186a5afc760SSebastian Reichel        cm-chargers = "charger0", "charger1", "charger2";
187a5afc760SSebastian Reichel
188a5afc760SSebastian Reichel        cm-fuel-gauge = "fuelgauge0";
189a5afc760SSebastian Reichel
190a5afc760SSebastian Reichel        cm-thermal-zone = "thermal_zone.1";
191a5afc760SSebastian Reichel        /* in deci centigrade */
192a5afc760SSebastian Reichel        cm-battery-cold = <50>;
193a5afc760SSebastian Reichel        cm-battery-cold-in-minus;
194a5afc760SSebastian Reichel        cm-battery-hot = <800>;
195a5afc760SSebastian Reichel        cm-battery-temp-diff = <100>;
196a5afc760SSebastian Reichel
197a5afc760SSebastian Reichel        /* Allow charging for 5hr */
198a5afc760SSebastian Reichel        cm-charging-max = <18000000>;
199a5afc760SSebastian Reichel        /* Allow discharging for 2hr */
200a5afc760SSebastian Reichel        cm-discharging-max = <7200000>;
201a5afc760SSebastian Reichel
202a5afc760SSebastian Reichel        regulator-0 {
203a5afc760SSebastian Reichel            cm-regulator-name = "chg-reg";
204a5afc760SSebastian Reichel            cable-0 {
205a5afc760SSebastian Reichel                cm-cable-name = "USB";
206a5afc760SSebastian Reichel                cm-cable-extcon = "extcon-dev.0";
207a5afc760SSebastian Reichel                cm-cable-min = <475000>;
208a5afc760SSebastian Reichel                cm-cable-max = <500000>;
209a5afc760SSebastian Reichel            };
210a5afc760SSebastian Reichel            cable-1 {
211a5afc760SSebastian Reichel                cm-cable-name = "SDP";
212a5afc760SSebastian Reichel                cm-cable-extcon = "extcon-dev.0";
213a5afc760SSebastian Reichel                cm-cable-min = <650000>;
214a5afc760SSebastian Reichel                cm-cable-max = <675000>;
215a5afc760SSebastian Reichel            };
216a5afc760SSebastian Reichel        };
217a5afc760SSebastian Reichel    };
218