power: supply: PCHG: Peripheral device charger
authorDaisuke Nojiri <dnojiri@chromium.org>
Wed, 16 Jun 2021 18:51:24 +0000 (11:51 -0700)
committerSebastian Reichel <sre@kernel.org>
Fri, 16 Jul 2021 13:54:34 +0000 (15:54 +0200)
commit56d629af09b9d4db9792257165844287ecce0a98
treeea61aeac6953176b43166d979b1d2062bc71691e
parent5176a18bb5e1596d46c34c4700ac67b74f88f704
power: supply: PCHG: Peripheral device charger

This patch adds a driver for PCHG (Peripheral CHarGer). PCHG is a
framework managing power supplies for peripheral devices.

This driver creates a sysfs node for each peripheral charge port:

/sys/class/power_supply/peripheral<n>

where <n> is the index of a charge port.

For example, when a stylus is connected to a NFC/WLC port, the node
returns:

/sys/class/power_supply/peripheral0/
capacity=50
charge_type=Standard
scope=Device
status=Charging
type=Battery

Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/Kconfig
drivers/power/supply/Makefile
drivers/power/supply/cros_peripheral_charger.c [new file with mode: 0644]
include/linux/platform_data/cros_ec_commands.h