]> 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)
committerJiri Kosina <jkosina@suse.cz>
Fri, 10 Mar 2023 10:13:15 +0000 (11:13 +0100)
commit17d793f3ed53080dab6bbeabfc82de890c901001
tree9b309b1e1d9eab0959a7bde47afb005a8f30911c
parent2653e3fe33f411227296552b2e5f9c2640924900
HID: wacom: insert timestamp to packed Bluetooth (BT) events

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>
drivers/hid/wacom_wac.c
drivers/hid/wacom_wac.h