xref: /linux/Documentation/devicetree/bindings/power/supply/qcom,pm8941-charger.yaml (revision 3d0fe49454652117522f60bfbefb978ba0e5300b)
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-charge-current-limit:
121    $ref: /schemas/types.yaml#/definitions/uint32
122    minimum: 100000
123    maximum: 2500000
124    description: |
125      Default USB charge current limit in uA.
126
127  usb-otg-in-supply:
128    description: Reference to the regulator supplying power to the USB_OTG_IN pin.
129
130  otg-vbus:
131    $ref: /schemas/regulator/regulator.yaml#
132    description: |
133      This node defines a regulator used to control the direction of VBUS voltage.
134      Specifically whether to supply voltage to VBUS for host mode operation of the OTG port,
135      or allow input voltage from external VBUS for charging. In the hardware, the supply for
136      this regulator comes from usb_otg_in-supply.
137
138required:
139  - compatible
140  - reg
141  - interrupts
142  - interrupt-names
143
144additionalProperties: false
145
146examples:
147  - |
148    #include <dt-bindings/interrupt-controller/irq.h>
149    pmic {
150      #address-cells = <1>;
151      #size-cells = <0>;
152
153      charger@1000 {
154        compatible = "qcom,pm8941-charger";
155        reg = <0x1000>;
156        interrupts = <0x0 0x10 7 IRQ_TYPE_EDGE_BOTH>,
157                     <0x0 0x10 5 IRQ_TYPE_EDGE_BOTH>,
158                     <0x0 0x10 4 IRQ_TYPE_EDGE_BOTH>,
159                     <0x0 0x12 1 IRQ_TYPE_EDGE_BOTH>,
160                     <0x0 0x12 0 IRQ_TYPE_EDGE_BOTH>,
161                     <0x0 0x13 2 IRQ_TYPE_EDGE_BOTH>,
162                     <0x0 0x13 1 IRQ_TYPE_EDGE_BOTH>,
163                     <0x0 0x14 1 IRQ_TYPE_EDGE_BOTH>;
164        interrupt-names = "chg-done",
165                          "chg-fast",
166                          "chg-trkl",
167                          "bat-temp-ok",
168                          "bat-present",
169                          "chg-gone",
170                          "usb-valid",
171                          "dc-valid";
172        qcom,fast-charge-current-limit = <1000000>;
173        qcom,dc-current-limit = <1000000>;
174        usb-otg-in-supply = <&pm8941_5vs1>;
175
176        otg-vbus {};
177      };
178    };
179