diff options
| -rw-r--r-- | drivers/hid/hid-multitouch.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index a61ba42e1bff..6fb46d70f39d 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c | |||
| @@ -81,6 +81,9 @@ struct mt_device { | |||
| 81 | __u8 num_received; /* how many contacts we received */ | 81 | __u8 num_received; /* how many contacts we received */ |
| 82 | __u8 num_expected; /* expected last contact index */ | 82 | __u8 num_expected; /* expected last contact index */ |
| 83 | __u8 maxcontacts; | 83 | __u8 maxcontacts; |
| 84 | __u8 touches_by_report; /* how many touches are present in one report: | ||
| 85 | * 1 means we should use a serial protocol | ||
| 86 | * > 1 means hybrid (multitouch) protocol */ | ||
| 84 | bool curvalid; /* is the current contact valid? */ | 87 | bool curvalid; /* is the current contact valid? */ |
| 85 | struct mt_slot *slots; | 88 | struct mt_slot *slots; |
| 86 | }; | 89 | }; |
| @@ -365,6 +368,7 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi, | |||
| 365 | input_mt_init_slots(hi->input, td->maxcontacts); | 368 | input_mt_init_slots(hi->input, td->maxcontacts); |
| 366 | td->last_slot_field = usage->hid; | 369 | td->last_slot_field = usage->hid; |
| 367 | td->last_field_index = field->index; | 370 | td->last_field_index = field->index; |
| 371 | td->touches_by_report++; | ||
| 368 | return 1; | 372 | return 1; |
| 369 | case HID_DG_WIDTH: | 373 | case HID_DG_WIDTH: |
| 370 | hid_map_usage(hi, usage, bit, max, | 374 | hid_map_usage(hi, usage, bit, max, |
| @@ -670,6 +674,15 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
| 670 | if (ret) | 674 | if (ret) |
| 671 | goto fail; | 675 | goto fail; |
| 672 | 676 | ||
| 677 | if (!id && td->touches_by_report == 1) { | ||
| 678 | /* the device has been sent by hid-generic */ | ||
| 679 | mtclass = &td->mtclass; | ||
| 680 | mtclass->quirks |= MT_QUIRK_ALWAYS_VALID; | ||
| 681 | mtclass->quirks &= ~MT_QUIRK_NOT_SEEN_MEANS_UP; | ||
| 682 | mtclass->quirks &= ~MT_QUIRK_VALID_IS_INRANGE; | ||
| 683 | mtclass->quirks &= ~MT_QUIRK_VALID_IS_CONFIDENCE; | ||
| 684 | } | ||
| 685 | |||
| 673 | td->slots = kzalloc(td->maxcontacts * sizeof(struct mt_slot), | 686 | td->slots = kzalloc(td->maxcontacts * sizeof(struct mt_slot), |
| 674 | GFP_KERNEL); | 687 | GFP_KERNEL); |
| 675 | if (!td->slots) { | 688 | if (!td->slots) { |
