From 7804302b14032d357d889e4a23e463eb6a6c5136 Mon Sep 17 00:00:00 2001 From: Anatolij Gustschin Date: Mon, 28 Jun 2010 01:25:19 -0700 Subject: [PATCH] Input: ads7846 - allow specifying irq trigger type in platform data On some platforms, for example with GPIO interrupts on mpc5121, it is not possible to configure falling edge interrupts. Specifying irq trigger type in platform data structure allows using ads7846 driver on such platforms. Signed-off-by: Anatolij Gustschin Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/ads7846.c | 5 ++++- include/linux/spi/ads7846.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index a9fdf55c0238..69210cb56c54 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c @@ -1174,7 +1174,10 @@ static int __devinit ads7846_probe(struct spi_device *spi) goto err_put_regulator; } - if (request_irq(spi->irq, ads7846_irq, IRQF_TRIGGER_FALLING, + if (!pdata->irq_flags) + pdata->irq_flags = IRQF_TRIGGER_FALLING; + + if (request_irq(spi->irq, ads7846_irq, pdata->irq_flags, spi->dev.driver->name, ts)) { dev_info(&spi->dev, "trying pin change workaround on irq %d\n", spi->irq); diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h index b4ae570d3c98..95d36bfb34bc 100644 --- a/include/linux/spi/ads7846.h +++ b/include/linux/spi/ads7846.h @@ -54,5 +54,6 @@ struct ads7846_platform_data { void (*filter_cleanup)(void *filter_data); void (*wait_for_sync)(void); bool wakeup; + unsigned long irq_flags; };