diff mbox

[4/4] Input: ads7846 - modificatons of _stop()/_disable() conditions

Message ID 4C9718E9.5040104@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jason Wang Sept. 20, 2010, 8:18 a.m. UTC
None
diff mbox

Patch

--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -253,10 +253,11 @@  static void ads7846_enable(struct ads7846 *ts)
{
mutex_lock(&ts->lock);

- if (ts->disabled && !ts->suspended)
+ if (ts->disabled && !ts->suspended) {
+ ts->disabled = false;
__ads7846_enable(ts);
-
- ts->disabled = false;
+ } else
+ ts->disabled = false;

mutex_unlock(&ts->lock);
}
@@ -919,10 +920,10 @@  static int ads7846_resume(struct spi_device *spi)
if (device_may_wakeup(&ts->spi->dev))
disable_irq_wake(ts->spi->irq);

+ ts->suspended = false;
+
if (!ts->disabled)
__ads7846_enable(ts);
-
- ts->suspended = false;
}

mutex_unlock(&ts->lock);