diff options
| author | Markus Pargmann <mpa@pengutronix.de> | 2013-03-09 18:21:33 -0500 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-03-12 11:50:20 -0400 |
| commit | 540792753c292bce53f42eb7b8fb3d3510f57e00 (patch) | |
| tree | 2f715f6bd9fd7e3f1b88d554115fb134a2237f82 /drivers/input | |
| parent | fa45255ee72649bd061116f7d3a765f5784bf078 (diff) | |
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: Markus Pargmann <mpa@pengutronix.de>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
| -rw-r--r-- | drivers/input/touchscreen/wm9712.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/input/touchscreen/wm9712.c b/drivers/input/touchscreen/wm9712.c index a983da1744e8..3b4eed4b8690 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) | |||
| 302 | } | 302 | } |
| 303 | 303 | ||
| 304 | if (wants_pen && !(*sample & WM97XX_PEN_DOWN)) { | 304 | if (wants_pen && !(*sample & WM97XX_PEN_DOWN)) { |
| 305 | wm->pen_probably_down = 0; | 305 | /* Sometimes it reads a wrong value the first time. */ |
| 306 | return RC_PENUP; | 306 | *sample = wm97xx_reg_read(wm, AC97_WM97XX_DIGITISER_RD); |
| 307 | if (!(*sample & WM97XX_PEN_DOWN)) { | ||
| 308 | wm->pen_probably_down = 0; | ||
| 309 | return RC_PENUP; | ||
| 310 | } | ||
| 307 | } | 311 | } |
| 308 | 312 | ||
| 309 | return RC_VALID; | 313 | return RC_VALID; |
