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

From
Henrik Rydberg <hidden>
Date
2012-05-10 12:41:29
Also in
lkml
Reply to
Benjamin Tissoires, 2012-05-10
quoted
As long as all existing devices are unaffected, it's fine, hence the question.
I checked all the reports descriptors that I have.
2 devices (one Stantum and one Irtouch) present an unrealistic
logical_max value (255). The thing is that if this logical_max is
false, and if the value is not provided, then I don't know how could I
retrieve the right value beside introducing a MT_CLS...

Henrik, do you think that 255 is two much for the slots?
It is large enough for us to start worrying about how we manage
memory, not to mention throughput. Since we do not really have devices
of that type yet, how about adding a MT_MAX_MAXCONTACT next to
MT_DEFAULT_MAXCONTACT, and use it as a sanity check, like so:

	if (!td->maxcontacts && field->logical_maximum <= MT_MAX_MAXCONTACT)
		td->maxcontacts = field->logical_maximum;

Then the default (10) would be picked for the suspect devices, just as
it is today.

Thanks,
Henrik
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