diff options
author | dmitry.torokhov@gmail.com <dmitry.torokhov@gmail.com> | 2020-10-01 01:47:13 +0300 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2020-10-29 18:14:36 +0300 |
commit | c6838eeef2fbc7e3e1f83759aa016ae6b70c643e (patch) | |
tree | 1363d4ceede35c16620386dd8496732d99436b00 /include/linux/hid.h | |
parent | bf36c6b946c8895cf590f10dbd70b589b0dc101f (diff) | |
download | linux-c6838eeef2fbc7e3e1f83759aa016ae6b70c643e.tar.xz |
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>
Diffstat (limited to 'include/linux/hid.h')
-rw-r--r-- | include/linux/hid.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h index 58684657960b..b079146850e6 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -585,6 +585,7 @@ struct hid_device { /* device report descriptor */ __s32 battery_report_id; enum hid_battery_status battery_status; bool battery_avoid_query; + ktime_t battery_ratelimit_time; #endif unsigned long status; /* see STAT flags above */ |