From: Oleksij Rempel <external.oleksij.rem...@de.bosch.com>

If zforce is not ready to process the interrupt, the touchscreen will
be lost forever. Make sure we enable the interrupt only if processing
is ready.

Signed-off-by: Oleksij Rempel <external.oleksij.rem...@de.bosch.com>
Signed-off-by: Dirk Behme <dirk.be...@de.bosch.com>
---
Changes in v2: No changes, just re-send

 drivers/input/touchscreen/zforce_ts.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/zforce_ts.c 
b/drivers/input/touchscreen/zforce_ts.c
index fdd00b1..fab1bb0 100644
--- a/drivers/input/touchscreen/zforce_ts.c
+++ b/drivers/input/touchscreen/zforce_ts.c
@@ -22,6 +22,7 @@
 #include <linux/slab.h>
 #include <linux/input.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/i2c.h>
 #include <linux/delay.h>
 #include <linux/gpio/consumer.h>
@@ -755,6 +756,7 @@ static int zforce_probe(struct i2c_client *client,
        struct zforce_ts *ts;
        struct input_dev *input_dev;
        int ret;
+       unsigned int irq;
 
        if (!pdata) {
                pdata = zforce_parse_dt(&client->dev);
@@ -859,6 +861,7 @@ static int zforce_probe(struct i2c_client *client,
 
        init_completion(&ts->command_done);
 
+       irq = client->irq;
        /*
         * The zforce pulls the interrupt low when it has data ready.
         * After it is triggered the isr thread runs until all the available
@@ -866,7 +869,8 @@ static int zforce_probe(struct i2c_client *client,
         * Therefore we can trigger the interrupt anytime it is low and do
         * not need to limit it to the interrupt edge.
         */
-       ret = devm_request_threaded_irq(&client->dev, client->irq,
+       irq_set_status_flags(irq, IRQ_NOAUTOEN);
+       ret = devm_request_threaded_irq(&client->dev, irq,
                                        zforce_irq, zforce_irq_thread,
                                        IRQF_TRIGGER_LOW | IRQF_ONESHOT,
                                        input_dev->name, ts);
@@ -879,6 +883,7 @@ static int zforce_probe(struct i2c_client *client,
 
        /* let the controller boot */
        zforce_reset_deassert(ts);
+       enable_irq(irq);
 
        ts->command_waiting = NOTIFICATION_BOOTCOMPLETE;
        if (wait_for_completion_timeout(&ts->command_done, WAIT_TIMEOUT) == 0)
-- 
2.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to