diff options
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/touchscreen/s3c2410_ts.c | 30 |
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); |