Skip to content

Commit 5f66872

Browse files
andrewshaduraJiri Kosina
authored andcommitted
HID: penmount: report only one button for PenMount 6000 USB touchscreen controller
PenMount 6000 USB resistive touchscreen controller reports it has three buttons, while in reality it doesn't have any and doesn't support active styli, and only generates touch events. In penmount_input_mapping(), map only the first button (with code 0), ignore the rest. Signed-off-by: Andrew Shadura <[email protected]> Tested-by: Christian Gmeiner <[email protected] Signed-off-by: Jiri Kosina <[email protected]>
1 parent c2848f2 commit 5f66872

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/hid/hid-penmount.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,12 @@ static int penmount_input_mapping(struct hid_device *hdev,
2323
struct hid_usage *usage, unsigned long **bit, int *max)
2424
{
2525
if ((usage->hid & HID_USAGE_PAGE) == HID_UP_BUTTON) {
26-
hid_map_usage(hi, usage, bit, max, EV_KEY, BTN_TOUCH);
27-
return 1;
26+
if (((usage->hid - 1) & HID_USAGE) == 0) {
27+
hid_map_usage(hi, usage, bit, max, EV_KEY, BTN_TOUCH);
28+
return 1;
29+
} else {
30+
return -1;
31+
}
2832
}
2933

3034
return 0;

0 commit comments

Comments
 (0)