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