diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-19 00:52:31 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-19 00:52:31 +0100 |
commit | c6b9e73f2fee8bb86058f296de808b326473456b (patch) | |
tree | e2f71a4f3aa209afac3009ffe9de2985ad477fe3 /drivers/hid/hid-ntrig.c | |
parent | Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable (diff) | |
parent | HID: avoid '\0' in hid debugfs events file (diff) | |
download | linux-c6b9e73f2fee8bb86058f296de808b326473456b.tar.xz linux-c6b9e73f2fee8bb86058f296de808b326473456b.zip |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
HID: avoid '\0' in hid debugfs events file
HID: Add RGT Clutch Wheel clutch device id
HID: ntrig: fix touch events
HID: add quirk for UC-Logik WP4030 tablet
HID: magicmouse: fix oops after device removal
Diffstat (limited to 'drivers/hid/hid-ntrig.c')
-rw-r--r-- | drivers/hid/hid-ntrig.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/hid/hid-ntrig.c b/drivers/hid/hid-ntrig.c index 3234c729a895..edcc0c4247bb 100644 --- a/drivers/hid/hid-ntrig.c +++ b/drivers/hid/hid-ntrig.c @@ -140,6 +140,9 @@ static int ntrig_event (struct hid_device *hid, struct hid_field *field, nd->reading_mt = 1; nd->first_contact_confidence = 0; break; + case HID_DG_TIPSWITCH: + /* Prevent emission of touch until validated */ + return 1; case HID_DG_CONFIDENCE: nd->confidence = value; break; @@ -259,6 +262,7 @@ static int ntrig_event (struct hid_device *hid, struct hid_field *field, BTN_TOOL_TRIPLETAP, 0); input_report_key(input, BTN_TOOL_QUADTAP, 0); + input_report_key(input, BTN_TOUCH, 0); } break; @@ -308,13 +312,20 @@ static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id) list_for_each_entry(hidinput, &hdev->inputs, list) { + if (hidinput->report->maxfield < 1) + continue; + input = hidinput->input; switch (hidinput->report->field[0]->application) { case HID_DG_PEN: input->name = "N-Trig Pen"; break; case HID_DG_TOUCHSCREEN: + /* These keys are redundant for fingers, clear them + * to prevent incorrect identification */ __clear_bit(BTN_TOOL_PEN, input->keybit); + __clear_bit(BTN_TOOL_FINGER, input->keybit); + __clear_bit(BTN_0, input->keybit); /* * A little something special to enable * two and three finger taps. |