summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/power/supply/qcom,pm8941-charger.yaml
blob: bc8904872d1b8fdeee85498a47de823b4d740795 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/qcom,pm8941-charger.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Qualcomm Switch-Mode Battery Charger and Boost

maintainers:
  - Sebastian Reichel <sre@kernel.org>

properties:
  compatible:
    const: qcom,pm8941-charger

  reg:
    maxItems: 1

  interrupts:
    items:
      - description: charge done
      - description: charge fast mode
      - description: charge trickle mode
      - description: battery temperature ok
      - description: battery present
      - description: charger disconnected
      - description: USB-in valid
      - description: DC-in valid

  interrupt-names:
    items:
      - const: chg-done
      - const: chg-fast
      - const: chg-trkl
      - const: bat-temp-ok
      - const: bat-present
      - const: chg-gone
      - const: usb-valid
      - const: dc-valid

  qcom,fast-charge-current-limit:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 100000
    maximum: 3000000
    description: Maximum charge current in uA; May be clamped to safety limits; Defaults to 1A

  qcom,fast-charge-low-threshold-voltage:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 2100000
    maximum: 3600000
    description: |
      Battery voltage limit in uV above which fast charging may operate; Defaults to 3.2V
      Below this value linear or switch-mode auto-trickle-charging will operate.

  qcom,fast-charge-high-threshold-voltage:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 3240000
    maximum: 5000000
    description: |
      Battery voltage limit in uV below which fast charging may operate; Defaults to 4.2V
      The fast charger will attempt to charge the battery to this voltage.
      May be clamped to safety limits.

  qcom,fast-charge-safe-voltage:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 3240000
    maximum: 5000000
    description: |
      Maximum safe battery voltage in uV; May be pre-set by bootloader, in which case,
      setting this will harmlessly fail. The property 'fast-charge-high-watermark' will
      be clamped by this value. Defaults to 4.2V.

  qcom,fast-charge-safe-current:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 100000
    maximum: 3000000
    description: |
      Maximum safe battery charge current in uA; May pre-set by bootloader, in which case,
      setting this will harmlessly fail. The property 'qcom,fast-charge-current-limit'
      will be clamped by this value. Defaults to 1A.

  qcom,auto-recharge-threshold-voltage:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 3240000
    maximum: 5000000
    description: |
      Battery voltage limit in uV below which auto-recharge functionality will restart charging
      after end-of-charge; The high cutoff limit for auto-recharge is 5% above this value.
      Defaults to 4.1V.

  qcom,minimum-input-voltage:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 4200000
    maximum: 9600000
    description: |
      Input voltage level in uV above which charging may operate. Defaults to 4.3V.

  qcom,dc-current-limit:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 100000
    maximum: 2500000
    description: |
      Default DC charge current limit in uA. Defaults to 100mA.

  qcom,disable-dc:
    type: boolean
    description: Disable DC charger

  qcom,jeita-extended-temp-range:
    type: boolean
    description: |
      Enable JEITA extended temperature range;  This does *not* adjust the maximum charge
      voltage or current in the extended temperature range. It only allows charging when
      the battery is in the extended temperature range. Voltage/current regulation must
      be done externally to fully comply with the JEITA safety guidelines if this flag
      is set.

  usb-otg-in-supply:
    description: Reference to the regulator supplying power to the USB_OTG_IN pin.

  otg-vbus:
    type: object
    description: |
      This node defines a regulator used to control the direction of VBUS voltage.
      Specifically whether to supply voltage to VBUS for host mode operation of the OTG port,
      or allow input voltage from external VBUS for charging. In the hardware, the supply for
      this regulator comes from usb_otg_in-supply.

required:
  - compatible
  - reg
  - interrupts
  - interrupt-names

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    pmic {
      #address-cells = <1>;
      #size-cells = <0>;

      charger@1000 {
        compatible = "qcom,pm8941-charger";
        reg = <0x1000>;
        interrupts = <0x0 0x10 7 IRQ_TYPE_EDGE_BOTH>,
                     <0x0 0x10 5 IRQ_TYPE_EDGE_BOTH>,
                     <0x0 0x10 4 IRQ_TYPE_EDGE_BOTH>,
                     <0x0 0x12 1 IRQ_TYPE_EDGE_BOTH>,
                     <0x0 0x12 0 IRQ_TYPE_EDGE_BOTH>,
                     <0x0 0x13 2 IRQ_TYPE_EDGE_BOTH>,
                     <0x0 0x13 1 IRQ_TYPE_EDGE_BOTH>,
                     <0x0 0x14 1 IRQ_TYPE_EDGE_BOTH>;
        interrupt-names = "chg-done",
                          "chg-fast",
                          "chg-trkl",
                          "bat-temp-ok",
                          "bat-present",
                          "chg-gone",
                          "usb-valid",
                          "dc-valid";
        qcom,fast-charge-current-limit = <1000000>;
        qcom,dc-current-limit = <1000000>;
        usb-otg-in-supply = <&pm8941_5vs1>;

        otg-vbus {};
      };
    };