The multitouch extensions to the HID protocol allows for contact
data to be sent over several reports, which is also the case for
the 3M M2256PW touchscreen. This patch modifies the logic to only
synchronize the input layer when all contacts have been received.
Consequentially, the full 60-finger capacity of the device is enabled.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Acked-by: Stephane Chatty <chatty@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+#define MAX_SLOTS 60
+#define MAX_TRKID 59
+
struct mmm_finger {
__s32 x, y, w, h;
__u8 rank;
struct mmm_finger {
__s32 x, y, w, h;
__u8 rank;
- struct mmm_finger f[10];
+ struct mmm_finger f[MAX_SLOTS];
1, 1, 0, 0);
return 1;
case HID_DG_CONTACTID:
1, 1, 0, 0);
return 1;
case HID_DG_CONTACTID:
- field->logical_maximum = 59;
+ field->logical_maximum = MAX_TRKID;
hid_map_usage(hi, usage, bit, max,
EV_ABS, ABS_MT_TRACKING_ID);
return 1;
hid_map_usage(hi, usage, bit, max,
EV_ABS, ABS_MT_TRACKING_ID);
return 1;
* we need to iterate on all fingers to decide if we have a press
* or a release event in our touchscreen emulation.
*/
* we need to iterate on all fingers to decide if we have a press
* or a release event in our touchscreen emulation.
*/
- for (i = 0; i < 10; ++i) {
+ for (i = 0; i < MAX_SLOTS; ++i) {
struct mmm_finger *f = &md->f[i];
if (!f->valid) {
/* this finger is just placeholder data, ignore */
struct mmm_finger *f = &md->f[i];
if (!f->valid) {
/* this finger is just placeholder data, ignore */
} else if (released) {
input_event(input, EV_KEY, BTN_TOUCH, 0);
}
} else if (released) {
input_event(input, EV_KEY, BTN_TOUCH, 0);
}
md->f[md->curid].h = value;
break;
case HID_DG_CONTACTID:
md->f[md->curid].h = value;
break;
case HID_DG_CONTACTID:
+ value = clamp_val(value, 0, MAX_SLOTS - 1);
if (md->valid) {
md->curid = value;
md->f[value].touch = md->touch;
md->f[value].valid = 1;
if (md->valid) {
md->curid = value;
md->f[value].touch = md->touch;
md->f[value].valid = 1;
md->f[md->curid].y = value;
break;
case HID_DG_CONTACTCOUNT:
md->f[md->curid].y = value;
break;
case HID_DG_CONTACTCOUNT:
- mmm_filter_event(md, input);
+ if (value)
+ md->nexp = value;
+ if (md->nreal >= md->nexp) {
+ mmm_filter_event(md, input);
+ md->nreal = 0;
+ }
int ret;
struct mmm_data *md;
int ret;
struct mmm_data *md;
+ hdev->quirks |= HID_QUIRK_NO_INPUT_SYNC;
+
md = kzalloc(sizeof(struct mmm_data), GFP_KERNEL);
if (!md) {
dev_err(&hdev->dev, "cannot allocate 3M data\n");
md = kzalloc(sizeof(struct mmm_data), GFP_KERNEL);
if (!md) {
dev_err(&hdev->dev, "cannot allocate 3M data\n");