1# SPDX-License-Identifier: GPL-2.0
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/power/supply/qcom,pm8941-charger.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Qualcomm Switch-Mode Battery Charger and Boost
8
9maintainers:
10  - Sebastian Reichel <sre@kernel.org>
11
12properties:
13  compatible:
14    enum:
15      - qcom,pm8226-charger
16      - qcom,pm8941-charger
17
18  reg:
19    maxItems: 1
20
21  interrupts:
22    items:
23      - description: charge done
24      - description: charge fast mode
25      - description: charge trickle mode
26      - description: battery temperature ok
27      - description: battery present
28      - description: charger disconnected
29      - description: USB-in valid
30      - description: DC-in valid
31
32  interrupt-names:
33    items:
34      - const: chg-done
35      - const: chg-fast
36      - const: chg-trkl
37      - const: bat-temp-ok
38      - const: bat-present
39      - const: chg-gone
40      - const: usb-valid
41      - const: dc-valid
42
43  qcom,fast-charge-current-limit:
44    $ref: /schemas/types.yaml#/definitions/uint32
45    minimum: 100000
46    maximum: 3000000
47    description: Maximum charge current in uA; May be clamped to safety limits; Defaults to 1A
48
49  qcom,fast-charge-low-threshold-voltage:
50    $ref: /schemas/types.yaml#/definitions/uint32
51    minimum: 2100000
52    maximum: 3600000
53    description: |
54      Battery voltage limit in uV above which fast charging may operate; Defaults to 3.2V
55      Below this value linear or switch-mode auto-trickle-charging will operate.
56
57  qcom,fast-charge-high-threshold-voltage:
58    $ref: /schemas/types.yaml#/definitions/uint32
59    minimum: 3240000
60    maximum: 5000000
61    description: |
62      Battery voltage limit in uV below which fast charging may operate; Defaults to 4.2V
63      The fast charger will attempt to charge the battery to this voltage.
64      May be clamped to safety limits.
65
66  qcom,fast-charge-safe-voltage:
67    $ref: /schemas/types.yaml#/definitions/uint32
68    minimum: 3240000
69    maximum: 5000000
70    description: |
71      Maximum safe battery voltage in uV; May be pre-set by bootloader, in which case,
72      setting this will harmlessly fail. The property 'fast-charge-high-watermark' will
73      be clamped by this value. Defaults to 4.2V.
74
75  qcom,fast-charge-safe-current:
76    $ref: /schemas/types.yaml#/definitions/uint32
77    minimum: 100000
78    maximum: 3000000
79    description: |
80      Maximum safe battery charge current in uA; May pre-set by bootloader, in which case,
81      setting this will harmlessly fail. The property 'qcom,fast-charge-current-limit'
82      will be clamped by this value. Defaults to 1A.
83
84  qcom,auto-recharge-threshold-voltage:
85    $ref: /schemas/types.yaml#/definitions/uint32
86    minimum: 3240000
87    maximum: 5000000
88    description: |
89      Battery voltage limit in uV below which auto-recharge functionality will restart charging
90      after end-of-charge; The high cutoff limit for auto-recharge is 5% above this value.
91      Defaults to 4.1V.
92
93  qcom,minimum-input-voltage:
94    $ref: /schemas/types.yaml#/definitions/uint32
95    minimum: 4200000
96    maximum: 9600000
97    description: |
98      Input voltage level in uV above which charging may operate. Defaults to 4.3V.
99
100  qcom,dc-current-limit:
101    $ref: /schemas/types.yaml#/definitions/uint32
102    minimum: 100000
103    maximum: 2500000
104    description: |
105      Default DC charge current limit in uA. Defaults to 100mA.
106
107  qcom,disable-dc:
108    type: boolean
109    description: Disable DC charger
110
111  qcom,jeita-extended-temp-range:
112    type: boolean
113    description: |
114      Enable JEITA extended temperature range;  This does *not* adjust the maximum charge
115      voltage or current in the extended temperature range. It only allows charging when
116      the battery is in the extended temperature range. Voltage/current regulation must
117      be done externally to fully comply with the JEITA safety guidelines if this flag
118      is set.
119
120  usb-otg-in-supply:
121    description: Reference to the regulator supplying power to the USB_OTG_IN pin.
122
123  otg-vbus:
124    type: object
125    description: |
126      This node defines a regulator used to control the direction of VBUS voltage.
127      Specifically whether to supply voltage to VBUS for host mode operation of the OTG port,
128      or allow input voltage from external VBUS for charging. In the hardware, the supply for
129      this regulator comes from usb_otg_in-supply.
130
131required:
132  - compatible
133  - reg
134  - interrupts
135  - interrupt-names
136
137additionalProperties: false
138
139examples:
140  - |
141    #include <dt-bindings/interrupt-controller/irq.h>
142    pmic {
143      #address-cells = <1>;
144      #size-cells = <0>;
145
146      charger@1000 {
147        compatible = "qcom,pm8941-charger";
148        reg = <0x1000>;
149        interrupts = <0x0 0x10 7 IRQ_TYPE_EDGE_BOTH>,
150                     <0x0 0x10 5 IRQ_TYPE_EDGE_BOTH>,
151                     <0x0 0x10 4 IRQ_TYPE_EDGE_BOTH>,
152                     <0x0 0x12 1 IRQ_TYPE_EDGE_BOTH>,
153                     <0x0 0x12 0 IRQ_TYPE_EDGE_BOTH>,
154                     <0x0 0x13 2 IRQ_TYPE_EDGE_BOTH>,
155                     <0x0 0x13 1 IRQ_TYPE_EDGE_BOTH>,
156                     <0x0 0x14 1 IRQ_TYPE_EDGE_BOTH>;
157        interrupt-names = "chg-done",
158                          "chg-fast",
159                          "chg-trkl",
160                          "bat-temp-ok",
161                          "bat-present",
162                          "chg-gone",
163                          "usb-valid",
164                          "dc-valid";
165        qcom,fast-charge-current-limit = <1000000>;
166        qcom,dc-current-limit = <1000000>;
167        usb-otg-in-supply = <&pm8941_5vs1>;
168
169        otg-vbus {};
170      };
171    };
172