summaryrefslogtreecommitdiff
path: root/drivers/hid/wacom_wac.h
diff options
context:
space:
mode:
authorAaron Armstrong Skomra <aaron.skomra@wacom.com>2023-07-26 01:20:25 +0300
committerJiri Kosina <jkosina@suse.cz>2023-08-14 12:43:57 +0300
commit9ac6678b95b0dd9458a7a6869f46e51cd55a1d84 (patch)
tree56e9a7ac651b57bf8253d727dc569d53b67ef0bb /drivers/hid/wacom_wac.h
parent1d7546042f8fdc4bc39ab91ec966203e2d64f8bd (diff)
downloadlinux-9ac6678b95b0dd9458a7a6869f46e51cd55a1d84.tar.xz
HID: wacom: remove the battery when the EKR is off
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>
Diffstat (limited to 'drivers/hid/wacom_wac.h')
-rw-r--r--drivers/hid/wacom_wac.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/hid/wacom_wac.h b/drivers/hid/wacom_wac.h
index ee21bb260f22..2e7cc5e7a0cb 100644
--- a/drivers/hid/wacom_wac.h
+++ b/drivers/hid/wacom_wac.h
@@ -13,6 +13,7 @@
#define WACOM_NAME_MAX 64
#define WACOM_MAX_REMOTES 5
#define WACOM_STATUS_UNKNOWN 255
+#define WACOM_REMOTE_BATTERY_TIMEOUT 21000000000ll
/* packet length for individual models */
#define WACOM_PKGLEN_BBFUN 9