From c57c0a2a0d019aa8108f1155f99098ea7e7e1ab3 Mon Sep 17 00:00:00 2001 From: Michael Roth Date: Wed, 10 Jun 2009 23:30:55 -0700 Subject: Input: ads7846 - pin change interrupt support Some SoCs support 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 Signed-off-by: Andrew Morton Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/ads7846.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'drivers/input') diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index 90f792c17ab3..ba9d38c3f412 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c @@ -1150,9 +1150,15 @@ static int __devinit ads7846_probe(struct spi_device *spi) 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); + err = request_irq(spi->irq, ads7846_irq, + IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, + spi->dev.driver->name, ts); + if (err) { + dev_dbg(&spi->dev, "irq %d busy?\n", spi->irq); + goto err_free_gpio; + } } err = ads784x_hwmon_register(spi, ts); -- cgit v1.2.3