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