Skip to content

Commit 64464ae

Browse files
djkurtzrydberg
authored andcommitted
Input: atmel_mxt_ts - send all MT-B slots in one input report
Each interrupt contains information for all contacts with changing properties. Process all of this information at once, and send it all in a a single input report (ie input events ending in EV_SYN/SYN_REPORT). This patch was tested using an MXT224E. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
1 parent cb15911 commit 64464ae

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

‎drivers/input/touchscreen/atmel_mxt_ts.c‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -547,9 +547,6 @@ static void mxt_input_touchevent(struct mxt_data *data,
547547
input_report_abs(input_dev, ABS_MT_PRESSURE, pressure);
548548
input_report_abs(input_dev, ABS_MT_TOUCH_MAJOR, area);
549549
}
550-
551-
input_mt_report_pointer_emulation(input_dev, false);
552-
input_sync(input_dev);
553550
}
554551

555552
static bool mxt_is_T9_message(struct mxt_data *data, struct mxt_message *msg)
@@ -565,6 +562,7 @@ static irqreturn_t mxt_interrupt(int irq, void *dev_id)
565562
struct device *dev = &data->client->dev;
566563
int id;
567564
u8 reportid;
565+
bool update_input = false;
568566

569567
do {
570568
if (mxt_read_message(data, &message)) {
@@ -576,12 +574,19 @@ static irqreturn_t mxt_interrupt(int irq, void *dev_id)
576574

577575
id = reportid - data->T9_reportid_min;
578576

579-
if (mxt_is_T9_message(data, &message))
577+
if (mxt_is_T9_message(data, &message)) {
580578
mxt_input_touchevent(data, &message, id);
581-
else
579+
update_input = true;
580+
} else {
582581
mxt_dump_message(dev, &message);
582+
}
583583
} while (reportid != 0xff);
584584

585+
if (update_input) {
586+
input_mt_report_pointer_emulation(data->input_dev, false);
587+
input_sync(data->input_dev);
588+
}
589+
585590
end:
586591
return IRQ_HANDLED;
587592
}

0 commit comments

Comments
 (0)