Message ID | 1362759309-18782-4-git-send-email-mpa@pengutronix.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Fri, Mar 08, 2013 at 05:15:08PM +0100, Markus Pargmann wrote: > Often a reading can be wrong. This patch assures that this is really a > pen up event and not a false reading. Hrm, it feels like we should wait for the device to tell us another reading is ready but on the other hand I can see the sort of issue that might mean this is needed and if it improves performance in your testing: Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
diff --git a/drivers/input/touchscreen/wm9712.c b/drivers/input/touchscreen/wm9712.c index a983da1..3b4eed4 100644 --- a/drivers/input/touchscreen/wm9712.c +++ b/drivers/input/touchscreen/wm9712.c @@ -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;
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. Cc: Teresa Gámez <t.gamez@phytec.de> Cc: Christian Hemp <c.hemp@phytec.de> Cc: stable@vger.kernel.org Signed-off-by: Markus Pargmann <mpa@pengutronix.de> --- drivers/input/touchscreen/wm9712.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)