aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/tsc2007.c
diff options
context:
space:
mode:
authorThierry Reding <thierry.reding@avionic-design.de>2011-05-17 12:31:33 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2011-05-17 12:38:43 -0400
commit2d137c7ed25f9754f52495af570897ad993e4fe7 (patch)
tree0d5a131c68022d5b3b24867e65731bf7e85d831c /drivers/input/touchscreen/tsc2007.c
parent84005eb5ea2939d448047fcf6924b3b9b6ed974d (diff)
Input: tsc2007 - add poll_delay parameter to platform data
Depending on the quality of the touch panel, the time for the X-, X+, Y- and Y+ inputs to settle may vary. The poll_delay parameter can be used to override the default of 1 millisecond. Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: Kwangwoo Lee <kwangwoo.lee@gmail.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/touchscreen/tsc2007.c')
-rw-r--r--drivers/input/touchscreen/tsc2007.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/input/touchscreen/tsc2007.c b/drivers/input/touchscreen/tsc2007.c
index 8c48a91a6783..faa82ddb014b 100644
--- a/drivers/input/touchscreen/tsc2007.c
+++ b/drivers/input/touchscreen/tsc2007.c
@@ -27,7 +27,6 @@
27#include <linux/i2c.h> 27#include <linux/i2c.h>
28#include <linux/i2c/tsc2007.h> 28#include <linux/i2c/tsc2007.h>
29 29
30#define TS_POLL_DELAY 1 /* ms delay between samples */
31#define TS_POLL_PERIOD 1 /* ms delay between samples */ 30#define TS_POLL_PERIOD 1 /* ms delay between samples */
32 31
33#define TSC2007_MEASURE_TEMP0 (0x0 << 4) 32#define TSC2007_MEASURE_TEMP0 (0x0 << 4)
@@ -76,6 +75,7 @@ struct tsc2007 {
76 u16 model; 75 u16 model;
77 u16 x_plate_ohms; 76 u16 x_plate_ohms;
78 u16 max_rt; 77 u16 max_rt;
78 unsigned long poll_delay;
79 79
80 bool pendown; 80 bool pendown;
81 int irq; 81 int irq;
@@ -242,7 +242,7 @@ static irqreturn_t tsc2007_irq(int irq, void *handle)
242 if (!ts->get_pendown_state || likely(ts->get_pendown_state())) { 242 if (!ts->get_pendown_state || likely(ts->get_pendown_state())) {
243 disable_irq_nosync(ts->irq); 243 disable_irq_nosync(ts->irq);
244 schedule_delayed_work(&ts->work, 244 schedule_delayed_work(&ts->work,
245 msecs_to_jiffies(TS_POLL_DELAY)); 245 msecs_to_jiffies(ts->poll_delay));
246 } 246 }
247 247
248 if (ts->clear_penirq) 248 if (ts->clear_penirq)
@@ -296,6 +296,7 @@ static int __devinit tsc2007_probe(struct i2c_client *client,
296 ts->model = pdata->model; 296 ts->model = pdata->model;
297 ts->x_plate_ohms = pdata->x_plate_ohms; 297 ts->x_plate_ohms = pdata->x_plate_ohms;
298 ts->max_rt = pdata->max_rt ? : MAX_12BIT; 298 ts->max_rt = pdata->max_rt ? : MAX_12BIT;
299 ts->poll_delay = pdata->poll_delay ? : 1;
299 ts->get_pendown_state = pdata->get_pendown_state; 300 ts->get_pendown_state = pdata->get_pendown_state;
300 ts->clear_penirq = pdata->clear_penirq; 301 ts->clear_penirq = pdata->clear_penirq;
301 302