Lines Matching +full:gpio +full:- +full:charger
1 # SPDX-License-Identifier: GPL-2.0
3 ---
4 $id: http://devicetree.org/schemas/power/supply/gpio-charger.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
10 - Sebastian Reichel <sre@kernel.org>
19 const: gpio-charger
21 charger-type:
23 - unknown
24 - battery
25 - ups
26 - mains
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
38 charge-status-gpios:
40 description: GPIO indicating the charging status
42 charge-current-limit-gpios:
47 charge-current-limit-mapping:
48 description: List of tuples with current in uA and a GPIO bitmap (in
51 $ref: /schemas/types.yaml#/definitions/uint32-matrix
54 - description:
56 - description:
57 Encoded GPIO setting. Bit 0 represents last GPIO from the
58 charge-current-limit-gpios property. Bit 1 second to last
59 GPIO and so on.
62 - compatible
65 - required:
66 - gpios
67 - required:
68 - charge-status-gpios
69 - required:
70 - charge-current-limit-gpios
73 charge-current-limit-gpios: [ charge-current-limit-mapping ]
74 charge-current-limit-mapping: [ charge-current-limit-gpios ]
79 - |
80 #include <dt-bindings/gpio/gpio.h>
82 charger {
83 compatible = "gpio-charger";
84 charger-type = "usb-sdp";
87 charge-status-gpios = <&gpc 27 GPIO_ACTIVE_LOW>;
89 charge-current-limit-gpios = <&gpioA 11 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