Input: atmel_mxt_ts - disable interrupt for 50ms after reset
authorNick Dyer <nick.dyer@itdev.co.uk>
Tue, 4 Aug 2015 23:57:25 +0000 (16:57 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 5 Aug 2015 00:03:54 +0000 (17:03 -0700)
The CHG/interrupt line is momentarily set (approximately 100 ms) as an
input after power-up or reset for diagnostic purposes. This may cause
spurious interrupts, so disable interrupt handler during this period.

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/touchscreen/atmel_mxt_ts.c

index 08d9a0921798200bc46a7689cacd2f2977ca8542..d36da65f8c72b2c00c8d66405c767176da5072b3 100644 (file)
@@ -1098,7 +1098,9 @@ static int mxt_soft_reset(struct mxt_data *data)
        struct device *dev = &data->client->dev;
        int ret = 0;
 
-       dev_info(dev, "Resetting chip\n");
+       dev_info(dev, "Resetting device\n");
+
+       disable_irq(data->irq);
 
        reinit_completion(&data->reset_completion);
 
@@ -1106,6 +1108,11 @@ static int mxt_soft_reset(struct mxt_data *data)
        if (ret)
                return ret;
 
+       /* Ignore CHG line for 100ms after reset */
+       msleep(100);
+
+       enable_irq(data->irq);
+
        ret = mxt_wait_for_completion(data, &data->reset_completion,
                                      MXT_RESET_TIMEOUT);
        if (ret)