Skip to content

Commit

Permalink
HID: penmount: report only one button for PenMount 6000 USB touchscre…
Browse files Browse the repository at this point in the history
…en 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 <andrew.shadura@collabora.co.uk>
Tested-by: Christian Gmeiner <c.gmeiner@bachmann.info
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Andrew Shadura authored and Jiri Kosina committed Mar 10, 2016
1 parent c2848f2 commit 5f66872
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/hid/hid-penmount.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ static int penmount_input_mapping(struct hid_device *hdev,
struct hid_usage *usage, unsigned long **bit, int *max)
{
if ((usage->hid & HID_USAGE_PAGE) == HID_UP_BUTTON) {
hid_map_usage(hi, usage, bit, max, EV_KEY, BTN_TOUCH);
return 1;
if (((usage->hid - 1) & HID_USAGE) == 0) {
hid_map_usage(hi, usage, bit, max, EV_KEY, BTN_TOUCH);
return 1;
} else {
return -1;
}
}

return 0;
Expand Down

0 comments on commit 5f66872

Please sign in to comment.