battery.yaml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/power/supply/battery.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: Battery Characteristics
  7. maintainers:
  8. - Sebastian Reichel <sre@kernel.org>
  9. description: |
  10. The devicetree battery node provides static battery characteristics.
  11. In smart batteries, these are typically stored in non-volatile memory
  12. on a fuel gauge chip. The battery node should be used where there is
  13. no appropriate non-volatile memory, or it is unprogrammed/incorrect.
  14. Upstream dts files should not include battery nodes, unless the battery
  15. represented cannot easily be replaced in the system by one of a
  16. different type. This prevents unpredictable, potentially harmful,
  17. behavior should a replacement that changes the battery type occur
  18. without a corresponding update to the dtb.
  19. Battery properties are named, where possible, for the corresponding elements
  20. in enum power_supply_property, defined in include/linux/power_supply.h
  21. Batteries must be referenced by chargers and/or fuel-gauges using a phandle.
  22. The phandle's property should be named "monitored-battery".
  23. properties:
  24. compatible:
  25. const: simple-battery
  26. device-chemistry:
  27. description: This describes the chemical technology of the battery.
  28. oneOf:
  29. - const: nickel-cadmium
  30. - const: nickel-metal-hydride
  31. - const: lithium-ion
  32. description: This is a blanket type for all lithium-ion batteries,
  33. including those below. If possible, a precise compatible string
  34. from below should be used, but sometimes it is unknown which specific
  35. lithium ion battery is employed and this wide compatible can be used.
  36. - const: lithium-ion-polymer
  37. - const: lithium-ion-iron-phosphate
  38. - const: lithium-ion-manganese-oxide
  39. over-voltage-threshold-microvolt:
  40. description: battery over-voltage limit
  41. re-charge-voltage-microvolt:
  42. description: limit to automatically start charging again
  43. voltage-min-design-microvolt:
  44. description: drained battery voltage
  45. voltage-max-design-microvolt:
  46. description: fully charged battery voltage
  47. energy-full-design-microwatt-hours:
  48. description: battery design energy
  49. charge-full-design-microamp-hours:
  50. description: battery design capacity
  51. trickle-charge-current-microamp:
  52. description: current for trickle-charge phase
  53. precharge-current-microamp:
  54. description: current for pre-charge phase
  55. precharge-upper-limit-microvolt:
  56. description: limit when to change to constant charging
  57. charge-term-current-microamp:
  58. description: current for charge termination phase
  59. constant-charge-current-max-microamp:
  60. description: maximum constant input current
  61. constant-charge-voltage-max-microvolt:
  62. description: maximum constant input voltage
  63. factory-internal-resistance-micro-ohms:
  64. description: battery factory internal resistance
  65. resistance-temp-table:
  66. $ref: /schemas/types.yaml#/definitions/uint32-matrix
  67. items:
  68. items:
  69. - description: the temperature in degree Celsius
  70. - description: battery internal resistance percent
  71. description: |
  72. A table providing the temperature in degree Celsius
  73. and corresponding battery internal resistance percent, which is used to
  74. look up the resistance percent according to current temperature to get an
  75. accurate batterty internal resistance in different temperatures.
  76. ocv-capacity-celsius:
  77. description: |
  78. An array containing the temperature in degree Celsius,
  79. for each of the battery capacity lookup table.
  80. operating-range-celsius:
  81. description: operating temperature range of a battery
  82. items:
  83. - description: minimum temperature at which battery can operate
  84. - description: maximum temperature at which battery can operate
  85. ambient-celsius:
  86. description: safe range of ambient temperature
  87. items:
  88. - description: alert when ambient temperature is lower than this value
  89. - description: alert when ambient temperature is higher than this value
  90. alert-celsius:
  91. description: safe range of battery temperature
  92. items:
  93. - description: alert when battery temperature is lower than this value
  94. - description: alert when battery temperature is higher than this value
  95. required:
  96. - compatible
  97. patternProperties:
  98. '^ocv-capacity-table-[0-9]+$':
  99. $ref: /schemas/types.yaml#/definitions/uint32-matrix
  100. description: |
  101. An array providing the open circuit voltage (OCV)
  102. of the battery and corresponding battery capacity percent, which is used
  103. to look up battery capacity according to current OCV value. And the open
  104. circuit voltage unit is microvolt.
  105. maxItems: 100
  106. items:
  107. items:
  108. - description: open circuit voltage (OCV) in microvolts
  109. - description: battery capacity percent
  110. maximum: 100
  111. additionalProperties: false
  112. examples:
  113. - |
  114. power {
  115. #address-cells = <1>;
  116. #size-cells = <0>;
  117. battery: battery {
  118. compatible = "simple-battery";
  119. over-voltage-threshold-microvolt = <4500000>;
  120. re-charge-voltage-microvolt = <250000>;
  121. voltage-min-design-microvolt = <3200000>;
  122. voltage-max-design-microvolt = <4200000>;
  123. energy-full-design-microwatt-hours = <5290000>;
  124. charge-full-design-microamp-hours = <1430000>;
  125. precharge-current-microamp = <256000>;
  126. precharge-upper-limit-microvolt = <2500000>;
  127. charge-term-current-microamp = <128000>;
  128. constant-charge-current-max-microamp = <900000>;
  129. constant-charge-voltage-max-microvolt = <4200000>;
  130. factory-internal-resistance-micro-ohms = <250000>;
  131. ocv-capacity-celsius = <(-10) 0 10>;
  132. /* table for -10 degree Celsius */
  133. ocv-capacity-table-0 = <4185000 100>, <4113000 95>, <4066000 90>;
  134. /* table for 0 degree Celsius */
  135. ocv-capacity-table-1 = <4200000 100>, <4185000 95>, <4113000 90>;
  136. /* table for 10 degree Celsius */
  137. ocv-capacity-table-2 = <4250000 100>, <4200000 95>, <4185000 90>;
  138. resistance-temp-table = <20 100>, <10 90>, <0 80>, <(-10) 60>;
  139. operating-range-celsius = <(-30) 50>;
  140. ambient-celsius = <(-5) 50>;
  141. alert-celsius = <0 40>;
  142. };
  143. charger@11 {
  144. reg = <0x11>;
  145. monitored-battery = <&battery>;
  146. };
  147. fuel-gauge@22 {
  148. reg = <0x22>;
  149. monitored-battery = <&battery>;
  150. };
  151. };