Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b72fb1dc authored by Jason Gerecke's avatar Jason Gerecke Committed by Jiri Kosina
Browse files

HID: wacom: Correct distance scale for 2nd-gen Intuos devices

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: eda01dab ("HID: wacom: Add four new Intuos devices")
Signed-off-by: default avatarJason Gerecke <jason.gerecke@wacom.com>
Cc: <stable@vger.kernel.org> # v4.4+
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent a3384b8d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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);