aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorAndrew Shadura <andrew.shadura@collabora.co.uk>2015-10-29 16:09:49 +0100
committerJiri Kosina <jkosina@suse.cz>2016-03-10 17:17:26 +0100
commit5f66872cbd9c2d8e5230da571aed52d9333a04ae (patch)
treed7188c14cda49906ae842ea13bceabac2801c2b1 /drivers/hid
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid (diff)
downloadlinux-dev-5f66872cbd9c2d8e5230da571aed52d9333a04ae.tar.xz
linux-dev-5f66872cbd9c2d8e5230da571aed52d9333a04ae.zip
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 <andrew.shadura@collabora.co.uk> Tested-by: Christian Gmeiner <c.gmeiner@bachmann.info Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-penmount.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/hid/hid-penmount.c b/drivers/hid/hid-penmount.c
index c11dce85cd18..d90383f788e2 100644
--- a/drivers/hid/hid-penmount.c
+++ b/drivers/hid/hid-penmount.c
@@ -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;