]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
Input: ads7846 - allow specifying irq trigger type in platform data
authorAnatolij Gustschin <agust@denx.de>
Mon, 28 Jun 2010 08:25:19 +0000 (01:25 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 28 Jun 2010 08:34:25 +0000 (01:34 -0700)
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 <agust@denx.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/touchscreen/ads7846.c
include/linux/spi/ads7846.h

index a9fdf55c0238b14b4c6fa54fa257002f925d3daa..69210cb56c543c808bb15dffdb62cbb651009d03 100644 (file)
@@ -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);
index b4ae570d3c9876b090a4446f42a7ccc5c001c189..95d36bfb34bcaeed1daeae296a5e7a8c5701735d 100644 (file)
@@ -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;
 };