aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/da9034-ts.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/touchscreen/da9034-ts.c')
-rw-r--r--drivers/input/touchscreen/da9034-ts.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/drivers/input/touchscreen/da9034-ts.c b/drivers/input/touchscreen/da9034-ts.c
index fa67d782c3c3..3ffd4c4b170c 100644
--- a/drivers/input/touchscreen/da9034-ts.c
+++ b/drivers/input/touchscreen/da9034-ts.c
@@ -3,6 +3,7 @@
3 * 3 *
4 * Copyright (C) 2006-2008 Marvell International Ltd. 4 * Copyright (C) 2006-2008 Marvell International Ltd.
5 * Fengwei Yin <fengwei.yin@marvell.com> 5 * Fengwei Yin <fengwei.yin@marvell.com>
6 * Bin Yang <bin.yang@marvell.com>
6 * Eric Miao <eric.miao@marvell.com> 7 * Eric Miao <eric.miao@marvell.com>
7 * 8 *
8 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
@@ -175,6 +176,16 @@ static void da9034_event_handler(struct da9034_touch *touch, int event)
175 goto err_reset; 176 goto err_reset;
176 177
177 touch->state = STATE_STOP; 178 touch->state = STATE_STOP;
179
180 /* FIXME: PEN_{UP/DOWN} events are expected to be
181 * available by stopping TSI, but this is found not
182 * always true, delay and simulate such an event
183 * here is more reliable
184 */
185 mdelay(1);
186 da9034_event_handler(touch,
187 is_pen_down(touch) ? EVENT_PEN_DOWN :
188 EVENT_PEN_UP);
178 break; 189 break;
179 190
180 case STATE_STOP: 191 case STATE_STOP:
@@ -189,8 +200,6 @@ static void da9034_event_handler(struct da9034_touch *touch, int event)
189 report_pen_up(touch); 200 report_pen_up(touch);
190 touch->state = STATE_IDLE; 201 touch->state = STATE_IDLE;
191 } 202 }
192
193 input_sync(touch->input_dev);
194 break; 203 break;
195 204
196 case STATE_WAIT: 205 case STATE_WAIT:
@@ -200,8 +209,10 @@ static void da9034_event_handler(struct da9034_touch *touch, int event)
200 if (is_pen_down(touch)) { 209 if (is_pen_down(touch)) {
201 start_tsi(touch); 210 start_tsi(touch);
202 touch->state = STATE_BUSY; 211 touch->state = STATE_BUSY;
203 } else 212 } else {
213 report_pen_up(touch);
204 touch->state = STATE_IDLE; 214 touch->state = STATE_IDLE;
215 }
205 break; 216 break;
206 } 217 }
207 return; 218 return;
@@ -226,16 +237,12 @@ static int da9034_touch_notifier(struct notifier_block *nb,
226 struct da9034_touch *touch = 237 struct da9034_touch *touch =
227 container_of(nb, struct da9034_touch, notifier); 238 container_of(nb, struct da9034_touch, notifier);
228 239
229 if (event & DA9034_EVENT_PEN_DOWN) {
230 if (is_pen_down(touch))
231 da9034_event_handler(touch, EVENT_PEN_DOWN);
232 else
233 da9034_event_handler(touch, EVENT_PEN_UP);
234 }
235
236 if (event & DA9034_EVENT_TSI_READY) 240 if (event & DA9034_EVENT_TSI_READY)
237 da9034_event_handler(touch, EVENT_TSI_READY); 241 da9034_event_handler(touch, EVENT_TSI_READY);
238 242
243 if ((event & DA9034_EVENT_PEN_DOWN) && touch->state == STATE_IDLE)
244 da9034_event_handler(touch, EVENT_PEN_DOWN);
245
239 return 0; 246 return 0;
240} 247}
241 248
@@ -385,6 +392,6 @@ static void __exit da9034_touch_exit(void)
385module_exit(da9034_touch_exit); 392module_exit(da9034_touch_exit);
386 393
387MODULE_DESCRIPTION("Touchscreen driver for Dialog Semiconductor DA9034"); 394MODULE_DESCRIPTION("Touchscreen driver for Dialog Semiconductor DA9034");
388MODULE_AUTHOR("Eric Miao <eric.miao@marvell.com>"); 395MODULE_AUTHOR("Eric Miao <eric.miao@marvell.com>, Bin Yang <bin.yang@marvell.com>");
389MODULE_LICENSE("GPL"); 396MODULE_LICENSE("GPL");
390MODULE_ALIAS("platform:da9034-touch"); 397MODULE_ALIAS("platform:da9034-touch");