1 # SPDX-License-Identifier: GPL-2.0
4 $id: http://devicetree.org/schemas/power/supply/gpio-charger.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
7 title: simple battery chargers only communicating through GPIOs
10 - Sebastian Reichel <sre@kernel.org>
13 This binding is for all chargers, which are working more or less
14 autonomously, only providing some status GPIOs and possibly some
15 GPIOs for limited control over the charging process.
27 - usb-sdp # USB standard downstream port
28 - usb-dcp # USB dedicated charging port
29 - usb-cdp # USB charging downstream port
30 - usb-aca # USB accessory charger adapter
32 Type of the charger, e.g. "mains" for a wall charger.
36 description: GPIO indicating the charger presence
40 description: GPIO indicating the charging status
42 charge-current-limit-gpios:
45 description: GPIOs used for current limiting
47 charge-current-limit-mapping:
48 description: List of tuples with current in uA and a GPIO bitmap (in
49 this order). The tuples must be provided in descending order of the
51 $ref: /schemas/types.yaml#/definitions/uint32-matrix
57 Encoded GPIO setting. Bit 0 represents last GPIO from the
58 charge-current-limit-gpios property. Bit 1 second to last
70 - charge-current-limit-gpios
73 charge-current-limit-gpios: [ charge-current-limit-mapping ]
74 charge-current-limit-mapping: [ charge-current-limit-gpios ]
76 additionalProperties: false
80 #include <dt-bindings/gpio/gpio.h>
83 compatible = "gpio-charger";
84 charger-type = "usb-sdp";
86 gpios = <&gpd 28 GPIO_ACTIVE_LOW>;
87 charge-status-gpios = <&gpc 27 GPIO_ACTIVE_LOW>;
89 charge-current-limit-gpios = <&gpioA 11 GPIO_ACTIVE_HIGH>,
90 <&gpioA 12 GPIO_ACTIVE_HIGH>;
91 charge-current-limit-mapping = <2500000 0x00>, // 2.5 A => both GPIOs low
92 <700000 0x01>, // 700 mA => GPIO A.12 high
93 <0 0x02>; // 0 mA => GPIO A.11 high