]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
HID: wacom: Defer calculation of resolution until resolution_code is known
authorJason Gerecke <jason.gerecke@wacom.com>
Tue, 30 Jul 2024 15:51:55 +0000 (08:51 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Aug 2024 15:36:08 +0000 (17:36 +0200)
commit8a5af26bcbb41c9bcc341367159933f480cfd9cc
tree894b422dfa2011b4ae845cf7e0db56ff37d76efe
parent8cbcb6d03d68c07c01c15b5dd6a60004cf9e85ea
HID: wacom: Defer calculation of resolution until resolution_code is known

commit 1b8f9c1fb464968a5b18d3acc1da8c00bad24fad upstream.

The Wacom driver maps the HID_DG_TWIST usage to ABS_Z (rather than ABS_RZ)
for historic reasons. When the code to support twist was introduced in
commit 50066a042da5 ("HID: wacom: generic: Add support for height, tilt,
and twist usages"), we were careful to write it in such a way that it had
HID calculate the resolution of the twist axis assuming ABS_RZ instead
(so that we would get correct angular behavior). This was broken with
the introduction of commit 08a46b4190d3 ("HID: wacom: Set a default
resolution for older tablets"), which moved the resolution calculation
to occur *before* the adjustment from ABS_Z to ABS_RZ occurred.

This commit moves the calculation of resolution after the point that
we are finished setting things up for its proper use.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Fixes: 08a46b4190d3 ("HID: wacom: Set a default resolution for older tablets")
Cc: stable@vger.kernel.org
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/wacom_wac.c