aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorMarkus Pargmann <mpa@pengutronix.de>2013-03-09 18:19:56 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2013-03-12 11:50:18 -0400
commitcfd5d09691ee188a36c00f5c3b220fbf082a78d7 (patch)
tree171b6981f09a93f9fe3e72ab7cd69222aae35bc8 /drivers/input
parentb4a034dab147776eab8eb8b2997ea16ef0e32c17 (diff)
Input: wm97xx - drop out of range inputs
With fast movements, there occured some out of screen jumps with my touchscreen. The abs_x and abs_y module parameters should fix this by default, but the driver doesn't actively checks the x/y coordinates. Instead it seems that the input layer was supposed to drop out of range inputs, as described in the comments: "These parameters are used to help the input layer discard out of range readings and reduce jitter etc" The input layer documentation describes that values that are not in the absolute range are also accepted. So this patch adds a check within the driver. 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/wm97xx-core.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c
index 5dbe73af2f8f..7e45c9f6e6b7 100644
--- a/drivers/input/touchscreen/wm97xx-core.c
+++ b/drivers/input/touchscreen/wm97xx-core.c
@@ -442,6 +442,16 @@ static int wm97xx_read_samples(struct wm97xx *wm)
442 "pen down: x=%x:%d, y=%x:%d, pressure=%x:%d\n", 442 "pen down: x=%x:%d, y=%x:%d, pressure=%x:%d\n",
443 data.x >> 12, data.x & 0xfff, data.y >> 12, 443 data.x >> 12, data.x & 0xfff, data.y >> 12,
444 data.y & 0xfff, data.p >> 12, data.p & 0xfff); 444 data.y & 0xfff, data.p >> 12, data.p & 0xfff);
445
446 if (abs_x[0] > (data.x & 0xfff) ||
447 abs_x[1] < (data.x & 0xfff) ||
448 abs_y[0] > (data.y & 0xfff) ||
449 abs_y[1] < (data.y & 0xfff)) {
450 dev_dbg(wm->dev, "Measurement out of range, dropping it\n");
451 rc = RC_AGAIN;
452 goto out;
453 }
454
445 input_report_abs(wm->input_dev, ABS_X, data.x & 0xfff); 455 input_report_abs(wm->input_dev, ABS_X, data.x & 0xfff);
446 input_report_abs(wm->input_dev, ABS_Y, data.y & 0xfff); 456 input_report_abs(wm->input_dev, ABS_Y, data.y & 0xfff);
447 input_report_abs(wm->input_dev, ABS_PRESSURE, data.p & 0xfff); 457 input_report_abs(wm->input_dev, ABS_PRESSURE, data.p & 0xfff);
@@ -455,6 +465,7 @@ static int wm97xx_read_samples(struct wm97xx *wm)
455 wm->ts_reader_interval = wm->ts_reader_min_interval; 465 wm->ts_reader_interval = wm->ts_reader_min_interval;
456 } 466 }
457 467
468out:
458 mutex_unlock(&wm->codec_mutex); 469 mutex_unlock(&wm->codec_mutex);
459 return rc; 470 return rc;
460} 471}