xref: /freebsd/sys/contrib/device-tree/Bindings/power/supply/charger-manager.yaml (revision d5b0e70f7e04d971691517ce1304d86a1e367e2e)
15956d97fSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0
25956d97fSEmmanuel Vadot%YAML 1.2
35956d97fSEmmanuel Vadot---
45956d97fSEmmanuel Vadot$id: http://devicetree.org/schemas/power/supply/charger-manager.yaml#
55956d97fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
65956d97fSEmmanuel Vadot
75956d97fSEmmanuel Vadottitle: Charger Manager
85956d97fSEmmanuel Vadot
95956d97fSEmmanuel Vadotmaintainers:
105956d97fSEmmanuel Vadot  - Sebastian Reichel <sre@kernel.org>
115956d97fSEmmanuel Vadot
125956d97fSEmmanuel Vadotdescription: |
135956d97fSEmmanuel Vadot  Binding for the legacy charger manager driver.
145956d97fSEmmanuel Vadot  Please do not use for new products.
155956d97fSEmmanuel Vadot
165956d97fSEmmanuel Vadotproperties:
175956d97fSEmmanuel Vadot  compatible:
185956d97fSEmmanuel Vadot    const: charger-manager
195956d97fSEmmanuel Vadot
205956d97fSEmmanuel Vadot  cm-chargers:
215956d97fSEmmanuel Vadot    description: name of chargers
225956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/string-array
235956d97fSEmmanuel Vadot
245956d97fSEmmanuel Vadot  cm-num-chargers:
255956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
265956d97fSEmmanuel Vadot    deprecated: true
275956d97fSEmmanuel Vadot
285956d97fSEmmanuel Vadot  cm-fuel-gauge:
295956d97fSEmmanuel Vadot    description: name of battery fuel gauge
305956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/string
315956d97fSEmmanuel Vadot
325956d97fSEmmanuel Vadot  cm-name:
335956d97fSEmmanuel Vadot    description: name of the charger manager
345956d97fSEmmanuel Vadot    default: battery
355956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/string
365956d97fSEmmanuel Vadot
375956d97fSEmmanuel Vadot  cm-poll-mode:
385956d97fSEmmanuel Vadot    description: polling mode
39*d5b0e70fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
405956d97fSEmmanuel Vadot    default: 0
415956d97fSEmmanuel Vadot    enum:
425956d97fSEmmanuel Vadot      - 0 # disabled
435956d97fSEmmanuel Vadot      - 1 # always
445956d97fSEmmanuel Vadot      - 2 # when external power is connected
455956d97fSEmmanuel Vadot      - 3 # when charging
465956d97fSEmmanuel Vadot
475956d97fSEmmanuel Vadot  cm-poll-interval:
485956d97fSEmmanuel Vadot    description: polling interval (in ms)
495956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
505956d97fSEmmanuel Vadot
515956d97fSEmmanuel Vadot  cm-battery-stat:
525956d97fSEmmanuel Vadot    description: battery status
535956d97fSEmmanuel Vadot    enum:
545956d97fSEmmanuel Vadot      - 0 # battery always present
555956d97fSEmmanuel Vadot      - 1 # no battery
565956d97fSEmmanuel Vadot      - 2 # check presence via fuel gauge
575956d97fSEmmanuel Vadot      - 3 # check presence via charger
585956d97fSEmmanuel Vadot
595956d97fSEmmanuel Vadot  cm-fullbatt-vchkdrop-volt:
605956d97fSEmmanuel Vadot    description: voltage drop before restarting charging in uV
615956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
625956d97fSEmmanuel Vadot
635956d97fSEmmanuel Vadot  cm-fullbatt-vchkdrop-ms:
645956d97fSEmmanuel Vadot    deprecated: true
655956d97fSEmmanuel Vadot
665956d97fSEmmanuel Vadot  cm-fullbatt-voltage:
675956d97fSEmmanuel Vadot    description: voltage of full battery in uV
685956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
695956d97fSEmmanuel Vadot
705956d97fSEmmanuel Vadot  cm-fullbatt-soc:
715956d97fSEmmanuel Vadot    description: state of charge to consider as full battery in %
725956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
735956d97fSEmmanuel Vadot
745956d97fSEmmanuel Vadot  cm-fullbatt-capacity:
755956d97fSEmmanuel Vadot    description: capcity to consider as full battery in uAh
765956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
775956d97fSEmmanuel Vadot
785956d97fSEmmanuel Vadot  cm-thermal-zone:
795956d97fSEmmanuel Vadot    description: name of external thermometer's thermal zone
805956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/string
815956d97fSEmmanuel Vadot
825956d97fSEmmanuel Vadot  cm-discharging-max:
835956d97fSEmmanuel Vadot    description: limits of discharging duration in ms
845956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
855956d97fSEmmanuel Vadot
865956d97fSEmmanuel Vadot  cm-charging-max:
875956d97fSEmmanuel Vadot    description: limits of charging duration in ms
885956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
895956d97fSEmmanuel Vadot
905956d97fSEmmanuel Vadot  cm-battery-cold:
915956d97fSEmmanuel Vadot    description: critical cold temperature of battery for charging in deci-degree celsius
925956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
935956d97fSEmmanuel Vadot
945956d97fSEmmanuel Vadot  cm-battery-cold-in-minus:
955956d97fSEmmanuel Vadot    description: if set cm-battery-cold temperature is in minus degrees
965956d97fSEmmanuel Vadot    type: boolean
975956d97fSEmmanuel Vadot
985956d97fSEmmanuel Vadot  cm-battery-hot:
995956d97fSEmmanuel Vadot    description: critical hot temperature of battery for charging in deci-degree celsius
1005956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
1015956d97fSEmmanuel Vadot
1025956d97fSEmmanuel Vadot  cm-battery-temp-diff:
1035956d97fSEmmanuel Vadot    description: temperature difference to allow recharging in deci-degree celsius
1045956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
1055956d97fSEmmanuel Vadot
1065956d97fSEmmanuel VadotpatternProperties:
1075956d97fSEmmanuel Vadot  "-supply$":
1085956d97fSEmmanuel Vadot    description: regulator consumer, named according to cm-regulator-name
1095956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/phandle
1105956d97fSEmmanuel Vadot
1115956d97fSEmmanuel Vadot  "^regulator[@-][0-9]$":
1125956d97fSEmmanuel Vadot    type: object
1135956d97fSEmmanuel Vadot    properties:
1145956d97fSEmmanuel Vadot      cm-regulator-name:
1155956d97fSEmmanuel Vadot        description: name of charger regulator
1165956d97fSEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/string
1175956d97fSEmmanuel Vadot
1185956d97fSEmmanuel Vadot    required:
1195956d97fSEmmanuel Vadot      - cm-regulator-name
1205956d97fSEmmanuel Vadot
1215956d97fSEmmanuel Vadot    additionalProperties: false
1225956d97fSEmmanuel Vadot
1235956d97fSEmmanuel Vadot    patternProperties:
1245956d97fSEmmanuel Vadot      "^cable[@-][0-9]$":
1255956d97fSEmmanuel Vadot        type: object
1265956d97fSEmmanuel Vadot        properties:
1275956d97fSEmmanuel Vadot          cm-cable-name:
1285956d97fSEmmanuel Vadot            description: name of charger cable
1295956d97fSEmmanuel Vadot            enum:
1305956d97fSEmmanuel Vadot              - USB
1315956d97fSEmmanuel Vadot              - USB-HOST
1325956d97fSEmmanuel Vadot              - SDP
1335956d97fSEmmanuel Vadot              - DCP
1345956d97fSEmmanuel Vadot              - CDP
1355956d97fSEmmanuel Vadot              - ACA
1365956d97fSEmmanuel Vadot              - FAST-CHARGER
1375956d97fSEmmanuel Vadot              - SLOW-CHARGER
1385956d97fSEmmanuel Vadot              - WPT
1395956d97fSEmmanuel Vadot              - PD
1405956d97fSEmmanuel Vadot              - DOCK
1415956d97fSEmmanuel Vadot              - JIG
1425956d97fSEmmanuel Vadot              - MECHANICAL
1435956d97fSEmmanuel Vadot
1445956d97fSEmmanuel Vadot          cm-cable-extcon:
1455956d97fSEmmanuel Vadot            description: name of extcon dev
1465956d97fSEmmanuel Vadot            $ref: /schemas/types.yaml#/definitions/string
1475956d97fSEmmanuel Vadot
1485956d97fSEmmanuel Vadot          cm-cable-min:
1495956d97fSEmmanuel Vadot            description: minimum current of cable in uA
1505956d97fSEmmanuel Vadot            $ref: /schemas/types.yaml#/definitions/uint32
1515956d97fSEmmanuel Vadot
1525956d97fSEmmanuel Vadot          cm-cable-max:
1535956d97fSEmmanuel Vadot            description: maximum current of cable in uA
1545956d97fSEmmanuel Vadot            $ref: /schemas/types.yaml#/definitions/uint32
1555956d97fSEmmanuel Vadot
1565956d97fSEmmanuel Vadot        required:
1575956d97fSEmmanuel Vadot          - cm-cable-name
1585956d97fSEmmanuel Vadot          - cm-cable-extcon
1595956d97fSEmmanuel Vadot
1605956d97fSEmmanuel Vadot        additionalProperties: false
1615956d97fSEmmanuel Vadot
1625956d97fSEmmanuel Vadotrequired:
1635956d97fSEmmanuel Vadot  - compatible
1645956d97fSEmmanuel Vadot  - cm-chargers
1655956d97fSEmmanuel Vadot  - cm-fuel-gauge
1665956d97fSEmmanuel Vadot
1675956d97fSEmmanuel VadotadditionalProperties: false
1685956d97fSEmmanuel Vadot
1695956d97fSEmmanuel Vadotexamples:
1705956d97fSEmmanuel Vadot  - |
1715956d97fSEmmanuel Vadot    charger-manager {
1725956d97fSEmmanuel Vadot        compatible = "charger-manager";
1735956d97fSEmmanuel Vadot        chg-reg-supply = <&charger_regulator>;
1745956d97fSEmmanuel Vadot
1755956d97fSEmmanuel Vadot        cm-name = "battery";
1765956d97fSEmmanuel Vadot        /* Always polling ON : 30s */
1775956d97fSEmmanuel Vadot        cm-poll-mode = <1>;
1785956d97fSEmmanuel Vadot        cm-poll-interval = <30000>;
1795956d97fSEmmanuel Vadot
1805956d97fSEmmanuel Vadot        cm-fullbatt-vchkdrop-volt = <150000>;
1815956d97fSEmmanuel Vadot        cm-fullbatt-soc = <100>;
1825956d97fSEmmanuel Vadot
1835956d97fSEmmanuel Vadot        cm-battery-stat = <3>;
1845956d97fSEmmanuel Vadot
1855956d97fSEmmanuel Vadot        cm-chargers = "charger0", "charger1", "charger2";
1865956d97fSEmmanuel Vadot
1875956d97fSEmmanuel Vadot        cm-fuel-gauge = "fuelgauge0";
1885956d97fSEmmanuel Vadot
1895956d97fSEmmanuel Vadot        cm-thermal-zone = "thermal_zone.1";
1905956d97fSEmmanuel Vadot        /* in deci centigrade */
1915956d97fSEmmanuel Vadot        cm-battery-cold = <50>;
1925956d97fSEmmanuel Vadot        cm-battery-cold-in-minus;
1935956d97fSEmmanuel Vadot        cm-battery-hot = <800>;
1945956d97fSEmmanuel Vadot        cm-battery-temp-diff = <100>;
1955956d97fSEmmanuel Vadot
1965956d97fSEmmanuel Vadot        /* Allow charging for 5hr */
1975956d97fSEmmanuel Vadot        cm-charging-max = <18000000>;
1985956d97fSEmmanuel Vadot        /* Allow discharging for 2hr */
1995956d97fSEmmanuel Vadot        cm-discharging-max = <7200000>;
2005956d97fSEmmanuel Vadot
2015956d97fSEmmanuel Vadot        regulator-0 {
2025956d97fSEmmanuel Vadot            cm-regulator-name = "chg-reg";
2035956d97fSEmmanuel Vadot            cable-0 {
2045956d97fSEmmanuel Vadot                cm-cable-name = "USB";
2055956d97fSEmmanuel Vadot                cm-cable-extcon = "extcon-dev.0";
2065956d97fSEmmanuel Vadot                cm-cable-min = <475000>;
2075956d97fSEmmanuel Vadot                cm-cable-max = <500000>;
2085956d97fSEmmanuel Vadot            };
2095956d97fSEmmanuel Vadot            cable-1 {
2105956d97fSEmmanuel Vadot                cm-cable-name = "SDP";
2115956d97fSEmmanuel Vadot                cm-cable-extcon = "extcon-dev.0";
2125956d97fSEmmanuel Vadot                cm-cable-min = <650000>;
2135956d97fSEmmanuel Vadot                cm-cable-max = <675000>;
2145956d97fSEmmanuel Vadot            };
2155956d97fSEmmanuel Vadot        };
2165956d97fSEmmanuel Vadot    };
217