]> git.itanic.dy.fi Git - linux-stable/commit
HID: wacom: insert timestamp to packed Bluetooth (BT) events
authorPing Cheng <pinglinux@gmail.com>
Fri, 24 Feb 2023 16:26:43 +0000 (08:26 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 09:53:51 +0000 (11:53 +0200)
commitfb98336e23c11e9c8c7dd5425ec71adbbef7f773
tree55966a7333cdb0600d8f906ef95fc24f4451b982
parentfb2f0c00048bcbea29c230e3ad7f3e0cf5d2bbc2
HID: wacom: insert timestamp to packed Bluetooth (BT) events

commit 17d793f3ed53080dab6bbeabfc82de890c901001 upstream.

To fully utilize the BT polling/refresh rate, a few input events
are sent together to reduce event delay. This causes issue to the
timestamp generated by input_sync since all the events in the same
packet would pretty much have the same timestamp. This patch inserts
time interval to the events by averaging the total time used for
sending the packet.

This decision was mainly based on observing the actual time interval
between each BT polling. The interval doesn't seem to be constant,
due to the network and system environment. So, using solutions other
than averaging doesn't end up with valid timestamps.

Signed-off-by: Ping Cheng <ping.cheng@wacom.com>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/wacom_wac.c
drivers/hid/wacom_wac.h