Input: wm9712 - fix return code for wrong sample
authorMarkus Pargmann <mpa@pengutronix.de>
Sat, 9 Mar 2013 23:20:50 +0000 (15:20 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 12 Mar 2013 15:50:19 +0000 (08:50 -0700)
Instead of interpreting a wrong measurement as pen up, we should
try to read again.

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>
drivers/input/touchscreen/wm9712.c

index 6e743e3dfda4a54900d12c7fd9a9a567d80d7751..a983da1744e8ad0be8137a1a40ca86ec24173eb5 100644 (file)
@@ -298,7 +298,7 @@ static int wm9712_poll_sample(struct wm97xx *wm, int adcsel, int *sample)
                dev_dbg(wm->dev, "adc wrong sample, wanted %x got %x",
                        adcsel & WM97XX_ADCSEL_MASK,
                        *sample & WM97XX_ADCSEL_MASK);
-               return RC_PENUP;
+               return RC_AGAIN;
        }
 
        if (wants_pen && !(*sample & WM97XX_PEN_DOWN)) {