HID: bpf: add in-tree HID-BPF fix for the Wacom ArtPen
authorBenjamin Tissoires <bentiss@kernel.org>
Wed, 10 Apr 2024 17:19:26 +0000 (19:19 +0200)
committerBenjamin Tissoires <bentiss@kernel.org>
Tue, 7 May 2024 13:39:07 +0000 (15:39 +0200)
commitd9e78973921d215a6453b609a6326dab9dbc5a60
tree26c150f33a55dccc1b6d3632d902dbddf89a6d9f
parent0bc8f89f40403cfbc3c6e676b0bee240a9349d3f
HID: bpf: add in-tree HID-BPF fix for the Wacom ArtPen

This pen is compatible with multiple Wacom tablets, but we only add support
for the Intuos Pro 2 M, as this is the one our user reported the bug
against.

We can not generically add all compatible Wacom tablets as we are
writing the offsets by hand.

The point of this HID-BPF program is to work around a firmware limitation
where the pressure is repeated every other report.
Given that we know this will happen, we can change the first new pressure
information with the mean compared to the previous one. This way we
smooth the incoming pressure without losing information.

Cc: Ping Cheng <pinglinux@gmail.com>
Cc: Jason Gerecke <killertofu@gmail.com>
Cc: Aaron Armstrong Skomra <skomra@gmail.com>
Cc: Joshua Dickens <Joshua@joshua-dickens.com>
Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-6-a8bf16033ef8@kernel.org
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
drivers/hid/bpf/progs/Wacom__ArtPen.bpf.c [new file with mode: 0644]