platform/x86: Battery charge mode in toshiba_acpi (sysfs)
authorArvid Norlander <lkml@vorpal.se>
Fri, 2 Sep 2022 18:00:36 +0000 (20:00 +0200)
committerHans de Goede <hdegoede@redhat.com>
Fri, 9 Sep 2022 19:58:16 +0000 (21:58 +0200)
commit8ef5db9eb084f6212345a7b09355c78ce05f71e2
treefb304614e59cb1f3f223cd30748bc967b4a2c8ec
parent89655fbb396aff20bd5247fa6b13a689e2f10f9c
platform/x86: Battery charge mode in toshiba_acpi (sysfs)

This commit adds the ACPI battery hook which in turns adds the sysfs
entries.

Because the Toshiba laptops only support two modes (eco or normal), which
in testing correspond to 80% and 100% we simply round to the nearest
possible level when set.

It is possible that Toshiba laptops other than the Z830 has different set
points for the charging. If so, a quirk table could be introduced in the
future for this. For now, assume that all laptops that support this feature
work the same way.

Tested on a Toshiba Satellite Z830.

Signed-off-by: Arvid Norlander <lkml@vorpal.se>
Link: https://lore.kernel.org/r/20220902180037.1728546-3-lkml@vorpal.se
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/Kconfig
drivers/platform/x86/toshiba_acpi.c