]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
HID: wacom: Correct distance scale for 2nd-gen Intuos devices
authorJason Gerecke <jason.gerecke@wacom.com>
Wed, 7 Aug 2019 21:11:55 +0000 (14:11 -0700)
committerJiri Kosina <jkosina@suse.cz>
Mon, 19 Aug 2019 12:08:58 +0000 (14:08 +0200)
Distance values reported by 2nd-gen Intuos tablets are on an inverted
scale (0 == far, 63 == near). We need to change them over to a normal
scale before reporting to userspace or else userspace drivers and
applications can get confused.

Ref: https://github.com/linuxwacom/input-wacom/issues/98
Fixes: eda01dab53 ("HID: wacom: Add four new Intuos devices")
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Cc: <stable@vger.kernel.org> # v4.4+
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/wacom_wac.c

index 50074485b88b98a2c7e03fd836d49c05465a8450..7a9e229e6253fcc9b478deb600eb688204b3043e 100644 (file)
@@ -846,6 +846,8 @@ static int wacom_intuos_general(struct wacom_wac *wacom)
                y >>= 1;
                distance >>= 1;
        }
+       if (features->type == INTUOSHT2)
+               distance = features->distance_max - distance;
        input_report_abs(input, ABS_X, x);
        input_report_abs(input, ABS_Y, y);
        input_report_abs(input, ABS_DISTANCE, distance);