diff options
author | Thomas Weißschuh <linux@weissschuh.net> | 2021-11-24 02:27:02 +0300 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2021-12-21 18:27:42 +0300 |
commit | 539b9c94ac83563842a27e8cc3de5164b15c4de0 (patch) | |
tree | c762821cba3c02141ea90407f0dd2f933302fe53 /include/linux/power_supply.h | |
parent | 1b0b6cc8030d08d2a24e9e5f85dc36c5a58200ba (diff) | |
download | linux-539b9c94ac83563842a27e8cc3de5164b15c4de0.tar.xz |
power: supply: add helpers for charge_behaviour sysfs
These helper functions can be used by drivers to implement their own
sysfs-attributes.
This is useful for ACPI-drivers extending the default ACPI-battery with
their own charge_behaviour attributes.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://lore.kernel.org/r/20211123232704.25394-3-linux@weissschuh.net
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'include/linux/power_supply.h')
-rw-r--r-- | include/linux/power_supply.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 70c333e86293..71f0379c2af8 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -546,4 +546,13 @@ static inline void power_supply_remove_hwmon_sysfs(struct power_supply *psy) {} #endif +#ifdef CONFIG_SYSFS +ssize_t power_supply_charge_behaviour_show(struct device *dev, + unsigned int available_behaviours, + enum power_supply_charge_behaviour behaviour, + char *buf); + +int power_supply_charge_behaviour_parse(unsigned int available_behaviours, const char *buf); +#endif + #endif /* __LINUX_POWER_SUPPLY_H__ */ |