Skip to content

Commit

Permalink
Input: ad7879 - fix deficient device disable
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Hennerich authored and Dmitry Torokhov committed Aug 3, 2011
1 parent 0a7a8ff commit 4fecc20
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/input/touchscreen/ad7879.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down

0 comments on commit 4fecc20

Please sign in to comment.