@@ -27,8 +27,6 @@
#include <linux/i2c.h>
#include <linux/i2c/tsc2007.h>
-#define TS_POLL_PERIOD 1 /* ms delay between samples */
-
#define TSC2007_MEASURE_TEMP0 (0x0 << 4)
#define TSC2007_MEASURE_AUX (0x2 << 4)
#define TSC2007_MEASURE_TEMP1 (0x4 << 4)
@@ -86,6 +84,10 @@ static int poll_delay = 1;
module_param(poll_delay, int, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(poll_delay, "Delay (in ms) after pen-down event before polling starts");
+static int poll_period = 1;
+module_param(poll_period, int, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(poll_period, "Time (in ms) between successive samples");
+
static int max_rt = MAX_12BIT;
module_param(max_rt, int, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(max_rt, "Maximum resistance above which samples are ignored");
@@ -236,7 +238,7 @@ static void tsc2007_work(struct work_struct *work)
out:
if (ts->pendown || debounced)
schedule_delayed_work(&ts->work,
- msecs_to_jiffies(TS_POLL_PERIOD));
+ msecs_to_jiffies(poll_period));
else
enable_irq(ts->irq);
}
This new parameter allows the polling frequency to be configured while keeping the default of once every millisecond. Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: Kwangwoo Lee <kwlee@mtekvision.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> --- drivers/input/touchscreen/tsc2007.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-)