Re: [PATCH 2/5] HID: hid-multitouch: get maxcontacts also from logical_max value

From
Benjamin Tissoires <hidden>
Date
2012-05-09 19:13:10
Also in
lkml
Reply to
Henrik Rydberg, 2012-05-06
On Sun, May 6, 2012 at 9:03 PM, Henrik Rydberg [off-list ref] wrote:
Hi,
quoted
Win8 devices are required to present the feature "Maximum Contact Number".
If the current value is 0, then, the driver can get the actual supported
contact count by seeing the logical_max.
And for win7, it is zero?
Well, the truth is that the Win8 specification formally describes the
values here. And to get the certification, hardware makers have to put
the right value in logical_max.
TBH, I don't care that much now with win7 devices. Most of them are a
piece of crap (not true dual fingers, problems in hid reports
descriptors, etc...), but they just work (we made the necessary
things). With the introduction of Win8, hardware makers will have to
*certify* their devices, and thus, the Win8 driver is much less
tolerant. I really think that we are going to see more and more win8
devices, whereas win7 devices will fade out.

I had to add this patch because I have a win8 device that has the
value associated to this field at 0, and it's the first I saw with
this behavior.

Cheers,
Benjamin
quoted
Signed-off-by: Benjamin Tissoires <redacted>
---
 drivers/hid/hid-multitouch.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index c6ffb05..e205d1e 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -265,6 +265,8 @@ static void mt_feature_mapping(struct hid_device *hdev,
      case HID_DG_CONTACTMAX:
              td->maxcontact_report_id = field->report->id;
              td->maxcontacts = field->value[0];
+             if (!td->maxcontacts)
+                     td->maxcontacts = field->logical_maximum;
              if (td->mtclass.maxcontacts)
                      /* check if the maxcontacts is given by the class */
                      td->maxcontacts = td->mtclass.maxcontacts;
--
1.7.7.6
Thanks,
Henrik
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Thread (24 messages) 24 messages, 4 authors, last reply 2012-05-21
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help