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