Skip to content

Commit

Permalink
Input: wm9712 - fix wrong pen up readings
Browse files Browse the repository at this point in the history
Often a reading can be wrong. This patch assures that this is really a
pen up event and not a false reading.

Based on wm9712: pen up by Teresa Gámez and Christian Hemp.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
  • Loading branch information
Markus Pargmann authored and Dmitry Torokhov committed Mar 12, 2013
1 parent fa45255 commit 5407927
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/input/touchscreen/wm9712.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,12 @@ static int wm9712_poll_sample(struct wm97xx *wm, int adcsel, int *sample)
}

if (wants_pen && !(*sample & WM97XX_PEN_DOWN)) {
wm->pen_probably_down = 0;
return RC_PENUP;
/* Sometimes it reads a wrong value the first time. */
*sample = wm97xx_reg_read(wm, AC97_WM97XX_DIGITISER_RD);
if (!(*sample & WM97XX_PEN_DOWN)) {
wm->pen_probably_down = 0;
return RC_PENUP;
}
}

return RC_VALID;
Expand Down

0 comments on commit 5407927

Please sign in to comment.