1*c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0
2*c66ec88fSEmmanuel Vadot%YAML 1.2
3*c66ec88fSEmmanuel Vadot---
4*c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/power/supply/gpio-charger.yaml#
5*c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*c66ec88fSEmmanuel Vadot
7*c66ec88fSEmmanuel Vadottitle: simple battery chargers only communicating through GPIOs
8*c66ec88fSEmmanuel Vadot
9*c66ec88fSEmmanuel Vadotmaintainers:
10*c66ec88fSEmmanuel Vadot  - Sebastian Reichel <sre@kernel.org>
11*c66ec88fSEmmanuel Vadot
12*c66ec88fSEmmanuel Vadotdescription:
13*c66ec88fSEmmanuel Vadot  This binding is for all chargers, which are working more or less
14*c66ec88fSEmmanuel Vadot  autonomously, only providing some status GPIOs and possibly some
15*c66ec88fSEmmanuel Vadot  GPIOs for limited control over the charging process.
16*c66ec88fSEmmanuel Vadot
17*c66ec88fSEmmanuel Vadotproperties:
18*c66ec88fSEmmanuel Vadot  compatible:
19*c66ec88fSEmmanuel Vadot    const: gpio-charger
20*c66ec88fSEmmanuel Vadot
21*c66ec88fSEmmanuel Vadot  charger-type:
22*c66ec88fSEmmanuel Vadot    enum:
23*c66ec88fSEmmanuel Vadot      - unknown
24*c66ec88fSEmmanuel Vadot      - battery
25*c66ec88fSEmmanuel Vadot      - ups
26*c66ec88fSEmmanuel Vadot      - mains
27*c66ec88fSEmmanuel Vadot      - usb-sdp                   # USB standard downstream port
28*c66ec88fSEmmanuel Vadot      - usb-dcp                   # USB dedicated charging port
29*c66ec88fSEmmanuel Vadot      - usb-cdp                   # USB charging downstream port
30*c66ec88fSEmmanuel Vadot      - usb-aca                   # USB accessory charger adapter
31*c66ec88fSEmmanuel Vadot    description:
32*c66ec88fSEmmanuel Vadot      Type of the charger, e.g. "mains" for a wall charger.
33*c66ec88fSEmmanuel Vadot
34*c66ec88fSEmmanuel Vadot  gpios:
35*c66ec88fSEmmanuel Vadot    maxItems: 1
36*c66ec88fSEmmanuel Vadot    description: GPIO indicating the charger presence
37*c66ec88fSEmmanuel Vadot
38*c66ec88fSEmmanuel Vadot  charge-status-gpios:
39*c66ec88fSEmmanuel Vadot    maxItems: 1
40*c66ec88fSEmmanuel Vadot    description: GPIO indicating the charging status
41*c66ec88fSEmmanuel Vadot
42*c66ec88fSEmmanuel Vadotrequired:
43*c66ec88fSEmmanuel Vadot  - compatible
44*c66ec88fSEmmanuel Vadot
45*c66ec88fSEmmanuel VadotanyOf:
46*c66ec88fSEmmanuel Vadot  - required:
47*c66ec88fSEmmanuel Vadot      - gpios
48*c66ec88fSEmmanuel Vadot  - required:
49*c66ec88fSEmmanuel Vadot      - charge-status-gpios
50*c66ec88fSEmmanuel Vadot
51*c66ec88fSEmmanuel VadotadditionalProperties: false
52*c66ec88fSEmmanuel Vadot
53*c66ec88fSEmmanuel Vadotexamples:
54*c66ec88fSEmmanuel Vadot  - |
55*c66ec88fSEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
56*c66ec88fSEmmanuel Vadot
57*c66ec88fSEmmanuel Vadot    charger {
58*c66ec88fSEmmanuel Vadot      compatible = "gpio-charger";
59*c66ec88fSEmmanuel Vadot      charger-type = "usb-sdp";
60*c66ec88fSEmmanuel Vadot
61*c66ec88fSEmmanuel Vadot      gpios = <&gpd 28 GPIO_ACTIVE_LOW>;
62*c66ec88fSEmmanuel Vadot      charge-status-gpios = <&gpc 27 GPIO_ACTIVE_LOW>;
63*c66ec88fSEmmanuel Vadot    };
64