diff options
author | Iiro Valkonen <iiro.valkonen@atmel.com> | 2011-02-15 16:36:52 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-02-21 04:02:34 -0500 |
commit | 919ed895f0b4227da26ea1b0a1347db5010f105e (patch) | |
tree | eb81c0ee83be2171b831412460258027884c2a02 | |
parent | 71749f5c66e797a39600dae9de58aab3858dc488 (diff) |
Input: atmel_mxt_ts - allow board code to specify IRQ flags
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>
-rw-r--r-- | arch/arm/mach-s5pv210/mach-goni.c | 2 | ||||
-rw-r--r-- | drivers/input/touchscreen/atmel_mxt_ts.c | 7 | ||||
-rw-r--r-- | include/linux/i2c/atmel_mxt_ts.h | 1 |
3 files changed, 7 insertions, 3 deletions
diff --git a/arch/arm/mach-s5pv210/mach-goni.c b/arch/arm/mach-s5pv210/mach-goni.c index e9a7d340f4e1..be0eb7a2e612 100644 --- a/arch/arm/mach-s5pv210/mach-goni.c +++ b/arch/arm/mach-s5pv210/mach-goni.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/gpio_keys.h> | 25 | #include <linux/gpio_keys.h> |
26 | #include <linux/input.h> | 26 | #include <linux/input.h> |
27 | #include <linux/gpio.h> | 27 | #include <linux/gpio.h> |
28 | #include <linux/interrupt.h> | ||
28 | 29 | ||
29 | #include <asm/mach/arch.h> | 30 | #include <asm/mach/arch.h> |
30 | #include <asm/mach/map.h> | 31 | #include <asm/mach/map.h> |
@@ -231,6 +232,7 @@ static struct mxt_platform_data qt602240_platform_data = { | |||
231 | .threshold = 0x28, | 232 | .threshold = 0x28, |
232 | .voltage = 2800000, /* 2.8V */ | 233 | .voltage = 2800000, /* 2.8V */ |
233 | .orient = MXT_DIAGONAL, | 234 | .orient = MXT_DIAGONAL, |
235 | .irqflags = IRQF_TRIGGER_FALLING, | ||
234 | }; | 236 | }; |
235 | 237 | ||
236 | static struct s3c2410_platform_i2c i2c2_data __initdata = { | 238 | static struct s3c2410_platform_i2c i2c2_data __initdata = { |
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 52032ef3d3ab..d2e5864ca096 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c | |||
@@ -1106,11 +1106,12 @@ static void mxt_input_close(struct input_dev *dev) | |||
1106 | static int __devinit mxt_probe(struct i2c_client *client, | 1106 | static int __devinit mxt_probe(struct i2c_client *client, |
1107 | const struct i2c_device_id *id) | 1107 | const struct i2c_device_id *id) |
1108 | { | 1108 | { |
1109 | const struct mxt_platform_data *pdata = client->dev.platform_data; | ||
1109 | struct mxt_data *data; | 1110 | struct mxt_data *data; |
1110 | struct input_dev *input_dev; | 1111 | struct input_dev *input_dev; |
1111 | int error; | 1112 | int error; |
1112 | 1113 | ||
1113 | if (!client->dev.platform_data) | 1114 | if (!pdata) |
1114 | return -EINVAL; | 1115 | return -EINVAL; |
1115 | 1116 | ||
1116 | data = kzalloc(sizeof(struct mxt_data), GFP_KERNEL); | 1117 | data = kzalloc(sizeof(struct mxt_data), GFP_KERNEL); |
@@ -1149,7 +1150,7 @@ static int __devinit mxt_probe(struct i2c_client *client, | |||
1149 | 1150 | ||
1150 | data->client = client; | 1151 | data->client = client; |
1151 | data->input_dev = input_dev; | 1152 | data->input_dev = input_dev; |
1152 | data->pdata = client->dev.platform_data; | 1153 | data->pdata = pdata; |
1153 | data->irq = client->irq; | 1154 | data->irq = client->irq; |
1154 | 1155 | ||
1155 | i2c_set_clientdata(client, data); | 1156 | i2c_set_clientdata(client, data); |
@@ -1159,7 +1160,7 @@ static int __devinit mxt_probe(struct i2c_client *client, | |||
1159 | goto err_free_object; | 1160 | goto err_free_object; |
1160 | 1161 | ||
1161 | error = request_threaded_irq(client->irq, NULL, mxt_interrupt, | 1162 | error = request_threaded_irq(client->irq, NULL, mxt_interrupt, |
1162 | IRQF_TRIGGER_FALLING, client->dev.driver->name, data); | 1163 | pdata->irqflags, client->dev.driver->name, data); |
1163 | if (error) { | 1164 | if (error) { |
1164 | dev_err(&client->dev, "Failed to register interrupt\n"); | 1165 | dev_err(&client->dev, "Failed to register interrupt\n"); |
1165 | goto err_free_object; | 1166 | goto err_free_object; |
diff --git a/include/linux/i2c/atmel_mxt_ts.h b/include/linux/i2c/atmel_mxt_ts.h index b8297685f489..f027f7a63511 100644 --- a/include/linux/i2c/atmel_mxt_ts.h +++ b/include/linux/i2c/atmel_mxt_ts.h | |||
@@ -38,6 +38,7 @@ struct mxt_platform_data { | |||
38 | unsigned int threshold; | 38 | unsigned int threshold; |
39 | unsigned int voltage; | 39 | unsigned int voltage; |
40 | unsigned char orient; | 40 | unsigned char orient; |
41 | unsigned long irqflags; | ||
41 | }; | 42 | }; |
42 | 43 | ||
43 | #endif /* __LINUX_ATMEL_MXT_TS_H */ | 44 | #endif /* __LINUX_ATMEL_MXT_TS_H */ |