xref: /openbmc/linux/Documentation/devicetree/bindings/power/supply/qcom,pm8941-charger.yaml (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
11a4d86b4SSebastian Reichel# SPDX-License-Identifier: GPL-2.0
21a4d86b4SSebastian Reichel%YAML 1.2
31a4d86b4SSebastian Reichel---
41a4d86b4SSebastian Reichel$id: http://devicetree.org/schemas/power/supply/qcom,pm8941-charger.yaml#
51a4d86b4SSebastian Reichel$schema: http://devicetree.org/meta-schemas/core.yaml#
61a4d86b4SSebastian Reichel
71a4d86b4SSebastian Reicheltitle: Qualcomm Switch-Mode Battery Charger and Boost
81a4d86b4SSebastian Reichel
91a4d86b4SSebastian Reichelmaintainers:
101a4d86b4SSebastian Reichel  - Sebastian Reichel <sre@kernel.org>
111a4d86b4SSebastian Reichel
121a4d86b4SSebastian Reichelproperties:
131a4d86b4SSebastian Reichel  compatible:
14502ce107SLuca Weiss    enum:
15502ce107SLuca Weiss      - qcom,pm8226-charger
16502ce107SLuca Weiss      - qcom,pm8941-charger
171a4d86b4SSebastian Reichel
181a4d86b4SSebastian Reichel  reg:
191a4d86b4SSebastian Reichel    maxItems: 1
201a4d86b4SSebastian Reichel
211a4d86b4SSebastian Reichel  interrupts:
221a4d86b4SSebastian Reichel    items:
231a4d86b4SSebastian Reichel      - description: charge done
241a4d86b4SSebastian Reichel      - description: charge fast mode
251a4d86b4SSebastian Reichel      - description: charge trickle mode
261a4d86b4SSebastian Reichel      - description: battery temperature ok
271a4d86b4SSebastian Reichel      - description: battery present
281a4d86b4SSebastian Reichel      - description: charger disconnected
291a4d86b4SSebastian Reichel      - description: USB-in valid
301a4d86b4SSebastian Reichel      - description: DC-in valid
311a4d86b4SSebastian Reichel
321a4d86b4SSebastian Reichel  interrupt-names:
331a4d86b4SSebastian Reichel    items:
341a4d86b4SSebastian Reichel      - const: chg-done
351a4d86b4SSebastian Reichel      - const: chg-fast
361a4d86b4SSebastian Reichel      - const: chg-trkl
371a4d86b4SSebastian Reichel      - const: bat-temp-ok
381a4d86b4SSebastian Reichel      - const: bat-present
391a4d86b4SSebastian Reichel      - const: chg-gone
401a4d86b4SSebastian Reichel      - const: usb-valid
411a4d86b4SSebastian Reichel      - const: dc-valid
421a4d86b4SSebastian Reichel
431a4d86b4SSebastian Reichel  qcom,fast-charge-current-limit:
441a4d86b4SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/uint32
451a4d86b4SSebastian Reichel    minimum: 100000
461a4d86b4SSebastian Reichel    maximum: 3000000
471a4d86b4SSebastian Reichel    description: Maximum charge current in uA; May be clamped to safety limits; Defaults to 1A
481a4d86b4SSebastian Reichel
491a4d86b4SSebastian Reichel  qcom,fast-charge-low-threshold-voltage:
501a4d86b4SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/uint32
511a4d86b4SSebastian Reichel    minimum: 2100000
521a4d86b4SSebastian Reichel    maximum: 3600000
531a4d86b4SSebastian Reichel    description: |
541a4d86b4SSebastian Reichel      Battery voltage limit in uV above which fast charging may operate; Defaults to 3.2V
551a4d86b4SSebastian Reichel      Below this value linear or switch-mode auto-trickle-charging will operate.
561a4d86b4SSebastian Reichel
571a4d86b4SSebastian Reichel  qcom,fast-charge-high-threshold-voltage:
581a4d86b4SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/uint32
591a4d86b4SSebastian Reichel    minimum: 3240000
601a4d86b4SSebastian Reichel    maximum: 5000000
611a4d86b4SSebastian Reichel    description: |
621a4d86b4SSebastian Reichel      Battery voltage limit in uV below which fast charging may operate; Defaults to 4.2V
631a4d86b4SSebastian Reichel      The fast charger will attempt to charge the battery to this voltage.
641a4d86b4SSebastian Reichel      May be clamped to safety limits.
651a4d86b4SSebastian Reichel
661a4d86b4SSebastian Reichel  qcom,fast-charge-safe-voltage:
671a4d86b4SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/uint32
681a4d86b4SSebastian Reichel    minimum: 3240000
691a4d86b4SSebastian Reichel    maximum: 5000000
701a4d86b4SSebastian Reichel    description: |
711a4d86b4SSebastian Reichel      Maximum safe battery voltage in uV; May be pre-set by bootloader, in which case,
721a4d86b4SSebastian Reichel      setting this will harmlessly fail. The property 'fast-charge-high-watermark' will
731a4d86b4SSebastian Reichel      be clamped by this value. Defaults to 4.2V.
741a4d86b4SSebastian Reichel
751a4d86b4SSebastian Reichel  qcom,fast-charge-safe-current:
761a4d86b4SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/uint32
771a4d86b4SSebastian Reichel    minimum: 100000
781a4d86b4SSebastian Reichel    maximum: 3000000
791a4d86b4SSebastian Reichel    description: |
801a4d86b4SSebastian Reichel      Maximum safe battery charge current in uA; May pre-set by bootloader, in which case,
811a4d86b4SSebastian Reichel      setting this will harmlessly fail. The property 'qcom,fast-charge-current-limit'
821a4d86b4SSebastian Reichel      will be clamped by this value. Defaults to 1A.
831a4d86b4SSebastian Reichel
841a4d86b4SSebastian Reichel  qcom,auto-recharge-threshold-voltage:
851a4d86b4SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/uint32
861a4d86b4SSebastian Reichel    minimum: 3240000
871a4d86b4SSebastian Reichel    maximum: 5000000
881a4d86b4SSebastian Reichel    description: |
891a4d86b4SSebastian Reichel      Battery voltage limit in uV below which auto-recharge functionality will restart charging
901a4d86b4SSebastian Reichel      after end-of-charge; The high cutoff limit for auto-recharge is 5% above this value.
911a4d86b4SSebastian Reichel      Defaults to 4.1V.
921a4d86b4SSebastian Reichel
931a4d86b4SSebastian Reichel  qcom,minimum-input-voltage:
941a4d86b4SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/uint32
951a4d86b4SSebastian Reichel    minimum: 4200000
961a4d86b4SSebastian Reichel    maximum: 9600000
971a4d86b4SSebastian Reichel    description: |
981a4d86b4SSebastian Reichel      Input voltage level in uV above which charging may operate. Defaults to 4.3V.
991a4d86b4SSebastian Reichel
1001a4d86b4SSebastian Reichel  qcom,dc-current-limit:
1011a4d86b4SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/uint32
1021a4d86b4SSebastian Reichel    minimum: 100000
1031a4d86b4SSebastian Reichel    maximum: 2500000
1041a4d86b4SSebastian Reichel    description: |
1051a4d86b4SSebastian Reichel      Default DC charge current limit in uA. Defaults to 100mA.
1061a4d86b4SSebastian Reichel
1071a4d86b4SSebastian Reichel  qcom,disable-dc:
1081a4d86b4SSebastian Reichel    type: boolean
1091a4d86b4SSebastian Reichel    description: Disable DC charger
1101a4d86b4SSebastian Reichel
1111a4d86b4SSebastian Reichel  qcom,jeita-extended-temp-range:
1121a4d86b4SSebastian Reichel    type: boolean
1131a4d86b4SSebastian Reichel    description: |
1141a4d86b4SSebastian Reichel      Enable JEITA extended temperature range;  This does *not* adjust the maximum charge
1151a4d86b4SSebastian Reichel      voltage or current in the extended temperature range. It only allows charging when
1161a4d86b4SSebastian Reichel      the battery is in the extended temperature range. Voltage/current regulation must
1171a4d86b4SSebastian Reichel      be done externally to fully comply with the JEITA safety guidelines if this flag
1181a4d86b4SSebastian Reichel      is set.
1191a4d86b4SSebastian Reichel
120*096a6223SKrzysztof Kozlowski  usb-charge-current-limit:
121*096a6223SKrzysztof Kozlowski    $ref: /schemas/types.yaml#/definitions/uint32
122*096a6223SKrzysztof Kozlowski    minimum: 100000
123*096a6223SKrzysztof Kozlowski    maximum: 2500000
124*096a6223SKrzysztof Kozlowski    description: |
125*096a6223SKrzysztof Kozlowski      Default USB charge current limit in uA.
126*096a6223SKrzysztof Kozlowski
1271a4d86b4SSebastian Reichel  usb-otg-in-supply:
1281a4d86b4SSebastian Reichel    description: Reference to the regulator supplying power to the USB_OTG_IN pin.
1291a4d86b4SSebastian Reichel
1301a4d86b4SSebastian Reichel  otg-vbus:
1312441ca62SKrzysztof Kozlowski    $ref: /schemas/regulator/regulator.yaml#
1321a4d86b4SSebastian Reichel    description: |
1331a4d86b4SSebastian Reichel      This node defines a regulator used to control the direction of VBUS voltage.
1341a4d86b4SSebastian Reichel      Specifically whether to supply voltage to VBUS for host mode operation of the OTG port,
1351a4d86b4SSebastian Reichel      or allow input voltage from external VBUS for charging. In the hardware, the supply for
1361a4d86b4SSebastian Reichel      this regulator comes from usb_otg_in-supply.
1371a4d86b4SSebastian Reichel
1381a4d86b4SSebastian Reichelrequired:
1391a4d86b4SSebastian Reichel  - compatible
1401a4d86b4SSebastian Reichel  - reg
1411a4d86b4SSebastian Reichel  - interrupts
1421a4d86b4SSebastian Reichel  - interrupt-names
1431a4d86b4SSebastian Reichel
1441a4d86b4SSebastian ReicheladditionalProperties: false
1451a4d86b4SSebastian Reichel
1461a4d86b4SSebastian Reichelexamples:
1471a4d86b4SSebastian Reichel  - |
1481a4d86b4SSebastian Reichel    #include <dt-bindings/interrupt-controller/irq.h>
1491a4d86b4SSebastian Reichel    pmic {
1501a4d86b4SSebastian Reichel      #address-cells = <1>;
1511a4d86b4SSebastian Reichel      #size-cells = <0>;
1521a4d86b4SSebastian Reichel
1531a4d86b4SSebastian Reichel      charger@1000 {
1541a4d86b4SSebastian Reichel        compatible = "qcom,pm8941-charger";
1551a4d86b4SSebastian Reichel        reg = <0x1000>;
1561a4d86b4SSebastian Reichel        interrupts = <0x0 0x10 7 IRQ_TYPE_EDGE_BOTH>,
1571a4d86b4SSebastian Reichel                     <0x0 0x10 5 IRQ_TYPE_EDGE_BOTH>,
1581a4d86b4SSebastian Reichel                     <0x0 0x10 4 IRQ_TYPE_EDGE_BOTH>,
1591a4d86b4SSebastian Reichel                     <0x0 0x12 1 IRQ_TYPE_EDGE_BOTH>,
1601a4d86b4SSebastian Reichel                     <0x0 0x12 0 IRQ_TYPE_EDGE_BOTH>,
1611a4d86b4SSebastian Reichel                     <0x0 0x13 2 IRQ_TYPE_EDGE_BOTH>,
1621a4d86b4SSebastian Reichel                     <0x0 0x13 1 IRQ_TYPE_EDGE_BOTH>,
1631a4d86b4SSebastian Reichel                     <0x0 0x14 1 IRQ_TYPE_EDGE_BOTH>;
1641a4d86b4SSebastian Reichel        interrupt-names = "chg-done",
1651a4d86b4SSebastian Reichel                          "chg-fast",
1661a4d86b4SSebastian Reichel                          "chg-trkl",
1671a4d86b4SSebastian Reichel                          "bat-temp-ok",
1681a4d86b4SSebastian Reichel                          "bat-present",
1691a4d86b4SSebastian Reichel                          "chg-gone",
1701a4d86b4SSebastian Reichel                          "usb-valid",
1711a4d86b4SSebastian Reichel                          "dc-valid";
1721a4d86b4SSebastian Reichel        qcom,fast-charge-current-limit = <1000000>;
1731a4d86b4SSebastian Reichel        qcom,dc-current-limit = <1000000>;
1741a4d86b4SSebastian Reichel        usb-otg-in-supply = <&pm8941_5vs1>;
1751a4d86b4SSebastian Reichel
1761a4d86b4SSebastian Reichel        otg-vbus {};
1771a4d86b4SSebastian Reichel      };
1781a4d86b4SSebastian Reichel    };
179