Commit 26cdb1ae authored by Iiro Valkonen's avatar Iiro Valkonen Committed by Dmitry Torokhov

Input: atmel_mxt_ts - read whole message to make CHG low

Read the whole message, as reading just the first byte isn't always
guaranteed to clear the message.
Signed-off-by: default avatarIiro Valkonen <iiro.valkonen@atmel.com>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 7686b108
...@@ -823,16 +823,16 @@ static int mxt_check_matrix_size(struct mxt_data *data) ...@@ -823,16 +823,16 @@ static int mxt_check_matrix_size(struct mxt_data *data)
static int mxt_make_highchg(struct mxt_data *data) static int mxt_make_highchg(struct mxt_data *data)
{ {
struct device *dev = &data->client->dev; struct device *dev = &data->client->dev;
struct mxt_message message;
int count = 10; int count = 10;
int error; int error;
u8 val;
/* Read dummy message to make high CHG pin */ /* Read dummy message to make high CHG pin */
do { do {
error = mxt_read_object(data, MXT_GEN_MESSAGE, 0, &val); error = mxt_read_message(data, &message);
if (error) if (error)
return error; return error;
} while ((val != 0xff) && --count); } while (message.reportid != 0xff && --count);
if (!count) { if (!count) {
dev_err(dev, "CHG pin isn't cleared\n"); dev_err(dev, "CHG pin isn't cleared\n");
......
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