Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux
[sfrench/cifs-2.6.git] / Documentation / devicetree / bindings / power / supply / battery.txt
1 Battery Characteristics
2
3 The devicetree battery node provides static battery characteristics.
4 In smart batteries, these are typically stored in non-volatile memory
5 on a fuel gauge chip. The battery node should be used where there is
6 no appropriate non-volatile memory, or it is unprogrammed/incorrect.
7
8 Upstream dts files should not include battery nodes, unless the battery
9 represented cannot easily be replaced in the system by one of a
10 different type. This prevents unpredictable, potentially harmful,
11 behavior should a replacement that changes the battery type occur
12 without a corresponding update to the dtb.
13
14 Required Properties:
15  - compatible: Must be "simple-battery"
16
17 Optional Properties:
18  - voltage-min-design-microvolt: drained battery voltage
19  - energy-full-design-microwatt-hours: battery design energy
20  - charge-full-design-microamp-hours: battery design capacity
21  - precharge-current-microamp: current for pre-charge phase
22  - charge-term-current-microamp: current for charge termination phase
23  - constant-charge-current-max-microamp: maximum constant input current
24  - constant-charge-voltage-max-microvolt: maximum constant input voltage
25  - factory-internal-resistance-micro-ohms: battery factory internal resistance
26  - ocv-capacity-table-0: An array providing the open circuit voltage (OCV)
27    of the battery and corresponding battery capacity percent, which is used
28    to look up battery capacity according to current OCV value. And the open
29    circuit voltage unit is microvolt.
30  - ocv-capacity-table-1: Same as ocv-capacity-table-0
31  ......
32  - ocv-capacity-table-n: Same as ocv-capacity-table-0
33  - ocv-capacity-celsius: An array containing the temperature in degree Celsius,
34    for each of the battery capacity lookup table. The first temperature value
35    specifies the OCV table 0, and the second temperature value specifies the
36    OCV table 1, and so on.
37
38 Battery properties are named, where possible, for the corresponding
39 elements in enum power_supply_property, defined in
40 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/power_supply.h
41
42 Batteries must be referenced by chargers and/or fuel-gauges
43 using a phandle. The phandle's property should be named
44 "monitored-battery".
45
46 Example:
47
48         bat: battery {
49                 compatible = "simple-battery";
50                 voltage-min-design-microvolt = <3200000>;
51                 energy-full-design-microwatt-hours = <5290000>;
52                 charge-full-design-microamp-hours = <1430000>;
53                 precharge-current-microamp = <256000>;
54                 charge-term-current-microamp = <128000>;
55                 constant-charge-current-max-microamp = <900000>;
56                 constant-charge-voltage-max-microvolt = <4200000>;
57                 factory-internal-resistance-micro-ohms = <250000>;
58                 ocv-capacity-celsius = <(-10) 0 10>;
59                 ocv-capacity-table-0 = <4185000 100>, <4113000 95>, <4066000 90>, ...;
60                 ocv-capacity-table-1 = <4200000 100>, <4185000 95>, <4113000 90>, ...;
61                 ocv-capacity-table-2 = <4250000 100>, <4200000 95>, <4185000 90>, ...;
62         };
63
64         charger: charger@11 {
65                 ....
66                 monitored-battery = <&bat>;
67                 ...
68         };
69
70         fuel_gauge: fuel-gauge@22 {
71                 ....
72                 monitored-battery = <&bat>;
73                 ...
74         };