"Fossies" - the Fresh Open Source Software Archive

Member "linux-5.3.1/Documentation/devicetree/bindings/power/supply/battery.txt" (21 Sep 2019, 3195 Bytes) of package /linux/kernel/v5.3/linux-5.3.1.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    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  - voltage-max-design-microvolt: fully charged battery voltage
   20  - energy-full-design-microwatt-hours: battery design energy
   21  - charge-full-design-microamp-hours: battery design capacity
   22  - precharge-current-microamp: current for pre-charge phase
   23  - charge-term-current-microamp: current for charge termination phase
   24  - constant-charge-current-max-microamp: maximum constant input current
   25  - constant-charge-voltage-max-microvolt: maximum constant input voltage
   26  - factory-internal-resistance-micro-ohms: battery factory internal resistance
   27  - ocv-capacity-table-0: An array providing the open circuit voltage (OCV)
   28    of the battery and corresponding battery capacity percent, which is used
   29    to look up battery capacity according to current OCV value. And the open
   30    circuit voltage unit is microvolt.
   31  - ocv-capacity-table-1: Same as ocv-capacity-table-0
   32  ......
   33  - ocv-capacity-table-n: Same as ocv-capacity-table-0
   34  - ocv-capacity-celsius: An array containing the temperature in degree Celsius,
   35    for each of the battery capacity lookup table. The first temperature value
   36    specifies the OCV table 0, and the second temperature value specifies the
   37    OCV table 1, and so on.
   38 
   39 Battery properties are named, where possible, for the corresponding
   40 elements in enum power_supply_property, defined in
   41 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/power_supply.h
   42 
   43 Batteries must be referenced by chargers and/or fuel-gauges
   44 using a phandle. The phandle's property should be named
   45 "monitored-battery".
   46 
   47 Example:
   48 
   49 	bat: battery {
   50 		compatible = "simple-battery";
   51 		voltage-min-design-microvolt = <3200000>;
   52 		voltage-max-design-microvolt = <4200000>;
   53 		energy-full-design-microwatt-hours = <5290000>;
   54 		charge-full-design-microamp-hours = <1430000>;
   55 		precharge-current-microamp = <256000>;
   56 		charge-term-current-microamp = <128000>;
   57 		constant-charge-current-max-microamp = <900000>;
   58 		constant-charge-voltage-max-microvolt = <4200000>;
   59 		factory-internal-resistance-micro-ohms = <250000>;
   60 		ocv-capacity-celsius = <(-10) 0 10>;
   61 		ocv-capacity-table-0 = <4185000 100>, <4113000 95>, <4066000 90>, ...;
   62 		ocv-capacity-table-1 = <4200000 100>, <4185000 95>, <4113000 90>, ...;
   63 		ocv-capacity-table-2 = <4250000 100>, <4200000 95>, <4185000 90>, ...;
   64 	};
   65 
   66 	charger: charger@11 {
   67 		....
   68 		monitored-battery = <&bat>;
   69 		...
   70 	};
   71 
   72 	fuel_gauge: fuel-gauge@22 {
   73 		....
   74 		monitored-battery = <&bat>;
   75 		...
   76 	};