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>
This commit is contained in:
Родитель
84005eb5ea
Коммит
2d137c7ed2
|
@ -27,7 +27,6 @@
|
||||||
#include <linux/i2c.h>
|
#include <linux/i2c.h>
|
||||||
#include <linux/i2c/tsc2007.h>
|
#include <linux/i2c/tsc2007.h>
|
||||||
|
|
||||||
#define TS_POLL_DELAY 1 /* ms delay between samples */
|
|
||||||
#define TS_POLL_PERIOD 1 /* ms delay between samples */
|
#define TS_POLL_PERIOD 1 /* ms delay between samples */
|
||||||
|
|
||||||
#define TSC2007_MEASURE_TEMP0 (0x0 << 4)
|
#define TSC2007_MEASURE_TEMP0 (0x0 << 4)
|
||||||
|
@ -76,6 +75,7 @@ struct tsc2007 {
|
||||||
u16 model;
|
u16 model;
|
||||||
u16 x_plate_ohms;
|
u16 x_plate_ohms;
|
||||||
u16 max_rt;
|
u16 max_rt;
|
||||||
|
unsigned long poll_delay;
|
||||||
|
|
||||||
bool pendown;
|
bool pendown;
|
||||||
int irq;
|
int irq;
|
||||||
|
@ -242,7 +242,7 @@ static irqreturn_t tsc2007_irq(int irq, void *handle)
|
||||||
if (!ts->get_pendown_state || likely(ts->get_pendown_state())) {
|
if (!ts->get_pendown_state || likely(ts->get_pendown_state())) {
|
||||||
disable_irq_nosync(ts->irq);
|
disable_irq_nosync(ts->irq);
|
||||||
schedule_delayed_work(&ts->work,
|
schedule_delayed_work(&ts->work,
|
||||||
msecs_to_jiffies(TS_POLL_DELAY));
|
msecs_to_jiffies(ts->poll_delay));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ts->clear_penirq)
|
if (ts->clear_penirq)
|
||||||
|
@ -296,6 +296,7 @@ static int __devinit tsc2007_probe(struct i2c_client *client,
|
||||||
ts->model = pdata->model;
|
ts->model = pdata->model;
|
||||||
ts->x_plate_ohms = pdata->x_plate_ohms;
|
ts->x_plate_ohms = pdata->x_plate_ohms;
|
||||||
ts->max_rt = pdata->max_rt ? : MAX_12BIT;
|
ts->max_rt = pdata->max_rt ? : MAX_12BIT;
|
||||||
|
ts->poll_delay = pdata->poll_delay ? : 1;
|
||||||
ts->get_pendown_state = pdata->get_pendown_state;
|
ts->get_pendown_state = pdata->get_pendown_state;
|
||||||
ts->clear_penirq = pdata->clear_penirq;
|
ts->clear_penirq = pdata->clear_penirq;
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,8 @@ struct tsc2007_platform_data {
|
||||||
u16 model; /* 2007. */
|
u16 model; /* 2007. */
|
||||||
u16 x_plate_ohms;
|
u16 x_plate_ohms;
|
||||||
u16 max_rt; /* max. resistance above which samples are ignored */
|
u16 max_rt; /* max. resistance above which samples are ignored */
|
||||||
|
unsigned long poll_delay; /* delay (in ms) after pen-down event
|
||||||
|
before polling starts */
|
||||||
|
|
||||||
int (*get_pendown_state)(void);
|
int (*get_pendown_state)(void);
|
||||||
void (*clear_penirq)(void); /* If needed, clear 2nd level
|
void (*clear_penirq)(void); /* If needed, clear 2nd level
|
||||||
|
|
Загрузка…
Ссылка в новой задаче