LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH] ads7846: Pin change interrupt support
@ 2009-01-17  0:06 Michael Roth
  0 siblings, 0 replies; only message in thread
From: Michael Roth @ 2009-01-17  0:06 UTC (permalink / raw
  To: linux-kernel; +Cc: dmitry.torokhov, imre.deak

Some SoC supports only pin change interrupts on GPIO pins
used as irq lines.

The ads7846 core is not affected from the additional irqs
on the rising edge because the code accounts touch bounce
anyway by kicking in a timer and disabling the irq after
the first request and reenabling the irq after a timeout
when there is no longer pen down detected.

Signed-off-by: Michael Roth <mroth@nessie.de>
---
diff -ur linux-2.6.28/drivers/input/touchscreen/ads7846.c linux-2.6.28-work/drivers/input/touchscreen/ads7846.c
--- linux-2.6.28/drivers/input/touchscreen/ads7846.c    2008-12-25 00:26:37.000000000 +0100
+++ linux-2.6.28-work/drivers/input/touchscreen/ads7846.c       2009-01-17 00:40:15.000000000 +0100
@@ -1131,9 +1131,14 @@

        if (request_irq(spi->irq, ads7846_irq, IRQF_TRIGGER_FALLING,
                        spi->dev.driver->name, ts)) {
-               dev_dbg(&spi->dev, "irq %d busy?\n", spi->irq);
-               err = -EBUSY;
-               goto err_free_gpio;
+               dev_info(&spi->dev, "trying pin change workaround on irq %d\n", spi->irq);
+               if (request_irq(spi->irq, ads7846_irq,
+                               IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
+                               spi->dev.driver->name, ts)) {
+                       dev_dbg(&spi->dev, "irq %d busy?\n", spi->irq);
+                       err = -EBUSY;
+                       goto err_free_gpio;
+               }
        }

        err = ads784x_hwmon_register(spi, ts);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-01-17  0:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-17  0:06 [PATCH] ads7846: Pin change interrupt support Michael Roth

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 read-only IMAP folder(s) and NNTP newsgroup(s).