]> git.baikalelectronics.ru Git - kernel.git/commit
HID: hid-input: occasionally report stylus battery even if not changed
authordmitry.torokhov@gmail.com <dmitry.torokhov@gmail.com>
Wed, 30 Sep 2020 22:47:13 +0000 (15:47 -0700)
committerJiri Kosina <jkosina@suse.cz>
Thu, 29 Oct 2020 15:14:36 +0000 (16:14 +0100)
commit59cf405081f09b67b6e8a7bbd63abb1accfeb020
tree1363d4ceede35c16620386dd8496732d99436b00
parentaab9f41dff55f15959228c919ced833a0f25a204
HID: hid-input: occasionally report stylus battery even if not changed

There are styluses that only report their battery status when they are
touching the touchscreen; additionally we currently suppress battery
reports if capacity has not changed. To help userspace recognize how long
ago the device reported battery status, let's send the change event through
if either capacity has changed, or at least 30 seconds have passed since
last report we've let through.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-input.c
include/linux/hid.h