# Re: \[PATCH 2/2\] HID: core: do not scan constant input report

- From: Reyad Attiyat \<hidden\>
- Date: 2014-03-31 20:59:46 
- List: linux-input
- Page: https://ratatoskr.run/linux-input/2014/03/4225842
- Thread: https://ratatoskr.run/linux-input/2014/03/4225842/t.md

```text
Tested on Surface Pro 2 Type Cover 2 on kernel 3.15/multitouch rebased
on 3.14. The device is now handled by hid-generic and hid-sensor-hub
as expected.
There is a newer UEFI and touch cover firmware that I have not tried,
as you need windows update to get drivers for this device. I will try
and update my device to make sure we don't need any
quirks.

> On Mon, Mar 31, 2014 at 12:27 PM, Benjamin Tissoires
> [ref] wrote:
>> 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: <redacted> # 3.12+
>> Signed-off-by: Benjamin Tissoires <redacted>
>> ---
>>  drivers/hid/hid-core.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
>> index bb5c494..8a5384c 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;
>> --
>> 1.9.0
>>
```
