summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorThomas Weißschuh <linux@weissschuh.net>2024-03-03 16:31:15 +0100
committerSebastian Reichel <sebastian.reichel@collabora.com>2024-03-06 00:39:45 +0100
commit4e61f1e9d58fb0765f59f47d4d1f318b36c14d95 (patch)
tree7e0067b0c3bf1b5f31b24fa10b0c30a78c954d83 /include
parent521d75b4174e9cbfad73e7d0ac34fd6461b542d7 (diff)
downloadlinux-stable-4e61f1e9d58fb0765f59f47d4d1f318b36c14d95.tar.gz
linux-stable-4e61f1e9d58fb0765f59f47d4d1f318b36c14d95.tar.bz2
linux-stable-4e61f1e9d58fb0765f59f47d4d1f318b36c14d95.zip
power: supply: core: fix charge_behaviour formatting
This property is documented to have a special format which exposes all available behaviours and the currently active one at the same time. For this special format some helpers are provided. When the charge_behaviour property was added in 1b0b6cc8030d ("power: supply: add charge_behaviour attributes"), it did not update the default logic in in power_supply_sysfs.c to use the format helpers. Thus by default only the currently active behaviour is printed. This fixes the default logic to follow the documented format. There is currently only one in-tree drivers exposing charge behaviours - thinkpad_acpi, which is not affected by the change, as it directly uses the helpers and does not use the power_supply_sysfs.c logic. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20240303-power_supply-charge_behaviour_prop-v2-3-8ebb0a7c2409@weissschuh.net Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/power_supply.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 92dd205774ec..8e5705a56b85 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -242,6 +242,7 @@ struct power_supply_config {
struct power_supply_desc {
const char *name;
enum power_supply_type type;
+ u8 charge_behaviours;
const enum power_supply_usb_type *usb_types;
size_t num_usb_types;
const enum power_supply_property *properties;