HID: wacom: Remove AES power_supply after extended inactivity
authorTatsunosuke Tobita <tatsunosuke.wacom@gmail.com>
Tue, 14 Nov 2023 23:57:29 +0000 (08:57 +0900)
committerBenjamin Tissoires <bentiss@kernel.org>
Wed, 29 Nov 2023 15:13:21 +0000 (16:13 +0100)
commitfd2a9b29dc9c4c35def91d5d1c5b470843539de6
treef8df254bbcd2a50f2b11937c20bab22e7586685d
parent1f342790ad3c2456e15351829ad5d8919cccc03f
HID: wacom: Remove AES power_supply after extended inactivity

Even if a user does not use their AES pen for an extended period,
the battery power supply attributes continue to exist.
This results in the desktop showing battery status for a pen
that is no longer in use and which may in fact be in a different
state (e.g. the user may be charging the pen).
To avoid confusion and ensure userspace has an accurate view
of the battery state, this patch automatically removes
the power_supply after 30 minutes of inactivity.

Signed-off-by: Tatsunosuke Tobita <tatsunosuke.tobita@wacom.com>
Reviewed-by: Jason Gerecke <Jason.Gerecke@wacom.com>
Reviewed-by: Aaron Skomra <aaron.skomra@wacom.com>
Reviewed-by: Josh Dickens <joshua.dickens@wacom.com>
Link: https://lore.kernel.org/r/20231114235729.6867-1-tatsunosuke.wacom@gmail.com
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
drivers/hid/wacom.h
drivers/hid/wacom_sys.c
drivers/hid/wacom_wac.c
drivers/hid/wacom_wac.h