From: Benjamin Tissoires Date: Mon, 31 Mar 2014 17:27:10 +0000 (-0400) Subject: HID: core: do not scan constant input report X-Git-Tag: v3.12.21~73 X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=3802414792ab9256690acb4897e02102fb4bab67;p=unionfs-2.6.39.y.git HID: core: do not scan constant input report commit e24d0d399b2fce71b627043e900ef28283850482 upstream. 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. Signed-off-by: Benjamin Tissoires Signed-off-by: Jiri Kosina Signed-off-by: Jiri Slaby --- diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 30abb14ff61..0335f86502c 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) case HID_MAIN_ITEM_TAG_END_COLLECTION: break; 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++) hid_scan_input_usage(parser, parser->local.usage[i]); break;