]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commiteaeca6c1f09b8702d113b1167b43e1e68aee8d5a
treefb304614e59cb1f3f223cd30748bc967b4a2c8ec
parentda2548dfdd48763382cdb072f0c61c1863650351
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