battery.txt 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. Battery Characteristics
  2. The devicetree battery node provides static battery characteristics.
  3. In smart batteries, these are typically stored in non-volatile memory
  4. on a fuel gauge chip. The battery node should be used where there is
  5. no appropriate non-volatile memory, or it is unprogrammed/incorrect.
  6. Upstream dts files should not include battery nodes, unless the battery
  7. represented cannot easily be replaced in the system by one of a
  8. different type. This prevents unpredictable, potentially harmful,
  9. behavior should a replacement that changes the battery type occur
  10. without a corresponding update to the dtb.
  11. Required Properties:
  12. - compatible: Must be "simple-battery"
  13. Optional Properties:
  14. - voltage-min-design-microvolt: drained battery voltage
  15. - energy-full-design-microwatt-hours: battery design energy
  16. - charge-full-design-microamp-hours: battery design capacity
  17. - precharge-current-microamp: current for pre-charge phase
  18. - charge-term-current-microamp: current for charge termination phase
  19. - constant-charge-current-max-microamp: maximum constant input current
  20. - constant-charge-voltage-max-microvolt: maximum constant input voltage
  21. Battery properties are named, where possible, for the corresponding
  22. elements in enum power_supply_property, defined in
  23. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/power_supply.h
  24. Batteries must be referenced by chargers and/or fuel-gauges
  25. using a phandle. The phandle's property should be named
  26. "monitored-battery".
  27. Example:
  28. bat: battery {
  29. compatible = "simple-battery";
  30. voltage-min-design-microvolt = <3200000>;
  31. energy-full-design-microwatt-hours = <5290000>;
  32. charge-full-design-microamp-hours = <1430000>;
  33. precharge-current-microamp = <256000>;
  34. charge-term-current-microamp = <128000>;
  35. constant-charge-current-max-microamp = <900000>;
  36. constant-charge-voltage-max-microvolt = <4200000>;
  37. };
  38. charger: charger@11 {
  39. ....
  40. monitored-battery = <&bat>;
  41. ...
  42. };
  43. fuel_gauge: fuel-gauge@22 {
  44. ....
  45. monitored-battery = <&bat>;
  46. ...
  47. };