aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-03-25 23:50:12 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-25 23:50:12 -0400
commit24c6d02fe8c34bc958aa4c464efc1cc10d43e29d (patch)
tree65ead181d36f9113ca72fc2709e79bb560cfde22 /drivers/input
parent0dd61be7ec1be1b6820af978f901b9ae2c244dc6 (diff)
parenta0fa2206f550066d6948d43c5401e973e5f7d320 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: tsc2005 - fix locking issue Input: tsc2005 - use relative jiffies to schedule the watchdog Input: tsc2005 - driver should depend on GENERIC_HARDIRQS
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/touchscreen/Kconfig2
-rw-r--r--drivers/input/touchscreen/tsc2005.c18
2 files changed, 14 insertions, 6 deletions
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
index 112ec55f293..434fd800cd2 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -641,7 +641,7 @@ config TOUCHSCREEN_TOUCHIT213
641 641
642config TOUCHSCREEN_TSC2005 642config TOUCHSCREEN_TSC2005
643 tristate "TSC2005 based touchscreens" 643 tristate "TSC2005 based touchscreens"
644 depends on SPI_MASTER 644 depends on SPI_MASTER && GENERIC_HARDIRQS
645 help 645 help
646 Say Y here if you have a TSC2005 based touchscreen. 646 Say Y here if you have a TSC2005 based touchscreen.
647 647
diff --git a/drivers/input/touchscreen/tsc2005.c b/drivers/input/touchscreen/tsc2005.c
index 87420616efa..cbf0ff32267 100644
--- a/drivers/input/touchscreen/tsc2005.c
+++ b/drivers/input/touchscreen/tsc2005.c
@@ -358,7 +358,7 @@ static void __tsc2005_enable(struct tsc2005 *ts)
358 if (ts->esd_timeout && ts->set_reset) { 358 if (ts->esd_timeout && ts->set_reset) {
359 ts->last_valid_interrupt = jiffies; 359 ts->last_valid_interrupt = jiffies;
360 schedule_delayed_work(&ts->esd_work, 360 schedule_delayed_work(&ts->esd_work,
361 round_jiffies(jiffies + 361 round_jiffies_relative(
362 msecs_to_jiffies(ts->esd_timeout))); 362 msecs_to_jiffies(ts->esd_timeout)));
363 } 363 }
364 364
@@ -477,7 +477,14 @@ static void tsc2005_esd_work(struct work_struct *work)
477 int error; 477 int error;
478 u16 r; 478 u16 r;
479 479
480 mutex_lock(&ts->mutex); 480 if (!mutex_trylock(&ts->mutex)) {
481 /*
482 * If the mutex is taken, it means that disable or enable is in
483 * progress. In that case just reschedule the work. If the work
484 * is not needed, it will be canceled by disable.
485 */
486 goto reschedule;
487 }
481 488
482 if (time_is_after_jiffies(ts->last_valid_interrupt + 489 if (time_is_after_jiffies(ts->last_valid_interrupt +
483 msecs_to_jiffies(ts->esd_timeout))) 490 msecs_to_jiffies(ts->esd_timeout)))
@@ -510,11 +517,12 @@ static void tsc2005_esd_work(struct work_struct *work)
510 tsc2005_start_scan(ts); 517 tsc2005_start_scan(ts);
511 518
512out: 519out:
520 mutex_unlock(&ts->mutex);
521reschedule:
513 /* re-arm the watchdog */ 522 /* re-arm the watchdog */
514 schedule_delayed_work(&ts->esd_work, 523 schedule_delayed_work(&ts->esd_work,
515 round_jiffies(jiffies + 524 round_jiffies_relative(
516 msecs_to_jiffies(ts->esd_timeout))); 525 msecs_to_jiffies(ts->esd_timeout)));
517 mutex_unlock(&ts->mutex);
518} 526}
519 527
520static int tsc2005_open(struct input_dev *input) 528static int tsc2005_open(struct input_dev *input)
@@ -663,7 +671,7 @@ static int __devinit tsc2005_probe(struct spi_device *spi)
663 goto err_remove_sysfs; 671 goto err_remove_sysfs;
664 } 672 }
665 673
666 set_irq_wake(spi->irq, 1); 674 irq_set_irq_wake(spi->irq, 1);
667 return 0; 675 return 0;
668 676
669err_remove_sysfs: 677err_remove_sysfs: