[PATCH] ignore-very-short-clicks-s3c2410_ts.patch
Nelson Castillo
nelsoneci at gmail.com
Thu Nov 27 20:27:34 CET 2008
With this patch the issue of the noisy clicks seems to be
alleviated. We ignore the first two points. If a click has less
than 3 points we ignore it.
On a normal click (I mean with at least 3 points) this patch
will delay the first DOWN event by 20 milliseconds.
I'm looking for a better solution but this one works and it should
make the driver more usable.
Signed-off-by: Nelson Castillo <nelsoneci at gmail.com>
---
drivers/input/touchscreen/s3c2410_ts.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c
index 9904088..5a31c4f 100644
--- a/drivers/input/touchscreen/s3c2410_ts.c
+++ b/drivers/input/touchscreen/s3c2410_ts.c
@@ -189,6 +189,7 @@ static void event_send_timer_f(unsigned long data)
static unsigned long running;
static int noop_counter;
int event_type;
+ static unsigned n_points;
if (unlikely(test_and_set_bit(0, &running))) {
mod_timer(&event_send_timer,
@@ -224,6 +225,9 @@ static void event_send_timer_f(unsigned long data)
!= sizeof(int) * 2))
goto ts_exit_error;
+ if (n_points++ < 2)
+ break;
+
if (ts.state == TS_STATE_PRESSED_PENDING)
ts_input_report(IE_DOWN, buf);
else
@@ -246,8 +250,12 @@ static void event_send_timer_f(unsigned long data)
/* We delay the UP event for a
* while to avoid jitter. If we get a DOWN
* event we do not send it. */
- ts_input_report(IE_UP, NULL);
+
+ if (n_points > 2)
+ ts_input_report(IE_UP, NULL);
+
ts.state = TS_STATE_STANDBY;
+ n_points = 0;
if (ts.tsf[0])
(ts.tsf[0]->api->clear)(ts.tsf[0]);
More information about the openmoko-kernel
mailing list