From 31e34d2f5e2f3dc8cd9785fbd74be76002dae7f1 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Tue, 6 Mar 2012 17:57:06 +0100 Subject: [PATCH] --- yaml --- r: 291642 b: refs/heads/master c: 9e87f22ac6353b50425c5da412fe2418a48e25a3 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/hid/hid-multitouch.c | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 1217af543b6f..ab9b1f81cab9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8d179a9ef25a64b451e2bbd46f6a6c16c6a72eb1 +refs/heads/master: 9e87f22ac6353b50425c5da412fe2418a48e25a3 diff --git a/trunk/drivers/hid/hid-multitouch.c b/trunk/drivers/hid/hid-multitouch.c index a61ba42e1bff..6fb46d70f39d 100644 --- a/trunk/drivers/hid/hid-multitouch.c +++ b/trunk/drivers/hid/hid-multitouch.c @@ -81,6 +81,9 @@ struct mt_device { __u8 num_received; /* how many contacts we received */ __u8 num_expected; /* expected last contact index */ __u8 maxcontacts; + __u8 touches_by_report; /* how many touches are present in one report: + * 1 means we should use a serial protocol + * > 1 means hybrid (multitouch) protocol */ bool curvalid; /* is the current contact valid? */ struct mt_slot *slots; }; @@ -365,6 +368,7 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi, input_mt_init_slots(hi->input, td->maxcontacts); td->last_slot_field = usage->hid; td->last_field_index = field->index; + td->touches_by_report++; return 1; case HID_DG_WIDTH: 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) if (ret) goto fail; + if (!id && td->touches_by_report == 1) { + /* the device has been sent by hid-generic */ + mtclass = &td->mtclass; + mtclass->quirks |= MT_QUIRK_ALWAYS_VALID; + mtclass->quirks &= ~MT_QUIRK_NOT_SEEN_MEANS_UP; + mtclass->quirks &= ~MT_QUIRK_VALID_IS_INRANGE; + mtclass->quirks &= ~MT_QUIRK_VALID_IS_CONFIDENCE; + } + td->slots = kzalloc(td->maxcontacts * sizeof(struct mt_slot), GFP_KERNEL); if (!td->slots) {