]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
HID: wacom: remove the battery when the EKR is off
authorAaron Armstrong Skomra <aaron.skomra@wacom.com>
Tue, 25 Jul 2023 22:20:25 +0000 (15:20 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Sep 2023 20:28:38 +0000 (21:28 +0100)
commitd17cec60e87c21aea91430eb101da76384fd9f61
treeeae476a2a6976ef7f0eabc6ec033c9582e748a70
parent842c7da3eee25fe843bb94f05763806e36e1f26c
HID: wacom: remove the battery when the EKR is off

commit 9ac6678b95b0dd9458a7a6869f46e51cd55a1d84 upstream.

Currently the EKR battery remains even after we stop getting information
from the device. This can lead to a stale battery persisting indefinitely
in userspace.

The remote sends a heartbeat every 10 seconds. Delete the battery if we
miss two heartbeats (after 21 seconds). Restore the battery once we see
a heartbeat again.

Signed-off-by: Aaron Skomra <skomra@gmail.com>
Signed-off-by: Aaron Armstrong Skomra <aaron.skomra@wacom.com>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Fixes: 9f1015d45f62 ("HID: wacom: EKR: attach the power_supply on first connection")
CC: stable@vger.kernel.org
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/wacom.h
drivers/hid/wacom_sys.c
drivers/hid/wacom_wac.c
drivers/hid/wacom_wac.h