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

+14 -6
+1 -1
drivers/input/touchscreen/Kconfig
··· 641 641 642 642 config TOUCHSCREEN_TSC2005 643 643 tristate "TSC2005 based touchscreens" 644 - depends on SPI_MASTER 644 + depends on SPI_MASTER && GENERIC_HARDIRQS 645 645 help 646 646 Say Y here if you have a TSC2005 based touchscreen. 647 647
+13 -5
drivers/input/touchscreen/tsc2005.c
··· 358 358 if (ts->esd_timeout && ts->set_reset) { 359 359 ts->last_valid_interrupt = jiffies; 360 360 schedule_delayed_work(&ts->esd_work, 361 - round_jiffies(jiffies + 361 + round_jiffies_relative( 362 362 msecs_to_jiffies(ts->esd_timeout))); 363 363 } 364 364 ··· 477 477 int error; 478 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 489 if (time_is_after_jiffies(ts->last_valid_interrupt + 483 490 msecs_to_jiffies(ts->esd_timeout))) ··· 517 510 tsc2005_start_scan(ts); 518 511 519 512 out: 513 + mutex_unlock(&ts->mutex); 514 + reschedule: 520 515 /* re-arm the watchdog */ 521 516 schedule_delayed_work(&ts->esd_work, 522 - round_jiffies(jiffies + 517 + round_jiffies_relative( 523 518 msecs_to_jiffies(ts->esd_timeout))); 524 - mutex_unlock(&ts->mutex); 525 519 } 526 520 527 521 static int tsc2005_open(struct input_dev *input) ··· 671 663 goto err_remove_sysfs; 672 664 } 673 665 674 - set_irq_wake(spi->irq, 1); 666 + irq_set_irq_wake(spi->irq, 1); 675 667 return 0; 676 668 677 669 err_remove_sysfs: