summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMichael Hennerich <michael.hennerich@analog.com>2011-08-03 02:41:37 +0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2011-08-03 09:17:44 +0400
commit4fecc2088fd02ce8a6580c12822987d3c6bab9b8 (patch)
treecc8aa9b806e1494f018c634c62936854b8275e62 /drivers
parent0a7a8fff7b8a3bc2d3528af07c9c88083250303d (diff)
downloadlinux-4fecc2088fd02ce8a6580c12822987d3c6bab9b8.tar.xz
Input: ad7879 - fix deficient device disable
Input close or device disable should not interact with the exported gpiolib functionality. However that's the case. __ad7879_disable() clears the entire AD7879_REG_CTRL2, while it should just power down the ADC and its reference. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/touchscreen/ad7879.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/input/touchscreen/ad7879.c b/drivers/input/touchscreen/ad7879.c
index bc3b5187f3a3..131f9d1c921b 100644
--- a/drivers/input/touchscreen/ad7879.c
+++ b/drivers/input/touchscreen/ad7879.c
@@ -249,12 +249,14 @@ static void __ad7879_enable(struct ad7879 *ts)
static void __ad7879_disable(struct ad7879 *ts)
{
+ u16 reg = (ts->cmd_crtl2 & ~AD7879_PM(-1)) |
+ AD7879_PM(AD7879_PM_SHUTDOWN);
disable_irq(ts->irq);
if (del_timer_sync(&ts->timer))
ad7879_ts_event_release(ts);
- ad7879_write(ts, AD7879_REG_CTRL2, AD7879_PM(AD7879_PM_SHUTDOWN));
+ ad7879_write(ts, AD7879_REG_CTRL2, reg);
}