OSDN Git Service

HID: hid-multitouch: refactor last_field_index
authorBenjamin Tissoires <benjamin.tissoires@enac.fr>
Thu, 21 Apr 2011 12:15:59 +0000 (12:15 +0000)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Sat, 27 Aug 2011 10:48:47 +0000 (18:48 +0800)
commit4fa9425e88dab0b2ababdd50ebd5872b10adc506
treef41ca382c3f79757a792339454af8a9216577194
parent7e35640b1a743a256f5aaa8692dbf5a167ed95e3
HID: hid-multitouch: refactor last_field_index

the current implementation requires the devices to report
HID_DG_CONTACTCOUNT to set the last_field_index value.
However, devices reporting in serial mode (DWAV and PenMount)
do not send this field.
Other devices (3M) add other fields in the reports descriptor
that are not multitouch related at the end, thus the need to
add a special case in the default case when handling events.

A first work around has been set up but with PenMount devices,
we have reached the limit.

The idea is to calculate the last_field_index by relying only on
multitouch fields the device send. This allows us to remove
the handling of non-multitouch events in hid-multitouch, and
guarantee that the function mt_emit_event is always called.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
drivers/hid/hid-multitouch.c