Skip to content

Commit 79346d6

Browse files
bentissJiri Kosina
authored andcommitted
HID: input: force generic axis to be mapped to their user space axis
Atmel 840B digitizer presents a stylus interface which reports twice the X coordinate and then twice the Y coordinate. In its current implementation, hid-input assign the first X to X, then the second to Y, then the first Y to Z, then the second one to RX. This is wrong, and X should always be mapped to X, no matter what. A solution consists in forcing X, Y, Z, RX, RY, RZ to be mapped to their correct user space counter part. Reported-by: Éric Brunet <Eric.Brunet@lps.ens.fr> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1 parent cee5aa1 commit 79346d6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/hid/hid-input.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,12 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
599599
/* These usage IDs map directly to the usage codes. */
600600
case HID_GD_X: case HID_GD_Y: case HID_GD_Z:
601601
case HID_GD_RX: case HID_GD_RY: case HID_GD_RZ:
602+
if (field->flags & HID_MAIN_ITEM_RELATIVE)
603+
map_rel(usage->hid & 0xf);
604+
else
605+
map_abs_clear(usage->hid & 0xf);
606+
break;
607+
602608
case HID_GD_SLIDER: case HID_GD_DIAL: case HID_GD_WHEEL:
603609
if (field->flags & HID_MAIN_ITEM_RELATIVE)
604610
map_rel(usage->hid & 0xf);

0 commit comments

Comments
 (0)