]> www.infradead.org Git - users/willy/xarray.git/commit
platform/x86: dell-laptop: Use power_supply_charge_types_show/_parse() helpers
authorHans de Goede <hdegoede@redhat.com>
Sat, 21 Dec 2024 12:51:40 +0000 (13:51 +0100)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Thu, 2 Jan 2025 23:48:45 +0000 (00:48 +0100)
commita3a8799165ff83bb764fd800c6559c3cba0ddac3
treea2dc0e6c3b00c66ea689691fad263cf8d7eddeda
parentf6945d52ee5346900fb7251ec23d34822a06918e
platform/x86: dell-laptop: Use power_supply_charge_types_show/_parse() helpers

Make battery_modes a map between tokens and enum power_supply_charge_type
values instead of between tokens and strings and use the new
power_supply_charge_types_show/_parse() helpers for show()/store()
to ensure that things are handled in the same way as in other drivers.

This also changes battery_supported_modes to be a bitmap of charge-types
(enum power_supply_charge_type values) rather then a bitmap of indices
into battery_modes[].

Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20241221125140.345776-2-hdegoede@redhat.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/platform/x86/dell/dell-laptop.c