Commit 04a79181 authored by Daniel Kurtz's avatar Daniel Kurtz Committed by Henrik Rydberg

Input: atmel_mxt_ts - refactor reportid checking in mxt_interrupt

This small refactor is in preparation for checking more report types
in the mxt_interrupt message processing loop.
Signed-off-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
Signed-off-by: default avatarHenrik Rydberg <rydberg@euromail.se>
parent 333e5a9a
...@@ -554,6 +554,12 @@ static void mxt_input_touchevent(struct mxt_data *data, ...@@ -554,6 +554,12 @@ static void mxt_input_touchevent(struct mxt_data *data,
input_sync(input_dev); input_sync(input_dev);
} }
static bool mxt_is_T9_message(struct mxt_data *data, struct mxt_message *msg)
{
u8 id = msg->reportid;
return (id >= data->T9_reportid_min && id <= data->T9_reportid_max);
}
static irqreturn_t mxt_interrupt(int irq, void *dev_id) static irqreturn_t mxt_interrupt(int irq, void *dev_id)
{ {
struct mxt_data *data = dev_id; struct mxt_data *data = dev_id;
...@@ -561,8 +567,6 @@ static irqreturn_t mxt_interrupt(int irq, void *dev_id) ...@@ -561,8 +567,6 @@ static irqreturn_t mxt_interrupt(int irq, void *dev_id)
struct device *dev = &data->client->dev; struct device *dev = &data->client->dev;
int id; int id;
u8 reportid; u8 reportid;
u8 max_reportid;
u8 min_reportid;
do { do {
if (mxt_read_message(data, &message)) { if (mxt_read_message(data, &message)) {
...@@ -572,11 +576,9 @@ static irqreturn_t mxt_interrupt(int irq, void *dev_id) ...@@ -572,11 +576,9 @@ static irqreturn_t mxt_interrupt(int irq, void *dev_id)
reportid = message.reportid; reportid = message.reportid;
max_reportid = data->T9_reportid_max; id = reportid - data->T9_reportid_min;
min_reportid = data->T9_reportid_min;
id = reportid - min_reportid;
if (reportid >= min_reportid && reportid <= max_reportid) if (mxt_is_T9_message(data, &message))
mxt_input_touchevent(data, &message, id); mxt_input_touchevent(data, &message, id);
else else
mxt_dump_message(dev, &message); mxt_dump_message(dev, &message);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment