Input: atmel_mxt_ts - allow board code to specify IRQ flags
authorIiro Valkonen <iiro.valkonen@atmel.com>
Tue, 15 Feb 2011 21:36:52 +0000 (13:36 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 21 Feb 2011 09:02:34 +0000 (01:02 -0800)
Different board have different requirements/setups so let's be more
flexible.

Signed-off-by: Iiro Valkonen <iiro.valkonen@atmel.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
arch/arm/mach-s5pv210/mach-goni.c
drivers/input/touchscreen/atmel_mxt_ts.c
include/linux/i2c/atmel_mxt_ts.h

index e9a7d340f4e1f84c45d2a6797bbe52a439d41280..be0eb7a2e61244b8b373460b25883562615a6a2d 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/gpio_keys.h>
 #include <linux/input.h>
 #include <linux/gpio.h>
+#include <linux/interrupt.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -231,6 +232,7 @@ static struct mxt_platform_data qt602240_platform_data = {
        .threshold      = 0x28,
        .voltage        = 2800000,              /* 2.8V */
        .orient         = MXT_DIAGONAL,
+       .irqflags       = IRQF_TRIGGER_FALLING,
 };
 
 static struct s3c2410_platform_i2c i2c2_data __initdata = {
index 52032ef3d3ab35d7be65f73e3aa3630e558047a7..d2e5864ca096ae8ce00db1ea47c8132241101ff2 100644 (file)
@@ -1106,11 +1106,12 @@ static void mxt_input_close(struct input_dev *dev)
 static int __devinit mxt_probe(struct i2c_client *client,
                const struct i2c_device_id *id)
 {
+       const struct mxt_platform_data *pdata = client->dev.platform_data;
        struct mxt_data *data;
        struct input_dev *input_dev;
        int error;
 
-       if (!client->dev.platform_data)
+       if (!pdata)
                return -EINVAL;
 
        data = kzalloc(sizeof(struct mxt_data), GFP_KERNEL);
@@ -1149,7 +1150,7 @@ static int __devinit mxt_probe(struct i2c_client *client,
 
        data->client = client;
        data->input_dev = input_dev;
-       data->pdata = client->dev.platform_data;
+       data->pdata = pdata;
        data->irq = client->irq;
 
        i2c_set_clientdata(client, data);
@@ -1159,7 +1160,7 @@ static int __devinit mxt_probe(struct i2c_client *client,
                goto err_free_object;
 
        error = request_threaded_irq(client->irq, NULL, mxt_interrupt,
-                       IRQF_TRIGGER_FALLING, client->dev.driver->name, data);
+                       pdata->irqflags, client->dev.driver->name, data);
        if (error) {
                dev_err(&client->dev, "Failed to register interrupt\n");
                goto err_free_object;
index b8297685f4898446c355cfa1184570d1bc4d4d38..f027f7a63511bbdcd0daf459e5dce65434117dcf 100644 (file)
@@ -38,6 +38,7 @@ struct mxt_platform_data {
        unsigned int threshold;
        unsigned int voltage;
        unsigned char orient;
+       unsigned long irqflags;
 };
 
 #endif /* __LINUX_ATMEL_MXT_TS_H */