1464a7488SSebastian Reichel# SPDX-License-Identifier: GPL-2.0
2464a7488SSebastian Reichel# Copyright (C) 2021 Sebastian Reichel
3464a7488SSebastian Reichel%YAML 1.2
4464a7488SSebastian Reichel---
51ea78ec5SKrzysztof Kozlowski$id: http://devicetree.org/schemas/power/supply/bq24735.yaml#
61ea78ec5SKrzysztof Kozlowski$schema: http://devicetree.org/meta-schemas/core.yaml#
7464a7488SSebastian Reichel
89d69d47fSKrzysztof Kozlowskititle: TI BQ24735 Li-Ion Battery Charger
9464a7488SSebastian Reichel
10464a7488SSebastian Reichelmaintainers:
11464a7488SSebastian Reichel  - Sebastian Reichel <sre@kernel.org>
12464a7488SSebastian Reichel
13464a7488SSebastian ReichelallOf:
14464a7488SSebastian Reichel  - $ref: power-supply.yaml#
15464a7488SSebastian Reichel
16464a7488SSebastian Reichelproperties:
17464a7488SSebastian Reichel  compatible:
18464a7488SSebastian Reichel    const: ti,bq24735
19464a7488SSebastian Reichel
20464a7488SSebastian Reichel  reg:
21464a7488SSebastian Reichel    maxItems: 1
22464a7488SSebastian Reichel
23464a7488SSebastian Reichel  interrupts:
24464a7488SSebastian Reichel    description: AC adapter plug event interrupt
25464a7488SSebastian Reichel    maxItems: 1
26464a7488SSebastian Reichel
27464a7488SSebastian Reichel  ti,ac-detect-gpios:
28464a7488SSebastian Reichel    maxItems: 1
29464a7488SSebastian Reichel    description: |
30464a7488SSebastian Reichel      This GPIO is optionally used to read the AC adapter status. This is a Host GPIO
31464a7488SSebastian Reichel      that is configured as an input and connected to the ACOK pin on the bq24735.
32464a7488SSebastian Reichel      Note: for backwards compatibility reasons, the GPIO must be active on AC adapter
33464a7488SSebastian Reichel      absence despite ACOK being active (high) on AC adapter presence.
34464a7488SSebastian Reichel
35464a7488SSebastian Reichel  ti,charge-current:
36464a7488SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/uint32
37464a7488SSebastian Reichel    description: |
38464a7488SSebastian Reichel      Used to control and set the charging current.
39464a7488SSebastian Reichel      This value must be between 128mA and 8.128A with a 64mA step resolution.
40464a7488SSebastian Reichel      The POR value is 0x0000h. This number is in mA (e.g. 8192).
41464a7488SSebastian Reichel      See spec for more information about the ChargeCurrent (0x14h) register.
42464a7488SSebastian Reichel
43464a7488SSebastian Reichel  ti,charge-voltage:
44464a7488SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/uint32
45464a7488SSebastian Reichel    description: |
46464a7488SSebastian Reichel      Used to control and set the charging voltage.
47464a7488SSebastian Reichel      This value must be between 1.024V and 19.2V with a 16mV step resolution.
48464a7488SSebastian Reichel      The POR value is 0x0000h. This number is in mV (e.g. 19200).
49464a7488SSebastian Reichel      See spec for more information about the ChargeVoltage (0x15h) register.
50464a7488SSebastian Reichel
51464a7488SSebastian Reichel  ti,input-current:
52464a7488SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/uint32
53464a7488SSebastian Reichel    description: |
54464a7488SSebastian Reichel      Used to control and set the charger input current.
55464a7488SSebastian Reichel      This value must be between 128mA and 8.064A with a 128mA step resolution.
56464a7488SSebastian Reichel      The POR value is 0x1000h. This number is in mA (e.g. 8064).
57464a7488SSebastian Reichel      See the spec for more information about the InputCurrent (0x3fh) register.
58464a7488SSebastian Reichel
59464a7488SSebastian Reichel  ti,external-control:
60464a7488SSebastian Reichel    type: boolean
61464a7488SSebastian Reichel    description: |
62464a7488SSebastian Reichel      Indicates that the charger is configured externally and that the host should not
63464a7488SSebastian Reichel      attempt to enable/disable charging or set the charge voltage/current.
64464a7488SSebastian Reichel
65464a7488SSebastian Reichel  poll-interval:
66464a7488SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/uint32
67464a7488SSebastian Reichel    description: |
68464a7488SSebastian Reichel      If 'interrupts' is not specified, poll AC adapter presence with this interval (milliseconds).
69464a7488SSebastian Reichel
70464a7488SSebastian Reichelrequired:
71464a7488SSebastian Reichel  - compatible
72464a7488SSebastian Reichel  - reg
73464a7488SSebastian Reichel
74464a7488SSebastian ReicheladditionalProperties: false
75464a7488SSebastian Reichel
76464a7488SSebastian Reichelexamples:
77464a7488SSebastian Reichel  - |
78464a7488SSebastian Reichel    #include <dt-bindings/gpio/gpio.h>
79464a7488SSebastian Reichel
80*20a72af1SRob Herring    i2c {
81464a7488SSebastian Reichel      #address-cells = <1>;
82464a7488SSebastian Reichel      #size-cells = <0>;
83464a7488SSebastian Reichel
84464a7488SSebastian Reichel      charger@9 {
85464a7488SSebastian Reichel        compatible = "ti,bq24735";
86464a7488SSebastian Reichel        reg = <0x9>;
87464a7488SSebastian Reichel        ti,ac-detect-gpios = <&gpio 72 0x1>;
88464a7488SSebastian Reichel      };
89464a7488SSebastian Reichel    };
90