]> www.infradead.org Git - users/jedix/linux-maple.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)
committerJiri Kosina <jkosina@suse.com>
Fri, 2 Aug 2024 11:02:14 +0000 (13:02 +0200)
commit1b8f9c1fb464968a5b18d3acc1da8c00bad24fad
treeb17dbc62ec875c2e27c6bd3502c559c651c5df17
parentc8000deb68365b461b324d68c7ea89d730f0bb85
HID: wacom: Defer calculation of resolution until resolution_code is known

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