diff options
| author | Thomas Weißschuh <linux@weissschuh.net> | 2024-12-11 20:57:58 +0100 |
|---|---|---|
| committer | Sebastian Reichel <sebastian.reichel@collabora.com> | 2024-12-14 22:50:17 +0100 |
| commit | 288a2cabcf6bb35532e8b2708829bdc2b85bc690 (patch) | |
| tree | d79e9d50d7ebcbe5cf0c2baea6d562c1e0d8d919 /include | |
| parent | bcfe7d6ba20742bc166b293cc1a3986a0f4aaeb9 (diff) | |
| download | linux-288a2cabcf6bb35532e8b2708829bdc2b85bc690.tar.gz linux-288a2cabcf6bb35532e8b2708829bdc2b85bc690.zip | |
power: supply: core: add UAPI to discover currently used extensions
Userspace wants to now about the used power supply extensions,
for example to handle a device extended by a certain extension
differently or to discover information about the extending device.
Add a sysfs directory to the power supply device.
This directory contains links which are named after the used extension
and point to the device implementing that extension.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20241211-power-supply-extensions-v6-4-9d9dc3f3d387@weissschuh.net
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/power_supply.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index a877518cd963..c3ce9f2b17d4 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -286,6 +286,7 @@ struct power_supply_desc { }; struct power_supply_ext { + const char *const name; u8 charge_behaviours; const enum power_supply_property *properties; size_t num_properties; @@ -911,6 +912,7 @@ extern int power_supply_powers(struct power_supply *psy, struct device *dev); extern int __must_check power_supply_register_extension(struct power_supply *psy, const struct power_supply_ext *ext, + struct device *dev, void *data); extern void power_supply_unregister_extension(struct power_supply *psy, const struct power_supply_ext *ext); |
