Commit 54079275 authored by Markus Pargmann's avatar Markus Pargmann Committed by Dmitry Torokhov

Input: wm9712 - fix wrong pen up readings

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: default avatarMarkus Pargmann <mpa@pengutronix.de>
Acked-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent fa45255e
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment