aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/input/touchscreen/atmel_mxt_ts.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index 48f3637aecaa..a9e0b541c638 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -554,6 +554,12 @@ static void mxt_input_touchevent(struct mxt_data *data,
554 input_sync(input_dev); 554 input_sync(input_dev);
555} 555}
556 556
557static bool mxt_is_T9_message(struct mxt_data *data, struct mxt_message *msg)
558{
559 u8 id = msg->reportid;
560 return (id >= data->T9_reportid_min && id <= data->T9_reportid_max);
561}
562
557static irqreturn_t mxt_interrupt(int irq, void *dev_id) 563static irqreturn_t mxt_interrupt(int irq, void *dev_id)
558{ 564{
559 struct mxt_data *data = dev_id; 565 struct mxt_data *data = dev_id;
@@ -561,8 +567,6 @@ static irqreturn_t mxt_interrupt(int irq, void *dev_id)
561 struct device *dev = &data->client->dev; 567 struct device *dev = &data->client->dev;
562 int id; 568 int id;
563 u8 reportid; 569 u8 reportid;
564 u8 max_reportid;
565 u8 min_reportid;
566 570
567 do { 571 do {
568 if (mxt_read_message(data, &message)) { 572 if (mxt_read_message(data, &message)) {
@@ -572,11 +576,9 @@ static irqreturn_t mxt_interrupt(int irq, void *dev_id)
572 576
573 reportid = message.reportid; 577 reportid = message.reportid;
574 578
575 max_reportid = data->T9_reportid_max; 579 id = reportid - data->T9_reportid_min;
576 min_reportid = data->T9_reportid_min;
577 id = reportid - min_reportid;
578 580
579 if (reportid >= min_reportid && reportid <= max_reportid) 581 if (mxt_is_T9_message(data, &message))
580 mxt_input_touchevent(data, &message, id); 582 mxt_input_touchevent(data, &message, id);
581 else 583 else
582 mxt_dump_message(dev, &message); 584 mxt_dump_message(dev, &message);