aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorVasily Khoruzhick <anarsoul@gmail.com>2010-02-20 04:06:20 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-02-20 04:22:36 -0500
commit23c239be223d7427da51656d6f196bde965d9796 (patch)
treeab99068105a908f9bf99305fce12f0bae64eae26 /drivers
parent2f09586557ed9b6d50bc8bb5104e70006513bdc2 (diff)
Input: s3c24xx_ts - report touch only when stylus is down
Currently driver reports touches when it gets (1 << ts.shift) samples, even if stylus is up, which is incorrect. We should only report coordinates and touch condition when stylus is down. Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/touchscreen/s3c2410_ts.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c
index ffc355e696dc..3755a47d053c 100644
--- a/drivers/input/touchscreen/s3c2410_ts.c
+++ b/drivers/input/touchscreen/s3c2410_ts.c
@@ -128,27 +128,29 @@ static void touch_timer_fire(unsigned long data)
128 128
129 down = get_down(data0, data1); 129 down = get_down(data0, data1);
130 130
131 if (ts.count == (1 << ts.shift)) { 131 if (down) {
132 ts.xp >>= ts.shift; 132 if (ts.count == (1 << ts.shift)) {
133 ts.yp >>= ts.shift; 133 ts.xp >>= ts.shift;
134 ts.yp >>= ts.shift;
134 135
135 dev_dbg(ts.dev, "%s: X=%lu, Y=%lu, count=%d\n", 136 dev_dbg(ts.dev, "%s: X=%lu, Y=%lu, count=%d\n",
136 __func__, ts.xp, ts.yp, ts.count); 137 __func__, ts.xp, ts.yp, ts.count);
137 138
138 input_report_abs(ts.input, ABS_X, ts.xp); 139 input_report_abs(ts.input, ABS_X, ts.xp);
139 input_report_abs(ts.input, ABS_Y, ts.yp); 140 input_report_abs(ts.input, ABS_Y, ts.yp);
140 141
141 input_report_key(ts.input, BTN_TOUCH, 1); 142 input_report_key(ts.input, BTN_TOUCH, 1);
142 input_sync(ts.input); 143 input_sync(ts.input);
143 144
144 ts.xp = 0; 145 ts.xp = 0;
145 ts.yp = 0; 146 ts.yp = 0;
146 ts.count = 0; 147 ts.count = 0;
147 } 148 }
148 149
149 if (down) {
150 s3c_adc_start(ts.client, 0, 1 << ts.shift); 150 s3c_adc_start(ts.client, 0, 1 << ts.shift);
151 } else { 151 } else {
152 ts.xp = 0;
153 ts.yp = 0;
152 ts.count = 0; 154 ts.count = 0;
153 155
154 input_report_key(ts.input, BTN_TOUCH, 0); 156 input_report_key(ts.input, BTN_TOUCH, 0);