All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dirk Behme <dirk.behme@de.bosch.com>
To: linux-input@vger.kernel.org
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Oleksij Rempel <external.Oleksij.Rempel@de.bosch.com>,
	Dirk Behme <dirk.behme@de.bosch.com>
Subject: [PATCH 4/4 v2] Input: zforce - enable irq only if we are ready to process it
Date: Mon, 20 Jul 2015 14:56:37 +0200	[thread overview]
Message-ID: <1437396997-3182-5-git-send-email-dirk.behme@de.bosch.com> (raw)
In-Reply-To: <1437396997-3182-1-git-send-email-dirk.behme@de.bosch.com>

From: Oleksij Rempel <external.Oleksij.Rempel@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.Rempel@de.bosch.com>
Signed-off-by: Dirk Behme <dirk.behme@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


  parent reply	other threads:[~2015-07-20 12:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-20 12:56 [PATCH 0/4 v2] Input: zforce - update interrupt handling Dirk Behme
2015-07-20 12:56 ` [PATCH 1/4] Input: zforce - don't invert the interrupt GPIO Dirk Behme
2015-07-20 16:55   ` Dmitry Torokhov
2015-07-20 12:56 ` [PATCH 2/4] Input: zforce - swap reset and " Dirk Behme
2015-07-24 21:32   ` Dmitry Torokhov
2015-07-25  5:19     ` Dirk Behme
2015-07-27  8:12       ` Dirk Behme
2015-07-27 21:17         ` Dmitry Torokhov
2015-07-28  8:29           ` Dirk Behme
2015-07-27 21:18       ` Dmitry Torokhov
2015-07-20 12:56 ` [PATCH 3/4 v2] Input: zforce - make the interrupt GPIO optional Dirk Behme
2015-07-20 12:56 ` Dirk Behme [this message]
2015-07-21  8:47   ` [PATCH 4/4 v2] Input: zforce - enable irq only if we are ready to process it Dirk Behme

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1437396997-3182-5-git-send-email-dirk.behme@de.bosch.com \
    --to=dirk.behme@de.bosch.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=external.Oleksij.Rempel@de.bosch.com \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.