spi-gpio: Implement spidelay for busses that need it.
[openwrt.git] / target / linux / s3c24xx / patches-2.6.24 / 1287-soft_tap.patch.patch
1 From eff39cde0d3cdd2afd5e1b4be5a8eb6cf195543e Mon Sep 17 00:00:00 2001
2 From: Dima Kogan <dkogan@cds.caltech.edu>
3 Date: Thu, 11 Sep 2008 20:38:55 +0800
4 Subject: [PATCH] soft_tap.patch
5
6 Hi all.
7
8 I'm seeing a behavior in my freerunner where light taps on the
9 touchscreen are not registered as clicks by the kernel even though the
10 base hardware does report clicking events. I'm seeing the kernel
11 generate extra "unclick" events in these cases. It looks like in the
12 driver, an unclick event is processed before the click event, thus
13 suppressing the click from ever being generated. I'm attaching a patch
14 that addresses this. I'm now able to type much faster on the matchbox
15 keyboard, even when using my fingertips instead of fingernails.
16
17 Dima
18
19 Signed-off-by: Dima Kogan <dkogan@cds.caltech.edu>
20 ---
21 drivers/input/touchscreen/s3c2410_ts.c | 17 +++++++++++++++++
22 1 files changed, 17 insertions(+), 0 deletions(-)
23
24 diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c
25 index 9fb95c1..fc1c500 100644
26 --- a/drivers/input/touchscreen/s3c2410_ts.c
27 +++ b/drivers/input/touchscreen/s3c2410_ts.c
28 @@ -118,6 +118,7 @@ struct s3c2410ts {
29 struct s3c2410ts_sample raw_running_avg;
30 int reject_threshold_vs_avg;
31 int flag_previous_exceeded_threshold;
32 + int flag_first_touch_sent;
33 };
34
35 static struct s3c2410ts ts;
36 @@ -130,6 +131,7 @@ static void clear_raw_fifo(void)
37 ts.raw_running_avg.x = 0;
38 ts.raw_running_avg.y = 0;
39 ts.flag_previous_exceeded_threshold = 0;
40 + ts.flag_first_touch_sent = 0;
41 }
42
43
44 @@ -153,6 +155,19 @@ static void touch_timer_fire(unsigned long data)
45 updown = (!(data0 & S3C2410_ADCDAT0_UPDOWN)) &&
46 (!(data1 & S3C2410_ADCDAT0_UPDOWN));
47
48 + // if we need to send an untouch event, but we haven't yet sent the
49 + // touch event (this happens if the touchscreen was tapped lightly),
50 + // send the touch event first
51 + if (!updown && !ts.flag_first_touch_sent && ts.count != 0) {
52 + input_report_abs(ts.dev, ABS_X, ts.xp >> ts.shift);
53 + input_report_abs(ts.dev, ABS_Y, ts.yp >> ts.shift);
54 +
55 + input_report_key(ts.dev, BTN_TOUCH, 1);
56 + input_report_abs(ts.dev, ABS_PRESSURE, 1);
57 + input_sync(ts.dev);
58 + ts.flag_first_touch_sent = 1;
59 + }
60 +
61 if (updown) {
62 if (ts.count != 0) {
63 ts.xp >>= ts.shift;
64 @@ -174,6 +189,7 @@ static void touch_timer_fire(unsigned long data)
65 input_report_key(ts.dev, BTN_TOUCH, 1);
66 input_report_abs(ts.dev, ABS_PRESSURE, 1);
67 input_sync(ts.dev);
68 + ts.flag_first_touch_sent = 1;
69 }
70
71 ts.xp = 0;
72 @@ -190,6 +206,7 @@ static void touch_timer_fire(unsigned long data)
73 input_report_key(ts.dev, BTN_TOUCH, 0);
74 input_report_abs(ts.dev, ABS_PRESSURE, 0);
75 input_sync(ts.dev);
76 + ts.flag_first_touch_sent = 0;
77
78 writel(WAIT4INT(0), base_addr+S3C2410_ADCTSC);
79 }
80 --
81 1.5.6.5
82
This page took 0.042886 seconds and 5 git commands to generate.