Skip to content

Commit fec7a84

Browse files
jigpugregkh
authored andcommitted
HID: wacom: Correct distance scale for 2nd-gen Intuos devices
commit b72fb1d 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: linuxwacom/input-wacom#98 Fixes: eda01da ("HID: wacom: Add four new Intuos devices") Signed-off-by: Jason Gerecke <[email protected]> Cc: <[email protected]> # v4.4+ Signed-off-by: Jiri Kosina <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 76f66b8 commit fec7a84

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/hid/wacom_wac.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,8 @@ static int wacom_intuos_general(struct wacom_wac *wacom)
848848
y >>= 1;
849849
distance >>= 1;
850850
}
851+
if (features->type == INTUOSHT2)
852+
distance = features->distance_max - distance;
851853
input_report_abs(input, ABS_X, x);
852854
input_report_abs(input, ABS_Y, y);
853855
input_report_abs(input, ABS_DISTANCE, distance);

0 commit comments

Comments
 (0)