aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2014-03-31 13:27:10 -0400
committerJiri Kosina <jkosina@suse.cz>2014-04-07 03:55:25 -0400
commite24d0d399b2fce71b627043e900ef28283850482 (patch)
tree94ffabba4678d9e9bdcd77564043735a7fd96edb
parentf3b0cbce01cd5c242b420d986b208d306bdc5083 (diff)
HID: core: do not scan constant input report
The Microsoft Surface Type/Touch Cover 2 is a fancy device which advertised itself as a multitouch device but with constant input reports. This way, hid_scan_report() gives the group MULTITOUCH to it, but hid-multitouch can not handle it due to the constant collection ignored by hid-input. To prevent such crap in the future, and while we do not fix this particular device, make the scan_report coherent with hid-input.c, and ignore constant input reports. CC: stable@vger.kernel.org # 3.12+ Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r--drivers/hid/hid-core.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 3f488ff88e0c..10a2c0866459 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -718,6 +718,9 @@ static int hid_scan_main(struct hid_parser *parser, struct hid_item *item)
718 case HID_MAIN_ITEM_TAG_END_COLLECTION: 718 case HID_MAIN_ITEM_TAG_END_COLLECTION:
719 break; 719 break;
720 case HID_MAIN_ITEM_TAG_INPUT: 720 case HID_MAIN_ITEM_TAG_INPUT:
721 /* ignore constant inputs, they will be ignored by hid-input */
722 if (data & HID_MAIN_ITEM_CONSTANT)
723 break;
721 for (i = 0; i < parser->local.usage_index; i++) 724 for (i = 0; i < parser->local.usage_index; i++)
722 hid_scan_input_usage(parser, parser->local.usage[i]); 725 hid_scan_input_usage(parser, parser->local.usage[i]);
723 break; 726 break;