Commit e24d0d39 authored by Benjamin Tissoires's avatar Benjamin Tissoires Committed by Jiri Kosina

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: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent f3b0cbce
...@@ -718,6 +718,9 @@ static int hid_scan_main(struct hid_parser *parser, struct hid_item *item) ...@@ -718,6 +718,9 @@ static int hid_scan_main(struct hid_parser *parser, struct hid_item *item)
case HID_MAIN_ITEM_TAG_END_COLLECTION: case HID_MAIN_ITEM_TAG_END_COLLECTION:
break; break;
case HID_MAIN_ITEM_TAG_INPUT: case HID_MAIN_ITEM_TAG_INPUT:
/* ignore constant inputs, they will be ignored by hid-input */
if (data & HID_MAIN_ITEM_CONSTANT)
break;
for (i = 0; i < parser->local.usage_index; i++) for (i = 0; i < parser->local.usage_index; i++)
hid_scan_input_usage(parser, parser->local.usage[i]); hid_scan_input_usage(parser, parser->local.usage[i]);
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment