12eb4d8dcSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0 22eb4d8dcSEmmanuel Vadot%YAML 1.2 32eb4d8dcSEmmanuel Vadot--- 42eb4d8dcSEmmanuel Vadot$id: http://devicetree.org/schemas/power/supply/qcom,pm8941-charger.yaml# 52eb4d8dcSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 62eb4d8dcSEmmanuel Vadot 72eb4d8dcSEmmanuel Vadottitle: Qualcomm Switch-Mode Battery Charger and Boost 82eb4d8dcSEmmanuel Vadot 92eb4d8dcSEmmanuel Vadotmaintainers: 102eb4d8dcSEmmanuel Vadot - Sebastian Reichel <sre@kernel.org> 112eb4d8dcSEmmanuel Vadot 122eb4d8dcSEmmanuel Vadotproperties: 132eb4d8dcSEmmanuel Vadot compatible: 14e67e8565SEmmanuel Vadot enum: 15e67e8565SEmmanuel Vadot - qcom,pm8226-charger 16e67e8565SEmmanuel Vadot - qcom,pm8941-charger 172eb4d8dcSEmmanuel Vadot 182eb4d8dcSEmmanuel Vadot reg: 192eb4d8dcSEmmanuel Vadot maxItems: 1 202eb4d8dcSEmmanuel Vadot 212eb4d8dcSEmmanuel Vadot interrupts: 222eb4d8dcSEmmanuel Vadot items: 232eb4d8dcSEmmanuel Vadot - description: charge done 242eb4d8dcSEmmanuel Vadot - description: charge fast mode 252eb4d8dcSEmmanuel Vadot - description: charge trickle mode 262eb4d8dcSEmmanuel Vadot - description: battery temperature ok 272eb4d8dcSEmmanuel Vadot - description: battery present 282eb4d8dcSEmmanuel Vadot - description: charger disconnected 292eb4d8dcSEmmanuel Vadot - description: USB-in valid 302eb4d8dcSEmmanuel Vadot - description: DC-in valid 312eb4d8dcSEmmanuel Vadot 322eb4d8dcSEmmanuel Vadot interrupt-names: 332eb4d8dcSEmmanuel Vadot items: 342eb4d8dcSEmmanuel Vadot - const: chg-done 352eb4d8dcSEmmanuel Vadot - const: chg-fast 362eb4d8dcSEmmanuel Vadot - const: chg-trkl 372eb4d8dcSEmmanuel Vadot - const: bat-temp-ok 382eb4d8dcSEmmanuel Vadot - const: bat-present 392eb4d8dcSEmmanuel Vadot - const: chg-gone 402eb4d8dcSEmmanuel Vadot - const: usb-valid 412eb4d8dcSEmmanuel Vadot - const: dc-valid 422eb4d8dcSEmmanuel Vadot 432eb4d8dcSEmmanuel Vadot qcom,fast-charge-current-limit: 442eb4d8dcSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 452eb4d8dcSEmmanuel Vadot minimum: 100000 462eb4d8dcSEmmanuel Vadot maximum: 3000000 472eb4d8dcSEmmanuel Vadot description: Maximum charge current in uA; May be clamped to safety limits; Defaults to 1A 482eb4d8dcSEmmanuel Vadot 492eb4d8dcSEmmanuel Vadot qcom,fast-charge-low-threshold-voltage: 502eb4d8dcSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 512eb4d8dcSEmmanuel Vadot minimum: 2100000 522eb4d8dcSEmmanuel Vadot maximum: 3600000 532eb4d8dcSEmmanuel Vadot description: | 542eb4d8dcSEmmanuel Vadot Battery voltage limit in uV above which fast charging may operate; Defaults to 3.2V 552eb4d8dcSEmmanuel Vadot Below this value linear or switch-mode auto-trickle-charging will operate. 562eb4d8dcSEmmanuel Vadot 572eb4d8dcSEmmanuel Vadot qcom,fast-charge-high-threshold-voltage: 582eb4d8dcSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 592eb4d8dcSEmmanuel Vadot minimum: 3240000 602eb4d8dcSEmmanuel Vadot maximum: 5000000 612eb4d8dcSEmmanuel Vadot description: | 622eb4d8dcSEmmanuel Vadot Battery voltage limit in uV below which fast charging may operate; Defaults to 4.2V 632eb4d8dcSEmmanuel Vadot The fast charger will attempt to charge the battery to this voltage. 642eb4d8dcSEmmanuel Vadot May be clamped to safety limits. 652eb4d8dcSEmmanuel Vadot 662eb4d8dcSEmmanuel Vadot qcom,fast-charge-safe-voltage: 672eb4d8dcSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 682eb4d8dcSEmmanuel Vadot minimum: 3240000 692eb4d8dcSEmmanuel Vadot maximum: 5000000 702eb4d8dcSEmmanuel Vadot description: | 712eb4d8dcSEmmanuel Vadot Maximum safe battery voltage in uV; May be pre-set by bootloader, in which case, 722eb4d8dcSEmmanuel Vadot setting this will harmlessly fail. The property 'fast-charge-high-watermark' will 732eb4d8dcSEmmanuel Vadot be clamped by this value. Defaults to 4.2V. 742eb4d8dcSEmmanuel Vadot 752eb4d8dcSEmmanuel Vadot qcom,fast-charge-safe-current: 762eb4d8dcSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 772eb4d8dcSEmmanuel Vadot minimum: 100000 782eb4d8dcSEmmanuel Vadot maximum: 3000000 792eb4d8dcSEmmanuel Vadot description: | 802eb4d8dcSEmmanuel Vadot Maximum safe battery charge current in uA; May pre-set by bootloader, in which case, 812eb4d8dcSEmmanuel Vadot setting this will harmlessly fail. The property 'qcom,fast-charge-current-limit' 822eb4d8dcSEmmanuel Vadot will be clamped by this value. Defaults to 1A. 832eb4d8dcSEmmanuel Vadot 842eb4d8dcSEmmanuel Vadot qcom,auto-recharge-threshold-voltage: 852eb4d8dcSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 862eb4d8dcSEmmanuel Vadot minimum: 3240000 872eb4d8dcSEmmanuel Vadot maximum: 5000000 882eb4d8dcSEmmanuel Vadot description: | 892eb4d8dcSEmmanuel Vadot Battery voltage limit in uV below which auto-recharge functionality will restart charging 902eb4d8dcSEmmanuel Vadot after end-of-charge; The high cutoff limit for auto-recharge is 5% above this value. 912eb4d8dcSEmmanuel Vadot Defaults to 4.1V. 922eb4d8dcSEmmanuel Vadot 932eb4d8dcSEmmanuel Vadot qcom,minimum-input-voltage: 942eb4d8dcSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 952eb4d8dcSEmmanuel Vadot minimum: 4200000 962eb4d8dcSEmmanuel Vadot maximum: 9600000 972eb4d8dcSEmmanuel Vadot description: | 982eb4d8dcSEmmanuel Vadot Input voltage level in uV above which charging may operate. Defaults to 4.3V. 992eb4d8dcSEmmanuel Vadot 1002eb4d8dcSEmmanuel Vadot qcom,dc-current-limit: 1012eb4d8dcSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 1022eb4d8dcSEmmanuel Vadot minimum: 100000 1032eb4d8dcSEmmanuel Vadot maximum: 2500000 1042eb4d8dcSEmmanuel Vadot description: | 1052eb4d8dcSEmmanuel Vadot Default DC charge current limit in uA. Defaults to 100mA. 1062eb4d8dcSEmmanuel Vadot 1072eb4d8dcSEmmanuel Vadot qcom,disable-dc: 1082eb4d8dcSEmmanuel Vadot type: boolean 1092eb4d8dcSEmmanuel Vadot description: Disable DC charger 1102eb4d8dcSEmmanuel Vadot 1112eb4d8dcSEmmanuel Vadot qcom,jeita-extended-temp-range: 1122eb4d8dcSEmmanuel Vadot type: boolean 1132eb4d8dcSEmmanuel Vadot description: | 1142eb4d8dcSEmmanuel Vadot Enable JEITA extended temperature range; This does *not* adjust the maximum charge 1152eb4d8dcSEmmanuel Vadot voltage or current in the extended temperature range. It only allows charging when 1162eb4d8dcSEmmanuel Vadot the battery is in the extended temperature range. Voltage/current regulation must 1172eb4d8dcSEmmanuel Vadot be done externally to fully comply with the JEITA safety guidelines if this flag 1182eb4d8dcSEmmanuel Vadot is set. 1192eb4d8dcSEmmanuel Vadot 120*b97ee269SEmmanuel Vadot usb-charge-current-limit: 121*b97ee269SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 122*b97ee269SEmmanuel Vadot minimum: 100000 123*b97ee269SEmmanuel Vadot maximum: 2500000 124*b97ee269SEmmanuel Vadot description: | 125*b97ee269SEmmanuel Vadot Default USB charge current limit in uA. 126*b97ee269SEmmanuel Vadot 1272eb4d8dcSEmmanuel Vadot usb-otg-in-supply: 1282eb4d8dcSEmmanuel Vadot description: Reference to the regulator supplying power to the USB_OTG_IN pin. 1292eb4d8dcSEmmanuel Vadot 1302eb4d8dcSEmmanuel Vadot otg-vbus: 131*b97ee269SEmmanuel Vadot $ref: /schemas/regulator/regulator.yaml# 1322eb4d8dcSEmmanuel Vadot description: | 1332eb4d8dcSEmmanuel Vadot This node defines a regulator used to control the direction of VBUS voltage. 1342eb4d8dcSEmmanuel Vadot Specifically whether to supply voltage to VBUS for host mode operation of the OTG port, 1352eb4d8dcSEmmanuel Vadot or allow input voltage from external VBUS for charging. In the hardware, the supply for 1362eb4d8dcSEmmanuel Vadot this regulator comes from usb_otg_in-supply. 1372eb4d8dcSEmmanuel Vadot 1382eb4d8dcSEmmanuel Vadotrequired: 1392eb4d8dcSEmmanuel Vadot - compatible 1402eb4d8dcSEmmanuel Vadot - reg 1412eb4d8dcSEmmanuel Vadot - interrupts 1422eb4d8dcSEmmanuel Vadot - interrupt-names 1432eb4d8dcSEmmanuel Vadot 1442eb4d8dcSEmmanuel VadotadditionalProperties: false 1452eb4d8dcSEmmanuel Vadot 1462eb4d8dcSEmmanuel Vadotexamples: 1472eb4d8dcSEmmanuel Vadot - | 1482eb4d8dcSEmmanuel Vadot #include <dt-bindings/interrupt-controller/irq.h> 1492eb4d8dcSEmmanuel Vadot pmic { 1502eb4d8dcSEmmanuel Vadot #address-cells = <1>; 1512eb4d8dcSEmmanuel Vadot #size-cells = <0>; 1522eb4d8dcSEmmanuel Vadot 1532eb4d8dcSEmmanuel Vadot charger@1000 { 1542eb4d8dcSEmmanuel Vadot compatible = "qcom,pm8941-charger"; 1552eb4d8dcSEmmanuel Vadot reg = <0x1000>; 1562eb4d8dcSEmmanuel Vadot interrupts = <0x0 0x10 7 IRQ_TYPE_EDGE_BOTH>, 1572eb4d8dcSEmmanuel Vadot <0x0 0x10 5 IRQ_TYPE_EDGE_BOTH>, 1582eb4d8dcSEmmanuel Vadot <0x0 0x10 4 IRQ_TYPE_EDGE_BOTH>, 1592eb4d8dcSEmmanuel Vadot <0x0 0x12 1 IRQ_TYPE_EDGE_BOTH>, 1602eb4d8dcSEmmanuel Vadot <0x0 0x12 0 IRQ_TYPE_EDGE_BOTH>, 1612eb4d8dcSEmmanuel Vadot <0x0 0x13 2 IRQ_TYPE_EDGE_BOTH>, 1622eb4d8dcSEmmanuel Vadot <0x0 0x13 1 IRQ_TYPE_EDGE_BOTH>, 1632eb4d8dcSEmmanuel Vadot <0x0 0x14 1 IRQ_TYPE_EDGE_BOTH>; 1642eb4d8dcSEmmanuel Vadot interrupt-names = "chg-done", 1652eb4d8dcSEmmanuel Vadot "chg-fast", 1662eb4d8dcSEmmanuel Vadot "chg-trkl", 1672eb4d8dcSEmmanuel Vadot "bat-temp-ok", 1682eb4d8dcSEmmanuel Vadot "bat-present", 1692eb4d8dcSEmmanuel Vadot "chg-gone", 1702eb4d8dcSEmmanuel Vadot "usb-valid", 1712eb4d8dcSEmmanuel Vadot "dc-valid"; 1722eb4d8dcSEmmanuel Vadot qcom,fast-charge-current-limit = <1000000>; 1732eb4d8dcSEmmanuel Vadot qcom,dc-current-limit = <1000000>; 1742eb4d8dcSEmmanuel Vadot usb-otg-in-supply = <&pm8941_5vs1>; 1752eb4d8dcSEmmanuel Vadot 1762eb4d8dcSEmmanuel Vadot otg-vbus {}; 1772eb4d8dcSEmmanuel Vadot }; 1782eb4d8dcSEmmanuel Vadot }; 179