diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2011-04-15 10:52:34 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2011-04-15 10:52:34 +0200 |
commit | 068e98c02fb732db94a55e6696f77d85e520c2c0 (patch) | |
tree | a902acf18d97f35009199b43a58b52edfb66ddb1 /patches/tslib-1.0 | |
parent | ce355d27a09954df42bf74811cc4042a2bee222d (diff) | |
download | ptxdist-068e98c02fb732db94a55e6696f77d85e520c2c0.tar.gz ptxdist-068e98c02fb732db94a55e6696f77d85e520c2c0.tar.xz |
tslib: add upstream commit "Fix current values for input-raw"
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'patches/tslib-1.0')
-rw-r--r-- | patches/tslib-1.0/0001-Fix-current-values-for-input-raw.patch | 69 | ||||
-rw-r--r-- | patches/tslib-1.0/series | 1 |
2 files changed, 70 insertions, 0 deletions
diff --git a/patches/tslib-1.0/0001-Fix-current-values-for-input-raw.patch b/patches/tslib-1.0/0001-Fix-current-values-for-input-raw.patch new file mode 100644 index 000000000..41eb748f3 --- /dev/null +++ b/patches/tslib-1.0/0001-Fix-current-values-for-input-raw.patch @@ -0,0 +1,69 @@ +From 2b7340390935b916e1bddfce3b98d972b00f866c Mon Sep 17 00:00:00 2001 +From: Teresa Gamez <T.Gamez@phytec.de> +Date: Mon, 4 Oct 2010 11:45:14 +0200 +Subject: [PATCH] Fix current values for input-raw + +The input driver only sends new ABS_X and ABS_Y events when the value changes, +even after a pen up and a pen down. + +If we have the same y value after releasing and touching again, there will be +no ABS_Y event sent and the sample returns at an EV_SYN the value x,0. + +So we don't change the current values at pen_up, but a flag that sets the sample +values to 0. + +Signed-off-by: Teresa Gamez <t.gamez@phytec.de> +Signed-off-by: Jan Weitzel <j.weitzel@phytec.de> +Signed-off-by: Chris Larson <chris_larson@mentor.com> +--- + plugins/input-raw.c | 22 +++++++++++++--------- + 1 files changed, 13 insertions(+), 9 deletions(-) + +diff --git a/plugins/input-raw.c b/plugins/input-raw.c +index 59d235e..9511a0d 100644 +--- a/plugins/input-raw.c ++++ b/plugins/input-raw.c +@@ -134,6 +134,7 @@ static int ts_input_read(struct tslib_module_info *inf, + struct input_event ev; + int ret = nr; + int total = 0; ++ int pen_up = 0; + + if (i->sane_fd == 0) + i->sane_fd = check_fd(i); +@@ -153,20 +154,23 @@ static int ts_input_read(struct tslib_module_info *inf, + case EV_KEY: + switch (ev.code) { + case BTN_TOUCH: +- if (ev.value == 0) { +- /* pen up */ +- i->current_x = 0; +- i->current_y = 0; +- i->current_p = 0; +- } ++ if (ev.value == 0) ++ pen_up = 1; + break; + } + break; + case EV_SYN: + /* Fill out a new complete event */ +- samp->x = i->current_x; +- samp->y = i->current_y; +- samp->pressure = i->current_p; ++ if (pen_up) { ++ samp->x = 0; ++ samp->y = 0; ++ samp->pressure = 0; ++ pen_up = 0; ++ } else { ++ samp->x = i->current_x; ++ samp->y = i->current_y; ++ samp->pressure = i->current_p; ++ } + samp->tv = ev.time; + #ifdef DEBUG + fprintf(stderr, "RAW---------------------> %d %d %d %d.%d\n", +-- +1.7.2.3 + diff --git a/patches/tslib-1.0/series b/patches/tslib-1.0/series index 21ca6a673..a5cdc209b 100644 --- a/patches/tslib-1.0/series +++ b/patches/tslib-1.0/series @@ -17,3 +17,4 @@ r73-Prefix-correct-some-error-messages-in-input-raw-modu.patch r75-Rely-on-SYN-Events-when-pen-is-lifted.patch r78-input-raw-Handling-of-EVIOCGBIT-ioctl-coding.patch 0001-Relax-EV_VERSION-check.patch +0001-Fix-current-values-for-input-raw.patch |