linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] Input: tsc2007 - Disable irq when the irq thread is handling data
@ 2011-11-29  8:12 Feng Tang
  2011-11-29  8:12 ` [PATCH 2/2] Input: tsc2007 - Add a z1_low_threshhold platform data parameter Feng Tang
  2011-11-29  9:22 ` [PATCH 1/2] Input: tsc2007 - Disable irq when the irq thread is handling data Dmitry Torokhov
  0 siblings, 2 replies; 17+ messages in thread
From: Feng Tang @ 2011-11-29  8:12 UTC (permalink / raw)
  To: dtor, linux-input, linux-kernel, kwlee; +Cc: joel.clark, Feng Tang

The TSC2007 data sheet say in some case the HW may fire some false
interrrupt, which I also met during integrating one TSC2007 device.
So add the disable_irq/enable_irq protection around data handling.

Signed-off-by: Feng Tang <feng.tang@intel.com>
---
 drivers/input/touchscreen/tsc2007.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/input/touchscreen/tsc2007.c b/drivers/input/touchscreen/tsc2007.c
index 1f674cb..789f216 100644
--- a/drivers/input/touchscreen/tsc2007.c
+++ b/drivers/input/touchscreen/tsc2007.c
@@ -171,6 +171,13 @@ static irqreturn_t tsc2007_soft_irq(int irq, void *handle)
 	struct ts_event tc;
 	u32 rt;
 
+	/*
+	 * Disable the irq, as it may fire several other IRQs during
+	 * this thread is handling data, as suggested by the TSC2007
+	 * datasheet, p19, "Touch Detect" chapter
+	 */
+	disable_irq_nosync(irq);
+
 	while (!ts->stopped && tsc2007_is_pen_down(ts)) {
 
 		/* pen is down, continue with the measurement */
@@ -221,6 +228,7 @@ static irqreturn_t tsc2007_soft_irq(int irq, void *handle)
 	if (ts->clear_penirq)
 		ts->clear_penirq();
 
+	enable_irq(irq);
 	return IRQ_HANDLED;
 }
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2011-12-26  3:16 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-29  8:12 [PATCH 1/2] Input: tsc2007 - Disable irq when the irq thread is handling data Feng Tang
2011-11-29  8:12 ` [PATCH 2/2] Input: tsc2007 - Add a z1_low_threshhold platform data parameter Feng Tang
2011-11-29  9:23   ` Dmitry Torokhov
2011-11-30  2:34     ` Feng Tang
2011-12-01  5:47       ` Dmitry Torokhov
2011-12-01  6:19         ` Feng Tang
2011-12-01  8:45           ` Dmitry Torokhov
2011-12-01  9:04             ` Feng Tang
2011-12-04  8:54               ` Dmitry Torokhov
2011-12-05  5:35                 ` Feng Tang
2011-12-26  3:16                   ` Feng Tang
2011-11-29  9:22 ` [PATCH 1/2] Input: tsc2007 - Disable irq when the irq thread is handling data Dmitry Torokhov
2011-11-30  2:08   ` Feng Tang
2011-12-01  6:10     ` Dmitry Torokhov
2011-12-01  6:30       ` Feng Tang
2011-12-01  8:48         ` Dmitry Torokhov
2011-12-01  9:00           ` Feng Tang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).