218 lines · yaml
1# SPDX-License-Identifier: GPL-2.02%YAML 1.23---4$id: http://devicetree.org/schemas/power/supply/charger-manager.yaml#5$schema: http://devicetree.org/meta-schemas/core.yaml#6 7title: Charger Manager8 9maintainers:10 - Sebastian Reichel <sre@kernel.org>11 12description: |13 Binding for the legacy charger manager driver.14 Please do not use for new products.15 16properties:17 compatible:18 const: charger-manager19 20 cm-chargers:21 description: name of chargers22 $ref: /schemas/types.yaml#/definitions/string-array23 24 cm-num-chargers:25 $ref: /schemas/types.yaml#/definitions/uint3226 deprecated: true27 28 cm-fuel-gauge:29 description: name of battery fuel gauge30 $ref: /schemas/types.yaml#/definitions/string31 32 cm-name:33 description: name of the charger manager34 default: battery35 $ref: /schemas/types.yaml#/definitions/string36 37 cm-poll-mode:38 description: polling mode39 $ref: /schemas/types.yaml#/definitions/uint3240 default: 041 enum:42 - 0 # disabled43 - 1 # always44 - 2 # when external power is connected45 - 3 # when charging46 47 cm-poll-interval:48 description: polling interval (in ms)49 $ref: /schemas/types.yaml#/definitions/uint3250 51 cm-battery-stat:52 description: battery status53 $ref: /schemas/types.yaml#/definitions/uint3254 enum:55 - 0 # battery always present56 - 1 # no battery57 - 2 # check presence via fuel gauge58 - 3 # check presence via charger59 60 cm-fullbatt-vchkdrop-volt:61 description: voltage drop before restarting charging in uV62 $ref: /schemas/types.yaml#/definitions/uint3263 64 cm-fullbatt-vchkdrop-ms:65 deprecated: true66 67 cm-fullbatt-voltage:68 description: voltage of full battery in uV69 $ref: /schemas/types.yaml#/definitions/uint3270 71 cm-fullbatt-soc:72 description: state of charge to consider as full battery in %73 $ref: /schemas/types.yaml#/definitions/uint3274 75 cm-fullbatt-capacity:76 description: capcity to consider as full battery in uAh77 $ref: /schemas/types.yaml#/definitions/uint3278 79 cm-thermal-zone:80 description: name of external thermometer's thermal zone81 $ref: /schemas/types.yaml#/definitions/string82 83 cm-discharging-max:84 description: limits of discharging duration in ms85 $ref: /schemas/types.yaml#/definitions/uint3286 87 cm-charging-max:88 description: limits of charging duration in ms89 $ref: /schemas/types.yaml#/definitions/uint3290 91 cm-battery-cold:92 description: critical cold temperature of battery for charging in deci-degree celsius93 $ref: /schemas/types.yaml#/definitions/uint3294 95 cm-battery-cold-in-minus:96 description: if set cm-battery-cold temperature is in minus degrees97 type: boolean98 99 cm-battery-hot:100 description: critical hot temperature of battery for charging in deci-degree celsius101 $ref: /schemas/types.yaml#/definitions/uint32102 103 cm-battery-temp-diff:104 description: temperature difference to allow recharging in deci-degree celsius105 $ref: /schemas/types.yaml#/definitions/uint32106 107patternProperties:108 "-supply$":109 description: regulator consumer, named according to cm-regulator-name110 $ref: /schemas/types.yaml#/definitions/phandle111 112 "^regulator[@-][0-9]$":113 type: object114 properties:115 cm-regulator-name:116 description: name of charger regulator117 $ref: /schemas/types.yaml#/definitions/string118 119 required:120 - cm-regulator-name121 122 additionalProperties: false123 124 patternProperties:125 "^cable[@-][0-9]$":126 type: object127 properties:128 cm-cable-name:129 description: name of charger cable130 enum:131 - USB132 - USB-HOST133 - SDP134 - DCP135 - CDP136 - ACA137 - FAST-CHARGER138 - SLOW-CHARGER139 - WPT140 - PD141 - DOCK142 - JIG143 - MECHANICAL144 145 cm-cable-extcon:146 description: name of extcon dev147 $ref: /schemas/types.yaml#/definitions/string148 149 cm-cable-min:150 description: minimum current of cable in uA151 $ref: /schemas/types.yaml#/definitions/uint32152 153 cm-cable-max:154 description: maximum current of cable in uA155 $ref: /schemas/types.yaml#/definitions/uint32156 157 required:158 - cm-cable-name159 - cm-cable-extcon160 161 additionalProperties: false162 163required:164 - compatible165 - cm-chargers166 - cm-fuel-gauge167 168additionalProperties: false169 170examples:171 - |172 charger-manager {173 compatible = "charger-manager";174 chg-reg-supply = <&charger_regulator>;175 176 cm-name = "battery";177 /* Always polling ON : 30s */178 cm-poll-mode = <1>;179 cm-poll-interval = <30000>;180 181 cm-fullbatt-vchkdrop-volt = <150000>;182 cm-fullbatt-soc = <100>;183 184 cm-battery-stat = <3>;185 186 cm-chargers = "charger0", "charger1", "charger2";187 188 cm-fuel-gauge = "fuelgauge0";189 190 cm-thermal-zone = "thermal_zone.1";191 /* in deci centigrade */192 cm-battery-cold = <50>;193 cm-battery-cold-in-minus;194 cm-battery-hot = <800>;195 cm-battery-temp-diff = <100>;196 197 /* Allow charging for 5hr */198 cm-charging-max = <18000000>;199 /* Allow discharging for 2hr */200 cm-discharging-max = <7200000>;201 202 regulator-0 {203 cm-regulator-name = "chg-reg";204 cable-0 {205 cm-cable-name = "USB";206 cm-cable-extcon = "extcon-dev.0";207 cm-cable-min = <475000>;208 cm-cable-max = <500000>;209 };210 cable-1 {211 cm-cable-name = "SDP";212 cm-cable-extcon = "extcon-dev.0";213 cm-cable-min = <650000>;214 cm-cable-max = <675000>;215 };216 };217 };218