162306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ci%YAML 1.2
362306a36Sopenharmony_ci---
462306a36Sopenharmony_ci$id: http://devicetree.org/schemas/power/supply/qcom,pm8941-charger.yaml#
562306a36Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml#
662306a36Sopenharmony_ci
762306a36Sopenharmony_cititle: Qualcomm Switch-Mode Battery Charger and Boost
862306a36Sopenharmony_ci
962306a36Sopenharmony_cimaintainers:
1062306a36Sopenharmony_ci  - Sebastian Reichel <sre@kernel.org>
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ciproperties:
1362306a36Sopenharmony_ci  compatible:
1462306a36Sopenharmony_ci    enum:
1562306a36Sopenharmony_ci      - qcom,pm8226-charger
1662306a36Sopenharmony_ci      - qcom,pm8941-charger
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci  reg:
1962306a36Sopenharmony_ci    maxItems: 1
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ci  interrupts:
2262306a36Sopenharmony_ci    items:
2362306a36Sopenharmony_ci      - description: charge done
2462306a36Sopenharmony_ci      - description: charge fast mode
2562306a36Sopenharmony_ci      - description: charge trickle mode
2662306a36Sopenharmony_ci      - description: battery temperature ok
2762306a36Sopenharmony_ci      - description: battery present
2862306a36Sopenharmony_ci      - description: charger disconnected
2962306a36Sopenharmony_ci      - description: USB-in valid
3062306a36Sopenharmony_ci      - description: DC-in valid
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_ci  interrupt-names:
3362306a36Sopenharmony_ci    items:
3462306a36Sopenharmony_ci      - const: chg-done
3562306a36Sopenharmony_ci      - const: chg-fast
3662306a36Sopenharmony_ci      - const: chg-trkl
3762306a36Sopenharmony_ci      - const: bat-temp-ok
3862306a36Sopenharmony_ci      - const: bat-present
3962306a36Sopenharmony_ci      - const: chg-gone
4062306a36Sopenharmony_ci      - const: usb-valid
4162306a36Sopenharmony_ci      - const: dc-valid
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ci  qcom,fast-charge-current-limit:
4462306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
4562306a36Sopenharmony_ci    minimum: 100000
4662306a36Sopenharmony_ci    maximum: 3000000
4762306a36Sopenharmony_ci    description: Maximum charge current in uA; May be clamped to safety limits; Defaults to 1A
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_ci  qcom,fast-charge-low-threshold-voltage:
5062306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
5162306a36Sopenharmony_ci    minimum: 2100000
5262306a36Sopenharmony_ci    maximum: 3600000
5362306a36Sopenharmony_ci    description: |
5462306a36Sopenharmony_ci      Battery voltage limit in uV above which fast charging may operate; Defaults to 3.2V
5562306a36Sopenharmony_ci      Below this value linear or switch-mode auto-trickle-charging will operate.
5662306a36Sopenharmony_ci
5762306a36Sopenharmony_ci  qcom,fast-charge-high-threshold-voltage:
5862306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
5962306a36Sopenharmony_ci    minimum: 3240000
6062306a36Sopenharmony_ci    maximum: 5000000
6162306a36Sopenharmony_ci    description: |
6262306a36Sopenharmony_ci      Battery voltage limit in uV below which fast charging may operate; Defaults to 4.2V
6362306a36Sopenharmony_ci      The fast charger will attempt to charge the battery to this voltage.
6462306a36Sopenharmony_ci      May be clamped to safety limits.
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_ci  qcom,fast-charge-safe-voltage:
6762306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
6862306a36Sopenharmony_ci    minimum: 3240000
6962306a36Sopenharmony_ci    maximum: 5000000
7062306a36Sopenharmony_ci    description: |
7162306a36Sopenharmony_ci      Maximum safe battery voltage in uV; May be pre-set by bootloader, in which case,
7262306a36Sopenharmony_ci      setting this will harmlessly fail. The property 'fast-charge-high-watermark' will
7362306a36Sopenharmony_ci      be clamped by this value. Defaults to 4.2V.
7462306a36Sopenharmony_ci
7562306a36Sopenharmony_ci  qcom,fast-charge-safe-current:
7662306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
7762306a36Sopenharmony_ci    minimum: 100000
7862306a36Sopenharmony_ci    maximum: 3000000
7962306a36Sopenharmony_ci    description: |
8062306a36Sopenharmony_ci      Maximum safe battery charge current in uA; May pre-set by bootloader, in which case,
8162306a36Sopenharmony_ci      setting this will harmlessly fail. The property 'qcom,fast-charge-current-limit'
8262306a36Sopenharmony_ci      will be clamped by this value. Defaults to 1A.
8362306a36Sopenharmony_ci
8462306a36Sopenharmony_ci  qcom,auto-recharge-threshold-voltage:
8562306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
8662306a36Sopenharmony_ci    minimum: 3240000
8762306a36Sopenharmony_ci    maximum: 5000000
8862306a36Sopenharmony_ci    description: |
8962306a36Sopenharmony_ci      Battery voltage limit in uV below which auto-recharge functionality will restart charging
9062306a36Sopenharmony_ci      after end-of-charge; The high cutoff limit for auto-recharge is 5% above this value.
9162306a36Sopenharmony_ci      Defaults to 4.1V.
9262306a36Sopenharmony_ci
9362306a36Sopenharmony_ci  qcom,minimum-input-voltage:
9462306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
9562306a36Sopenharmony_ci    minimum: 4200000
9662306a36Sopenharmony_ci    maximum: 9600000
9762306a36Sopenharmony_ci    description: |
9862306a36Sopenharmony_ci      Input voltage level in uV above which charging may operate. Defaults to 4.3V.
9962306a36Sopenharmony_ci
10062306a36Sopenharmony_ci  qcom,dc-current-limit:
10162306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
10262306a36Sopenharmony_ci    minimum: 100000
10362306a36Sopenharmony_ci    maximum: 2500000
10462306a36Sopenharmony_ci    description: |
10562306a36Sopenharmony_ci      Default DC charge current limit in uA. Defaults to 100mA.
10662306a36Sopenharmony_ci
10762306a36Sopenharmony_ci  qcom,disable-dc:
10862306a36Sopenharmony_ci    type: boolean
10962306a36Sopenharmony_ci    description: Disable DC charger
11062306a36Sopenharmony_ci
11162306a36Sopenharmony_ci  qcom,jeita-extended-temp-range:
11262306a36Sopenharmony_ci    type: boolean
11362306a36Sopenharmony_ci    description: |
11462306a36Sopenharmony_ci      Enable JEITA extended temperature range;  This does *not* adjust the maximum charge
11562306a36Sopenharmony_ci      voltage or current in the extended temperature range. It only allows charging when
11662306a36Sopenharmony_ci      the battery is in the extended temperature range. Voltage/current regulation must
11762306a36Sopenharmony_ci      be done externally to fully comply with the JEITA safety guidelines if this flag
11862306a36Sopenharmony_ci      is set.
11962306a36Sopenharmony_ci
12062306a36Sopenharmony_ci  usb-charge-current-limit:
12162306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
12262306a36Sopenharmony_ci    minimum: 100000
12362306a36Sopenharmony_ci    maximum: 2500000
12462306a36Sopenharmony_ci    description: |
12562306a36Sopenharmony_ci      Default USB charge current limit in uA.
12662306a36Sopenharmony_ci
12762306a36Sopenharmony_ci  usb-otg-in-supply:
12862306a36Sopenharmony_ci    description: Reference to the regulator supplying power to the USB_OTG_IN pin.
12962306a36Sopenharmony_ci
13062306a36Sopenharmony_ci  otg-vbus:
13162306a36Sopenharmony_ci    $ref: /schemas/regulator/regulator.yaml#
13262306a36Sopenharmony_ci    description: |
13362306a36Sopenharmony_ci      This node defines a regulator used to control the direction of VBUS voltage.
13462306a36Sopenharmony_ci      Specifically whether to supply voltage to VBUS for host mode operation of the OTG port,
13562306a36Sopenharmony_ci      or allow input voltage from external VBUS for charging. In the hardware, the supply for
13662306a36Sopenharmony_ci      this regulator comes from usb_otg_in-supply.
13762306a36Sopenharmony_ci
13862306a36Sopenharmony_cirequired:
13962306a36Sopenharmony_ci  - compatible
14062306a36Sopenharmony_ci  - reg
14162306a36Sopenharmony_ci  - interrupts
14262306a36Sopenharmony_ci  - interrupt-names
14362306a36Sopenharmony_ci
14462306a36Sopenharmony_ciadditionalProperties: false
14562306a36Sopenharmony_ci
14662306a36Sopenharmony_ciexamples:
14762306a36Sopenharmony_ci  - |
14862306a36Sopenharmony_ci    #include <dt-bindings/interrupt-controller/irq.h>
14962306a36Sopenharmony_ci    pmic {
15062306a36Sopenharmony_ci      #address-cells = <1>;
15162306a36Sopenharmony_ci      #size-cells = <0>;
15262306a36Sopenharmony_ci
15362306a36Sopenharmony_ci      charger@1000 {
15462306a36Sopenharmony_ci        compatible = "qcom,pm8941-charger";
15562306a36Sopenharmony_ci        reg = <0x1000>;
15662306a36Sopenharmony_ci        interrupts = <0x0 0x10 7 IRQ_TYPE_EDGE_BOTH>,
15762306a36Sopenharmony_ci                     <0x0 0x10 5 IRQ_TYPE_EDGE_BOTH>,
15862306a36Sopenharmony_ci                     <0x0 0x10 4 IRQ_TYPE_EDGE_BOTH>,
15962306a36Sopenharmony_ci                     <0x0 0x12 1 IRQ_TYPE_EDGE_BOTH>,
16062306a36Sopenharmony_ci                     <0x0 0x12 0 IRQ_TYPE_EDGE_BOTH>,
16162306a36Sopenharmony_ci                     <0x0 0x13 2 IRQ_TYPE_EDGE_BOTH>,
16262306a36Sopenharmony_ci                     <0x0 0x13 1 IRQ_TYPE_EDGE_BOTH>,
16362306a36Sopenharmony_ci                     <0x0 0x14 1 IRQ_TYPE_EDGE_BOTH>;
16462306a36Sopenharmony_ci        interrupt-names = "chg-done",
16562306a36Sopenharmony_ci                          "chg-fast",
16662306a36Sopenharmony_ci                          "chg-trkl",
16762306a36Sopenharmony_ci                          "bat-temp-ok",
16862306a36Sopenharmony_ci                          "bat-present",
16962306a36Sopenharmony_ci                          "chg-gone",
17062306a36Sopenharmony_ci                          "usb-valid",
17162306a36Sopenharmony_ci                          "dc-valid";
17262306a36Sopenharmony_ci        qcom,fast-charge-current-limit = <1000000>;
17362306a36Sopenharmony_ci        qcom,dc-current-limit = <1000000>;
17462306a36Sopenharmony_ci        usb-otg-in-supply = <&pm8941_5vs1>;
17562306a36Sopenharmony_ci
17662306a36Sopenharmony_ci        otg-vbus {};
17762306a36Sopenharmony_ci      };
17862306a36Sopenharmony_ci    };
179