aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Reding <thierry.reding@avionic-design.de>2011-05-17 12:32:02 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2011-05-17 12:38:49 -0400
commit1af38eac8cdb70dbad3086b4f1bf7296eb1b09b1 (patch)
tree74a251236e74d963592da41cde26b60fe33b6f0a
parent2d137c7ed25f9754f52495af570897ad993e4fe7 (diff)
Input: tsc2007 - add poll_period parameter to platform data
This new parameter allows the polling frequency to be configured while keeping the default of once every millisecond. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-rw-r--r--drivers/input/touchscreen/tsc2007.c6
-rw-r--r--include/linux/i2c/tsc2007.h1
2 files changed, 4 insertions, 3 deletions
diff --git a/drivers/input/touchscreen/tsc2007.c b/drivers/input/touchscreen/tsc2007.c
index faa82ddb014b..87c40c79f71e 100644
--- a/drivers/input/touchscreen/tsc2007.c
+++ b/drivers/input/touchscreen/tsc2007.c
@@ -27,8 +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_PERIOD 1 /* ms delay between samples */
31
32#define TSC2007_MEASURE_TEMP0 (0x0 << 4) 30#define TSC2007_MEASURE_TEMP0 (0x0 << 4)
33#define TSC2007_MEASURE_AUX (0x2 << 4) 31#define TSC2007_MEASURE_AUX (0x2 << 4)
34#define TSC2007_MEASURE_TEMP1 (0x4 << 4) 32#define TSC2007_MEASURE_TEMP1 (0x4 << 4)
@@ -76,6 +74,7 @@ struct tsc2007 {
76 u16 x_plate_ohms; 74 u16 x_plate_ohms;
77 u16 max_rt; 75 u16 max_rt;
78 unsigned long poll_delay; 76 unsigned long poll_delay;
77 unsigned long poll_period;
79 78
80 bool pendown; 79 bool pendown;
81 int irq; 80 int irq;
@@ -230,7 +229,7 @@ static void tsc2007_work(struct work_struct *work)
230 out: 229 out:
231 if (ts->pendown || debounced) 230 if (ts->pendown || debounced)
232 schedule_delayed_work(&ts->work, 231 schedule_delayed_work(&ts->work,
233 msecs_to_jiffies(TS_POLL_PERIOD)); 232 msecs_to_jiffies(ts->poll_period));
234 else 233 else
235 enable_irq(ts->irq); 234 enable_irq(ts->irq);
236} 235}
@@ -297,6 +296,7 @@ static int __devinit tsc2007_probe(struct i2c_client *client,
297 ts->x_plate_ohms = pdata->x_plate_ohms; 296 ts->x_plate_ohms = pdata->x_plate_ohms;
298 ts->max_rt = pdata->max_rt ? : MAX_12BIT; 297 ts->max_rt = pdata->max_rt ? : MAX_12BIT;
299 ts->poll_delay = pdata->poll_delay ? : 1; 298 ts->poll_delay = pdata->poll_delay ? : 1;
299 ts->poll_period = pdata->poll_period ? : 1;
300 ts->get_pendown_state = pdata->get_pendown_state; 300 ts->get_pendown_state = pdata->get_pendown_state;
301 ts->clear_penirq = pdata->clear_penirq; 301 ts->clear_penirq = pdata->clear_penirq;
302 302
diff --git a/include/linux/i2c/tsc2007.h b/include/linux/i2c/tsc2007.h
index 342b130a0a98..a51dac081aca 100644
--- a/include/linux/i2c/tsc2007.h
+++ b/include/linux/i2c/tsc2007.h
@@ -9,6 +9,7 @@ struct tsc2007_platform_data {
9 u16 max_rt; /* max. resistance above which samples are ignored */ 9 u16 max_rt; /* max. resistance above which samples are ignored */
10 unsigned long poll_delay; /* delay (in ms) after pen-down event 10 unsigned long poll_delay; /* delay (in ms) after pen-down event
11 before polling starts */ 11 before polling starts */
12 unsigned long poll_period; /* time (in ms) between samples */
12 13
13 int (*get_pendown_state)(void); 14 int (*get_pendown_state)(void);
14 void (*clear_penirq)(void); /* If needed, clear 2nd level 15 void (*clear_penirq)(void); /* If needed, clear 2nd level