platform/x86: ideapad: Expose charge_types
authorJelle van der Waa <jvanderwaa@redhat.com>
Wed, 14 May 2025 20:10:52 +0000 (22:10 +0200)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Wed, 11 Jun 2025 08:29:06 +0000 (11:29 +0300)
commitda8f2708f9b69707f4efeb432a18395e46b4666f
tree75c869b9df2bb43daf3f83e1b4f08410f215e78e
parent651b57dd40871d4d0d61fb291e7f26e2b8bd69b1
platform/x86: ideapad: Expose charge_types

Some Ideapad models support a battery conservation mode which limits the
battery charge threshold for longer battery longevity. This is currently
exposed via a custom conservation_mode attribute in sysfs.

The newly introduced charge_types sysfs attribute is a standardized
replacement for laptops with a fixed end charge threshold. Setting it to
`Long Life` would enable battery conservation mode. The standardized
user space API would allow applications such as UPower to detect laptops
which support this battery longevity mode and set it.

Tested on an Lenovo ideapad U330p.

Signed-off-by: Jelle van der Waa <jvanderwaa@redhat.com>
Suggested-By: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20250514201054.381320-1-jvanderwaa@redhat.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Documentation/ABI/obsolete/sysfs-platform-ideapad-laptop [new file with mode: 0644]
Documentation/ABI/testing/sysfs-platform-ideapad-laptop
drivers/platform/x86/lenovo/Kconfig
drivers/platform/x86/lenovo/ideapad-laptop.c