aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-multitouch.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/hid-multitouch.c')
-rw-r--r--drivers/hid/hid-multitouch.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 3d2e6bbb004..9c7415ff4aa 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -121,6 +121,7 @@ struct mt_device {
121#define MT_CLS_GENERALTOUCH_PWT_TENFINGERS 0x0109 121#define MT_CLS_GENERALTOUCH_PWT_TENFINGERS 0x0109
122 122
123#define MT_DEFAULT_MAXCONTACT 10 123#define MT_DEFAULT_MAXCONTACT 10
124#define MT_MAX_MAXCONTACT 250
124 125
125#define MT_USB_DEVICE(v, p) HID_DEVICE(BUS_USB, HID_GROUP_MULTITOUCH, v, p) 126#define MT_USB_DEVICE(v, p) HID_DEVICE(BUS_USB, HID_GROUP_MULTITOUCH, v, p)
126#define MT_BT_DEVICE(v, p) HID_DEVICE(BUS_BLUETOOTH, HID_GROUP_MULTITOUCH, v, p) 127#define MT_BT_DEVICE(v, p) HID_DEVICE(BUS_BLUETOOTH, HID_GROUP_MULTITOUCH, v, p)
@@ -282,6 +283,9 @@ static void mt_feature_mapping(struct hid_device *hdev,
282 case HID_DG_CONTACTMAX: 283 case HID_DG_CONTACTMAX:
283 td->maxcontact_report_id = field->report->id; 284 td->maxcontact_report_id = field->report->id;
284 td->maxcontacts = field->value[0]; 285 td->maxcontacts = field->value[0];
286 if (!td->maxcontacts &&
287 field->logical_maximum <= MT_MAX_MAXCONTACT)
288 td->maxcontacts = field->logical_maximum;
285 if (td->mtclass.maxcontacts) 289 if (td->mtclass.maxcontacts)
286 /* check if the maxcontacts is given by the class */ 290 /* check if the maxcontacts is given by the class */
287 td->maxcontacts = td->mtclass.maxcontacts; 291 td->maxcontacts = td->mtclass.maxcontacts;