xref: /freebsd/sys/contrib/device-tree/Bindings/power/supply/charger-manager.yaml (revision b97ee269eae3cbaf35c18f51a459aea581c2a7dc)
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
39d5b0e70fSEmmanuel 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
53*b97ee269SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
545956d97fSEmmanuel Vadot    enum:
555956d97fSEmmanuel Vadot      - 0 # battery always present
565956d97fSEmmanuel Vadot      - 1 # no battery
575956d97fSEmmanuel Vadot      - 2 # check presence via fuel gauge
585956d97fSEmmanuel Vadot      - 3 # check presence via charger
595956d97fSEmmanuel Vadot
605956d97fSEmmanuel Vadot  cm-fullbatt-vchkdrop-volt:
615956d97fSEmmanuel Vadot    description: voltage drop before restarting charging in uV
625956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
635956d97fSEmmanuel Vadot
645956d97fSEmmanuel Vadot  cm-fullbatt-vchkdrop-ms:
655956d97fSEmmanuel Vadot    deprecated: true
665956d97fSEmmanuel Vadot
675956d97fSEmmanuel Vadot  cm-fullbatt-voltage:
685956d97fSEmmanuel Vadot    description: voltage of full battery in uV
695956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
705956d97fSEmmanuel Vadot
715956d97fSEmmanuel Vadot  cm-fullbatt-soc:
725956d97fSEmmanuel Vadot    description: state of charge to consider as full battery in %
735956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
745956d97fSEmmanuel Vadot
755956d97fSEmmanuel Vadot  cm-fullbatt-capacity:
765956d97fSEmmanuel Vadot    description: capcity to consider as full battery in uAh
775956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
785956d97fSEmmanuel Vadot
795956d97fSEmmanuel Vadot  cm-thermal-zone:
805956d97fSEmmanuel Vadot    description: name of external thermometer's thermal zone
815956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/string
825956d97fSEmmanuel Vadot
835956d97fSEmmanuel Vadot  cm-discharging-max:
845956d97fSEmmanuel Vadot    description: limits of discharging duration in ms
855956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
865956d97fSEmmanuel Vadot
875956d97fSEmmanuel Vadot  cm-charging-max:
885956d97fSEmmanuel Vadot    description: limits of charging duration in ms
895956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
905956d97fSEmmanuel Vadot
915956d97fSEmmanuel Vadot  cm-battery-cold:
925956d97fSEmmanuel Vadot    description: critical cold temperature of battery for charging in deci-degree celsius
935956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
945956d97fSEmmanuel Vadot
955956d97fSEmmanuel Vadot  cm-battery-cold-in-minus:
965956d97fSEmmanuel Vadot    description: if set cm-battery-cold temperature is in minus degrees
975956d97fSEmmanuel Vadot    type: boolean
985956d97fSEmmanuel Vadot
995956d97fSEmmanuel Vadot  cm-battery-hot:
1005956d97fSEmmanuel Vadot    description: critical hot temperature of battery for charging in deci-degree celsius
1015956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
1025956d97fSEmmanuel Vadot
1035956d97fSEmmanuel Vadot  cm-battery-temp-diff:
1045956d97fSEmmanuel Vadot    description: temperature difference to allow recharging in deci-degree celsius
1055956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
1065956d97fSEmmanuel Vadot
1075956d97fSEmmanuel VadotpatternProperties:
1085956d97fSEmmanuel Vadot  "-supply$":
1095956d97fSEmmanuel Vadot    description: regulator consumer, named according to cm-regulator-name
1105956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/phandle
1115956d97fSEmmanuel Vadot
1125956d97fSEmmanuel Vadot  "^regulator[@-][0-9]$":
1135956d97fSEmmanuel Vadot    type: object
1145956d97fSEmmanuel Vadot    properties:
1155956d97fSEmmanuel Vadot      cm-regulator-name:
1165956d97fSEmmanuel Vadot        description: name of charger regulator
1175956d97fSEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/string
1185956d97fSEmmanuel Vadot
1195956d97fSEmmanuel Vadot    required:
1205956d97fSEmmanuel Vadot      - cm-regulator-name
1215956d97fSEmmanuel Vadot
1225956d97fSEmmanuel Vadot    additionalProperties: false
1235956d97fSEmmanuel Vadot
1245956d97fSEmmanuel Vadot    patternProperties:
1255956d97fSEmmanuel Vadot      "^cable[@-][0-9]$":
1265956d97fSEmmanuel Vadot        type: object
1275956d97fSEmmanuel Vadot        properties:
1285956d97fSEmmanuel Vadot          cm-cable-name:
1295956d97fSEmmanuel Vadot            description: name of charger cable
1305956d97fSEmmanuel Vadot            enum:
1315956d97fSEmmanuel Vadot              - USB
1325956d97fSEmmanuel Vadot              - USB-HOST
1335956d97fSEmmanuel Vadot              - SDP
1345956d97fSEmmanuel Vadot              - DCP
1355956d97fSEmmanuel Vadot              - CDP
1365956d97fSEmmanuel Vadot              - ACA
1375956d97fSEmmanuel Vadot              - FAST-CHARGER
1385956d97fSEmmanuel Vadot              - SLOW-CHARGER
1395956d97fSEmmanuel Vadot              - WPT
1405956d97fSEmmanuel Vadot              - PD
1415956d97fSEmmanuel Vadot              - DOCK
1425956d97fSEmmanuel Vadot              - JIG
1435956d97fSEmmanuel Vadot              - MECHANICAL
1445956d97fSEmmanuel Vadot
1455956d97fSEmmanuel Vadot          cm-cable-extcon:
1465956d97fSEmmanuel Vadot            description: name of extcon dev
1475956d97fSEmmanuel Vadot            $ref: /schemas/types.yaml#/definitions/string
1485956d97fSEmmanuel Vadot
1495956d97fSEmmanuel Vadot          cm-cable-min:
1505956d97fSEmmanuel Vadot            description: minimum current of cable in uA
1515956d97fSEmmanuel Vadot            $ref: /schemas/types.yaml#/definitions/uint32
1525956d97fSEmmanuel Vadot
1535956d97fSEmmanuel Vadot          cm-cable-max:
1545956d97fSEmmanuel Vadot            description: maximum current of cable in uA
1555956d97fSEmmanuel Vadot            $ref: /schemas/types.yaml#/definitions/uint32
1565956d97fSEmmanuel Vadot
1575956d97fSEmmanuel Vadot        required:
1585956d97fSEmmanuel Vadot          - cm-cable-name
1595956d97fSEmmanuel Vadot          - cm-cable-extcon
1605956d97fSEmmanuel Vadot
1615956d97fSEmmanuel Vadot        additionalProperties: false
1625956d97fSEmmanuel Vadot
1635956d97fSEmmanuel Vadotrequired:
1645956d97fSEmmanuel Vadot  - compatible
1655956d97fSEmmanuel Vadot  - cm-chargers
1665956d97fSEmmanuel Vadot  - cm-fuel-gauge
1675956d97fSEmmanuel Vadot
1685956d97fSEmmanuel VadotadditionalProperties: false
1695956d97fSEmmanuel Vadot
1705956d97fSEmmanuel Vadotexamples:
1715956d97fSEmmanuel Vadot  - |
1725956d97fSEmmanuel Vadot    charger-manager {
1735956d97fSEmmanuel Vadot        compatible = "charger-manager";
1745956d97fSEmmanuel Vadot        chg-reg-supply = <&charger_regulator>;
1755956d97fSEmmanuel Vadot
1765956d97fSEmmanuel Vadot        cm-name = "battery";
1775956d97fSEmmanuel Vadot        /* Always polling ON : 30s */
1785956d97fSEmmanuel Vadot        cm-poll-mode = <1>;
1795956d97fSEmmanuel Vadot        cm-poll-interval = <30000>;
1805956d97fSEmmanuel Vadot
1815956d97fSEmmanuel Vadot        cm-fullbatt-vchkdrop-volt = <150000>;
1825956d97fSEmmanuel Vadot        cm-fullbatt-soc = <100>;
1835956d97fSEmmanuel Vadot
1845956d97fSEmmanuel Vadot        cm-battery-stat = <3>;
1855956d97fSEmmanuel Vadot
1865956d97fSEmmanuel Vadot        cm-chargers = "charger0", "charger1", "charger2";
1875956d97fSEmmanuel Vadot
1885956d97fSEmmanuel Vadot        cm-fuel-gauge = "fuelgauge0";
1895956d97fSEmmanuel Vadot
1905956d97fSEmmanuel Vadot        cm-thermal-zone = "thermal_zone.1";
1915956d97fSEmmanuel Vadot        /* in deci centigrade */
1925956d97fSEmmanuel Vadot        cm-battery-cold = <50>;
1935956d97fSEmmanuel Vadot        cm-battery-cold-in-minus;
1945956d97fSEmmanuel Vadot        cm-battery-hot = <800>;
1955956d97fSEmmanuel Vadot        cm-battery-temp-diff = <100>;
1965956d97fSEmmanuel Vadot
1975956d97fSEmmanuel Vadot        /* Allow charging for 5hr */
1985956d97fSEmmanuel Vadot        cm-charging-max = <18000000>;
1995956d97fSEmmanuel Vadot        /* Allow discharging for 2hr */
2005956d97fSEmmanuel Vadot        cm-discharging-max = <7200000>;
2015956d97fSEmmanuel Vadot
2025956d97fSEmmanuel Vadot        regulator-0 {
2035956d97fSEmmanuel Vadot            cm-regulator-name = "chg-reg";
2045956d97fSEmmanuel Vadot            cable-0 {
2055956d97fSEmmanuel Vadot                cm-cable-name = "USB";
2065956d97fSEmmanuel Vadot                cm-cable-extcon = "extcon-dev.0";
2075956d97fSEmmanuel Vadot                cm-cable-min = <475000>;
2085956d97fSEmmanuel Vadot                cm-cable-max = <500000>;
2095956d97fSEmmanuel Vadot            };
2105956d97fSEmmanuel Vadot            cable-1 {
2115956d97fSEmmanuel Vadot                cm-cable-name = "SDP";
2125956d97fSEmmanuel Vadot                cm-cable-extcon = "extcon-dev.0";
2135956d97fSEmmanuel Vadot                cm-cable-min = <650000>;
2145956d97fSEmmanuel Vadot                cm-cable-max = <675000>;
2155956d97fSEmmanuel Vadot            };
2165956d97fSEmmanuel Vadot        };
2175956d97fSEmmanuel Vadot    };
218