Input: atmel_mxt_ts - read whole message to make CHG low
authorIiro Valkonen <iiro.valkonen@atmel.com>
Fri, 4 Feb 2011 08:51:05 +0000 (00:51 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 21 Feb 2011 09:02:27 +0000 (01:02 -0800)
Read the whole message, as reading just the first byte isn't always
guaranteed to clear the message.

Signed-off-by: Iiro Valkonen <iiro.valkonen@atmel.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/touchscreen/atmel_mxt_ts.c

index 5dca78a00c9469967442dccf506dfebe6c9c9864..162a3bf019e42f05a41378f57cde715fdb2cf259 100644 (file)
@@ -823,16 +823,16 @@ static int mxt_check_matrix_size(struct mxt_data *data)
 static int mxt_make_highchg(struct mxt_data *data)
 {
        struct device *dev = &data->client->dev;
+       struct mxt_message message;
        int count = 10;
        int error;
-       u8 val;
 
        /* Read dummy message to make high CHG pin */
        do {
-               error = mxt_read_object(data, MXT_GEN_MESSAGE, 0, &val);
+               error = mxt_read_message(data, &message);
                if (error)
                        return error;
-       } while ((val != 0xff) && --count);
+       } while (message.reportid != 0xff && --count);
 
        if (!count) {
                dev_err(dev, "CHG pin isn't cleared\n");