Charger Manager

Schema identifier ($id): "http://devicetree.org/schemas/power/supply/charger-manager.yaml#"

Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"

Maintainers (maintainers): "Sebastian Reichel <sre@kernel.org>"

Binding for the legacy charger manager driver. Please do not use for new products.

Properties and child nodes (properties) #

compatible — required here #

Exact value (const): "charger-manager"

cm-chargers — required here #

name of chargers

Shared schema rule ($ref): /schemas/types.yaml#/definitions/string-array

cm-num-chargers — not listed as required here #

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

Deprecated (deprecated): true

cm-fuel-gauge — required here #

name of battery fuel gauge

Shared schema rule ($ref): /schemas/types.yaml#/definitions/string

cm-name — not listed as required here #

name of the charger manager

Default value (default): "battery"

Shared schema rule ($ref): /schemas/types.yaml#/definitions/string

cm-poll-mode — not listed as required here #

polling mode

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

Default value (default): 0

Allowed values (enum): 0, 1, 2, 3

cm-poll-interval — not listed as required here #

polling interval (in ms)

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

cm-battery-stat — not listed as required here #

battery status

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

Allowed values (enum): 0, 1, 2, 3

cm-fullbatt-vchkdrop-volt — not listed as required here #

voltage drop before restarting charging in uV

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

cm-fullbatt-vchkdrop-ms — not listed as required here #

Deprecated (deprecated): true

cm-fullbatt-voltage — not listed as required here #

voltage of full battery in uV

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

cm-fullbatt-soc — not listed as required here #

state of charge to consider as full battery in %

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

cm-fullbatt-capacity — not listed as required here #

capcity to consider as full battery in uAh

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

cm-thermal-zone — not listed as required here #

name of external thermometer's thermal zone

Shared schema rule ($ref): /schemas/types.yaml#/definitions/string

cm-discharging-max — not listed as required here #

limits of discharging duration in ms

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

cm-charging-max — not listed as required here #

limits of charging duration in ms

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

cm-battery-cold — not listed as required here #

critical cold temperature of battery for charging in deci-degree celsius

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

cm-battery-cold-in-minus — not listed as required here #

if set cm-battery-cold temperature is in minus degrees

Value type (type): "boolean"

cm-battery-hot — not listed as required here #

critical hot temperature of battery for charging in deci-degree celsius

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

cm-battery-temp-diff — not listed as required here #

temperature difference to allow recharging in deci-degree celsius

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

Properties matching a name pattern (patternProperties) #

-supply$ — name matches this regular expression #

regulator consumer, named according to cm-regulator-name

Shared schema rule ($ref): /schemas/types.yaml#/definitions/phandle

^regulator[@-][0-9]$ — name matches this regular expression #

Value type (type): "object"

Properties and child nodes (properties) #

cm-regulator-name — required here

name of charger regulator

Shared schema rule ($ref): /schemas/types.yaml#/definitions/string

Required in this object (required): "cm-regulator-name"

Properties not matched by properties or patternProperties in this schema (additionalProperties) #

false

Not allowed by this rule.

Properties matching a name pattern (patternProperties) #

^cable[@-][0-9]$ — name matches this regular expression

Value type (type): "object"

Properties and child nodes (properties)

cm-cable-name — required here

name of charger cable

Allowed values (enum): "USB", "USB-HOST", "SDP", "DCP", "CDP", "ACA", "FAST-CHARGER", "SLOW-CHARGER", "WPT", "PD", "DOCK", "JIG", "MECHANICAL"

cm-cable-extcon — required here

name of extcon dev

Shared schema rule ($ref): /schemas/types.yaml#/definitions/string

cm-cable-min — not listed as required here

minimum current of cable in uA

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

cm-cable-max — not listed as required here

maximum current of cable in uA

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

Required in this object (required): "cm-cable-name", "cm-cable-extcon"

Properties not matched by properties or patternProperties in this schema (additionalProperties)

false

Not allowed by this rule.

Required in this object (required): "compatible", "cm-chargers", "cm-fuel-gauge"

Properties not matched by properties or patternProperties in this schema (additionalProperties) #

false

Not allowed by this rule.

Examples (examples) #

charger-manager {
    compatible = "charger-manager";
    chg-reg-supply = <&charger_regulator>;

    cm-name = "battery";
    /* Always polling ON : 30s */
    cm-poll-mode = <1>;
    cm-poll-interval = <30000>;

    cm-fullbatt-vchkdrop-volt = <150000>;
    cm-fullbatt-soc = <100>;

    cm-battery-stat = <3>;

    cm-chargers = "charger0", "charger1", "charger2";

    cm-fuel-gauge = "fuelgauge0";

    cm-thermal-zone = "thermal_zone.1";
    /* in deci centigrade */
    cm-battery-cold = <50>;
    cm-battery-cold-in-minus;
    cm-battery-hot = <800>;
    cm-battery-temp-diff = <100>;

    /* Allow charging for 5hr */
    cm-charging-max = <18000000>;
    /* Allow discharging for 2hr */
    cm-discharging-max = <7200000>;

    regulator-0 {
        cm-regulator-name = "chg-reg";
        cable-0 {
            cm-cable-name = "USB";
            cm-cable-extcon = "extcon-dev.0";
            cm-cable-min = <475000>;
            cm-cable-max = <500000>;
        };
        cable-1 {
            cm-cable-name = "SDP";
            cm-cable-extcon = "extcon-dev.0";
            cm-cable-min = <650000>;
            cm-cable-max = <675000>;
        };
    };
};

Source notes #

Annotations retained from the schema source

Line 1: SPDX-License-Identifier: GPL-2.0

Line 42: disabled

Line 43: always

Line 44: when external power is connected

Line 45: when charging

Line 55: battery always present

Line 56: no battery

Line 57: check presence via fuel gauge

Line 58: check presence via charger

Edit this page