Skip to content

Commit

Permalink
HID: wacom: Correct distance scale for 2nd-gen Intuos devices
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
jigpu authored and gregkh committed Sep 6, 2019
1 parent af00cc2 commit 50a583b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/hid/wacom_wac.c
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,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);
Expand Down

0 comments on commit 50a583b

Please sign in to comment.