summaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorJason Gerecke <jason.gerecke@wacom.com>2019-08-07 14:11:55 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-08-29 08:30:21 +0200
commit24c5a3d468b236557f67437394b037e4d0484e4a (patch)
tree28597173f422caed6a6b0c6c61e922fe1445eae4 /drivers/hid
parentccdca005c5a3d389cf4c476bd0cd9575cc1b2b16 (diff)
downloadlinux-stable-24c5a3d468b236557f67437394b037e4d0484e4a.tar.gz
linux-stable-24c5a3d468b236557f67437394b037e4d0484e4a.tar.bz2
linux-stable-24c5a3d468b236557f67437394b037e4d0484e4a.zip
HID: wacom: Correct distance scale for 2nd-gen Intuos devices
commit b72fb1dcd2ea9d29417711cb302cef3006fa8d5a upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/wacom_wac.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index 56417314a701..53ed51adb8ac 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -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);