diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2008-04-17 09:24:39 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2008-04-17 09:24:39 -0400 |
commit | d808fbe5b404854374917bd0d1db937a0a524665 (patch) | |
tree | 936191d9dd7266444367a3029e121ed32665aa75 /drivers/input | |
parent | 4db8a5f21e5149e09949516eef98b78b68880075 (diff) |
Input: wm97xx-core - only schedule interrupt handler if not already scheduled
As well as clarifying the fact that the driver can cope if a second
interrupt occurs before the IRQ work is scheduled this also ensures
that calls to the machine irq_enable() are balanced, making that easier
to implement. Normally this is redundant due to the interrupt disabling
but some unusal board configurations can trigger it.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/touchscreen/wm97xx-core.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c index 2910999e05a0..e27b1e060b33 100644 --- a/drivers/input/touchscreen/wm97xx-core.c +++ b/drivers/input/touchscreen/wm97xx-core.c | |||
@@ -328,18 +328,18 @@ static void wm97xx_pen_irq_worker(struct work_struct *work) | |||
328 | * | 328 | * |
329 | * We have to disable the codec interrupt in the handler because it | 329 | * We have to disable the codec interrupt in the handler because it |
330 | * can take upto 1ms to clear the interrupt source. We schedule a task | 330 | * can take upto 1ms to clear the interrupt source. We schedule a task |
331 | * in a work queue to do the actual interaction with the chip (it | 331 | * in a work queue to do the actual interaction with the chip. The |
332 | * doesn't matter if we end up reenqueing it before it is executed | 332 | * interrupt is then enabled again in the slow handler when the source |
333 | * since we don't touch the chip until it has run). The interrupt is | 333 | * has been cleared. |
334 | * then enabled again in the slow handler when the source has been | ||
335 | * cleared. | ||
336 | */ | 334 | */ |
337 | static irqreturn_t wm97xx_pen_interrupt(int irq, void *dev_id) | 335 | static irqreturn_t wm97xx_pen_interrupt(int irq, void *dev_id) |
338 | { | 336 | { |
339 | struct wm97xx *wm = dev_id; | 337 | struct wm97xx *wm = dev_id; |
340 | 338 | ||
341 | wm->mach_ops->irq_enable(wm, 0); | 339 | if (!work_pending(&wm->pen_event_work)) { |
342 | queue_work(wm->ts_workq, &wm->pen_event_work); | 340 | wm->mach_ops->irq_enable(wm, 0); |
341 | queue_work(wm->ts_workq, &wm->pen_event_work); | ||
342 | } | ||
343 | 343 | ||
344 | return IRQ_HANDLED; | 344 | return IRQ_HANDLED; |
345 | } | 345 | } |