diff options
28 files changed, 103 insertions, 1885 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 deleted file mode 100644 index 41eb748f3..000000000 --- a/patches/tslib-1.0/0001-Fix-current-values-for-input-raw.patch +++ /dev/null @@ -1,69 +0,0 @@ -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/0001-Relax-EV_VERSION-check.patch b/patches/tslib-1.0/0001-Relax-EV_VERSION-check.patch deleted file mode 100644 index dc56abcc8..000000000 --- a/patches/tslib-1.0/0001-Relax-EV_VERSION-check.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 412d99d8b92c12545f939972146a38c5074f3dcb Mon Sep 17 00:00:00 2001 -From: Martin Jansa <Martin.Jansa@gmail.com> -Date: Wed, 12 Jan 2011 14:36:35 +0100 -Subject: [PATCH] Relax EV_VERSION check - -Fail only if version of running kernel is lower than the EV_VERSION from the -kernel headers, rather than expecting an exact match. - -Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> -Signed-off-by: Chris Larson <chris_larson@mentor.com> ---- - plugins/input-raw.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/plugins/input-raw.c b/plugins/input-raw.c -index 9511a0d..4396eab 100644 ---- a/plugins/input-raw.c -+++ b/plugins/input-raw.c -@@ -78,7 +78,7 @@ static int check_fd(struct tslib_input *i) - return -1; - } - -- if (version != EV_VERSION) { -+ if (version < EV_VERSION) { - fprintf(stderr, "tslib: Selected device uses a different version of the event protocol than tslib was compiled for\n"); - return -1; - } --- -1.7.2.3 - diff --git a/patches/tslib-1.0/0001-tslib-fails-to-compile-on-Ubuntu-8.10-easy-patch.patch b/patches/tslib-1.0/0001-tslib-fails-to-compile-on-Ubuntu-8.10-easy-patch.patch deleted file mode 100644 index 491fa5870..000000000 --- a/patches/tslib-1.0/0001-tslib-fails-to-compile-on-Ubuntu-8.10-easy-patch.patch +++ /dev/null @@ -1,48 +0,0 @@ -From dc24354df2322c61845fe9412ec79a7adc6d45db Mon Sep 17 00:00:00 2001 -From: Chris Larson <clarson@kergoth.com> -Date: Tue, 24 Mar 2009 17:42:34 +0000 -Subject: [PATCH] tslib fails to compile on Ubuntu 8.10+, easy patch - -I noticed that gcc fails to compile the latest svn copy of tslib due -to a potentially "unsafe" use of open(). Ubuntu 8.10+, for instance, -by default enables the compiler flag -D_FORTIFY_SOURCE=2 which throws -an error on lines 253 and 255 of ts_calibrate.c. This is a pretty -minor issue, but could potentially stop some people using Ubuntu from -compiling unless they realize what's going on. - -To fix this, all you need to do is set a mode in the open() call. I -patched ts_calibrate.c to set 0644 (S_IRUSR | S_IWUSR | S_IRGRP | -S_IROTH) and it compiles fine. See below. - -Signed-off-by: Daniel Jabbour <daniel@laptouchinc.com> -Signed-off-by: Chris Larson <clarson@kergoth.com> ---- - tests/ts_calibrate.c | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -diff --git a/tests/ts_calibrate.c b/tests/ts_calibrate.c -index 04c75dc..00e9580 100644 ---- a/tests/ts_calibrate.c -+++ b/tests/ts_calibrate.c -@@ -21,6 +21,7 @@ - #include <sys/ioctl.h> - #include <sys/mman.h> - #include <sys/time.h> -+#include <sys/stat.h> - #include <linux/kd.h> - #include <linux/vt.h> - #include <linux/fb.h> -@@ -250,9 +251,11 @@ int main() - for (i = 0; i < 7; i++) printf("%d ", cal.a [i]); - printf("\n"); - if ((calfile = getenv("TSLIB_CALIBFILE")) != NULL) { -- cal_fd = open (calfile, O_CREAT | O_RDWR); -+ cal_fd = open (calfile, O_CREAT | O_RDWR, -+ S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); - } else { -- cal_fd = open ("/etc/pointercal", O_CREAT | O_RDWR); -+ cal_fd = open ("/etc/pointercal", O_CREAT | O_RDWR, -+ S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); - } - sprintf (cal_buffer,"%d %d %d %d %d %d %d", - cal.a[1], cal.a[2], cal.a[0], diff --git a/patches/tslib-1.0/add-open-env.diff b/patches/tslib-1.0/add-open-env.diff deleted file mode 100644 index 375702e90..000000000 --- a/patches/tslib-1.0/add-open-env.diff +++ /dev/null @@ -1,33 +0,0 @@ -From: Michael Olbrich <m.olbrich@pengutronix.de> -Subject: environment variable for device open flags - -Adds support for the environment variable TSLIB_TSDEVICEFLAGS -to configure the flags used to open the device file. - -Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> ---- - src/ts_open.c | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -Index: b/src/ts_open.c -=================================================================== ---- a/src/ts_open.c -+++ b/src/ts_open.c -@@ -30,6 +30,17 @@ struct tsdev *ts_open(const char *name, - { - struct tsdev *ts; - int flags = O_RDONLY; -+ char *flag_str; -+ -+ flag_str = getenv("TSLIB_TSDEVICEFLAGS"); -+ if (flag_str) { -+ if (strcmp(flag_str, "RDONLY") == 0) -+ flags = O_RDONLY; -+ else if (strcmp(flag_str, "WRONLY") == 0) -+ flags = O_WRONLY; -+ else if (strcmp(flag_str, "RDWR") == 0) -+ flags = O_RDWR; -+ } - - if (nonblock) - flags |= O_NONBLOCK; diff --git a/patches/tslib-1.0/dmc-support.diff b/patches/tslib-1.0/dmc-support.diff deleted file mode 100644 index 250df90dc..000000000 --- a/patches/tslib-1.0/dmc-support.diff +++ /dev/null @@ -1,202 +0,0 @@ -From: Michael Olbrich <m.olbrich@pengutronix.de> -Subject: plugin to support dmc touchscreens - -Plugin for dmc touchscreens. Based on the xf86-input-dmc xorg input driver. - -Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> ---- - configure.ac | 9 +++ - plugins/Makefile.am | 10 ++++ - plugins/dmc-raw.c | 130 ++++++++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 149 insertions(+) - -Index: b/plugins/dmc-raw.c -=================================================================== ---- /dev/null -+++ b/plugins/dmc-raw.c -@@ -0,0 +1,130 @@ -+ -+#include <stdlib.h> -+#include <stdio.h> -+#include <unistd.h> -+#include <inttypes.h> -+#include <errno.h> -+#include <termios.h> -+ -+#include "config.h" -+#include "tslib-private.h" -+ -+struct tslib_dmc { -+ struct tslib_module_info module; -+ -+ int current_x; -+ int current_y; -+ int sane_fd; -+}; -+ -+int dmc_init_device(struct tsdev *dev) -+{ -+ int fd = dev->fd; -+ struct termios t; -+ char buf[1]; -+ -+ /* flags from the old xorg driver. -+ * I have no idea what all of these mean but it works (tm). */ -+ tcgetattr(fd, &t); -+ t.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON|IXOFF); -+ -+ t.c_oflag &= ~OPOST; -+ -+ t.c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN); -+ -+ t.c_cflag &= ~(CSIZE|PARENB|CSTOPB); -+ t.c_cflag |= CS8|CLOCAL; -+ -+ cfsetispeed (&t, B9600); -+ cfsetospeed (&t, B9600); -+ -+ t.c_cc[VMIN] = 3; -+ t.c_cc[VTIME] = 1; -+ -+ tcsetattr(fd, TCSANOW, &t); -+ -+ if (write(fd, "\x55", 1) != 1) { -+ fprintf(stderr, "dmc: failed to write. Is TSLIB_TSDEVICEFLAGS set to \"RDWR\"?\n"); -+ return EINVAL; -+ } -+ sleep(1); -+ if (write(fd, "\x05\x40", 2) != 2) { -+ goto fail; -+ } -+ if (read(fd, buf, 1) != 1) { -+ perror("dmc read"); -+ goto fail; -+ } -+ if (buf[0] != 0x6) { -+ fprintf(stderr, "dmc: got wrong return value. The touchscreen may not work.\n"); -+ } -+ if (write(fd, "\x31", 1) != 1) { -+ perror("dmc write"); -+ goto fail; -+ } -+ return 0; -+fail: -+ fprintf(stderr, "dmc: selected device is not a touchscreen I understand\n"); -+ return EINVAL; -+} -+ -+static int dmc_read(struct tslib_module_info *inf, struct ts_sample *samp, int nr) -+{ -+ struct tslib_dmc *dmc = (struct tslib_dmc*)inf; -+ struct tsdev *ts = inf->dev; -+ uint8_t buf[5]; -+ int ret; -+ int i; -+ -+ for (i = 0; i < nr; ++i) { -+ if ((ret = read(ts->fd, buf, 1)) != 1) { -+ --i; -+ break; -+ } -+ if (buf[0] == 0x10) { -+ /* release. No coords follow. Use old values */ -+ samp->x = dmc->current_x; -+ samp->y = dmc->current_y; -+ samp->pressure = 0; -+ } -+ else if (buf[0] == 0x11) { -+ /* read coords */ -+ if ((ret = read(ts->fd, buf, 4)) != 4) { -+ /* must have 4 bytes */ -+ --i; -+ break; -+ } -+ samp->x = dmc->current_x = (int)((buf[0] << 8) + buf[1]); -+ samp->y = dmc->current_y = (int)((buf[2] << 8) + buf[3]); -+ samp->pressure = 100; -+ } -+ else -+ continue; -+#ifdef DEBUG -+ fprintf(stderr,"RAW---------------------------> %d %d %d\n",samp->x,samp->y,samp->pressure); -+#endif /*DEBUG*/ -+ gettimeofday(&samp->tv,NULL); -+ ++samp; -+ } -+ return i; -+} -+ -+static const struct tslib_ops dmc_ops = -+{ -+ .read = dmc_read, -+}; -+ -+TSAPI struct tslib_module_info *mod_init(struct tsdev *dev, const char *params) -+{ -+ struct tslib_dmc *m; -+ -+ if (dmc_init_device(dev) != 0) -+ return 0; -+ -+ m = calloc(1, sizeof(struct tslib_dmc)); -+ if (m == NULL) -+ return NULL; -+ -+ m->module.ops = &dmc_ops; -+ return (struct tslib_module_info*)m; -+} -Index: b/plugins/Makefile.am -=================================================================== ---- a/plugins/Makefile.am -+++ b/plugins/Makefile.am -@@ -79,6 +79,12 @@ else - ARCTIC2_MODULE = - endif - -+if ENABLE_DMC_MODULE -+DMC_MODULE = dmc.la -+else -+DMC_MODULE = -+endif -+ - if ENABLE_INPUT_MODULE - INPUT_MODULE = input.la - else -@@ -102,6 +108,7 @@ pluginexec_LTLIBRARIES = \ - $(H3600_MODULE) \ - $(MK712_MODULE) \ - $(ARCTIC2_MODULE) \ -+ $(DMC_MODULE) \ - $(H2200_LINEAR_MODULE) \ - $(INPUT_MODULE) - -@@ -136,6 +143,9 @@ mk712_la_LDFLAGS = -module $(LTVSN) - arctic2_la_SOURCES = arctic2-raw.c - arctic2_la_LDFLAGS = -module $(LTVSN) - -+dmc_la_SOURCES = dmc-raw.c -+dmc_la_LDFLAGS = -module $(LTVSN) -+ - input_la_SOURCES = input-raw.c - input_la_LDFLAGS = -module $(LTVSN) - -Index: b/configure.ac -=================================================================== ---- a/configure.ac -+++ b/configure.ac -@@ -154,6 +154,15 @@ AC_ARG_ENABLE(arctic2, - AC_MSG_RESULT($arctic2_module) - AM_CONDITIONAL(ENABLE_ARCTIC2_MODULE, test "$arctic2_module" = "yes") - -+AC_MSG_CHECKING([whether dmc module is requested]) -+AC_ARG_ENABLE(dmc, -+ AS_HELP_STRING([--enable-dmc], -+ [Enable building of dmc raw module (HP iPaq DMC support) (default=yes)]), -+ [dmc_module=$enableval], -+ [dmc_module=yes]) -+AC_MSG_RESULT($dmc_module) -+AM_CONDITIONAL(ENABLE_DMC_MODULE, test "$dmc_module" = "yes") -+ - AC_MSG_CHECKING([whether input module is requested]) - AC_ARG_ENABLE(input, - AS_HELP_STRING([--enable-input], diff --git a/patches/tslib-1.0/egalax.diff b/patches/tslib-1.0/egalax.diff deleted file mode 100644 index 69baf64b2..000000000 --- a/patches/tslib-1.0/egalax.diff +++ /dev/null @@ -1,546 +0,0 @@ -From: Michael Olbrich <m.olbrich@pengutronix.de> -Subject: [tslib] add egalax driver - -Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> ---- - -diff -Naur tslib/configure.ac tslib-1.0-mine/configure.ac ---- tslib/configure.ac 2009-03-24 19:02:37.000000000 +0100 -+++ tslib-1.0-mine/configure.ac 2009-06-30 13:52:00.000000000 +0200 -@@ -171,6 +171,24 @@ - AC_MSG_RESULT($input_module) - AM_CONDITIONAL(ENABLE_INPUT_MODULE, test "$input_module" = "yes") - -+AC_MSG_CHECKING([whether galax module is requested]) -+AC_ARG_ENABLE(galax, -+ AS_HELP_STRING([--enable-galax], -+ [Enable building of HID USB eGalax raw module (Linux /dev/hiddevN support) (default=yes)]), -+ [galax_module=$enableval], -+ [galax_module=yes]) -+AC_MSG_RESULT($galax_module) -+AM_CONDITIONAL(ENABLE_GALAX_MODULE, test "$galax_module" = "yes") -+ -+AC_MSG_CHECKING([whether touchkit module is requested]) -+AC_ARG_ENABLE(touchkit, -+ AS_HELP_STRING([--enable-touchkit], -+ [Enable building of serial TouchKit raw module (Linux /dev/ttySX support) (default=yes)]), -+ [touchkit_module=$enableval], -+ [touchkit_module=yes]) -+AC_MSG_RESULT($touchkit_module) -+AM_CONDITIONAL(ENABLE_TOUCHKIT_MODULE, test "$touchkit_module" = "yes") -+ - AC_MSG_CHECKING([where to place modules]) - AC_ARG_WITH(plugindir, - AS_HELP_STRING([--with-plugindir=ARG], -diff -Naur tslib/plugins/galax-raw.c tslib-1.0-mine/plugins/galax-raw.c ---- tslib/plugins/galax-raw.c 1970-01-01 01:00:00.000000000 +0100 -+++ tslib-1.0-mine/plugins/galax-raw.c 2009-05-19 15:27:32.000000000 +0200 -@@ -0,0 +1,296 @@ -+/* -+ * tslib/plugins/galax-raw.c -+ * -+ * Inspired from input-raw.c -+ * 2009.05 Fred Salabartan -+ * -+ * This file is placed under the LGPL. Please see the file -+ * COPYING for more details. -+ * -+ * Plugin for "eGalax Inc. Touch" (using usbhid driver) -+ * (Vendor=0eef Product=0001 Version=0112) -+ */ -+ -+#include "config.h" -+ -+#include <errno.h> -+#include <stdio.h> -+#include <limits.h> -+ -+#include <stdlib.h> -+#ifdef HAVE_UNISTD_H -+#include <unistd.h> -+#endif -+#include <sys/time.h> -+#include <sys/types.h> -+ -+#include <linux/input.h> -+#ifndef EV_SYN /* 2.4 kernel headers */ -+# define EV_SYN 0x00 -+#endif -+#ifndef EV_CNT -+# define EV_CNT (EV_MAX+1) -+#endif -+#ifndef ABS_CNT -+# define ABS_CNT (ABS_MAX+1) -+#endif -+#ifndef KEY_CNT -+# define KEY_CNT (KEY_MAX+1) -+#endif -+ -+#include "tslib-private.h" -+ -+enum { -+ GRAB_EVENTS_NO = 0, -+ GRAB_EVENTS_WANTED = 1, -+ GRAB_EVENTS_ACTIVE = 2, -+ -+ SANE_INIT = 0, -+ SANE_OK = 1, -+ SANE_ERROR = 2, -+ -+ BITS_PER_BYTE = 8, -+ BITS_PER_LONG = (sizeof(long) * BITS_PER_BYTE) -+}; -+ -+#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) -+#define BIT(nr) (1UL << (nr)) -+#define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) -+#define BIT_WORD(nr) ((nr) / BITS_PER_LONG) -+//#define BITS_PER_LONG (sizeof(long) * BITS_PER_BYTE) -+#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_LONG) -+ -+ -+struct tslib_galax { -+ struct tslib_module_info module; -+ -+ int current_x; -+ int current_y; -+ int current_pressure; -+ -+ int sane_fd; // 0=not init, 1=ok, -1=error -+ int grab_events; -+}; -+ -+ -+ -+ -+static int ts_galax_check_fd (struct tslib_galax *i) -+{ -+ struct tsdev *ts = i->module.dev; -+ int version; -+ long evbit[BITS_TO_LONGS(EV_CNT)]; -+ long absbit[BITS_TO_LONGS(ABS_CNT)]; -+ long keybit[BITS_TO_LONGS(KEY_CNT)]; -+ struct input_id infos; -+ -+ if (ioctl(ts->fd, EVIOCGVERSION, &version) < 0) { -+ fprintf (stderr, "tslib: not a valid input device\n"); -+ return SANE_ERROR; -+ } -+ -+ if (version != EV_VERSION) { -+ fprintf (stderr, "tslib: bad event protocol version (lib vs device)\n"); -+ return SANE_ERROR; -+ } -+ -+ if ((ioctl(ts->fd, EVIOCGID, &infos) < 0)) { -+ fprintf (stderr, "tslib: warning, can not read device identifier\n"); -+ } else if (infos.bustype != 3 || infos.vendor != 0x0EEF || infos.product != 0x0001 || infos.version != 0x0112) { -+ fprintf (stderr, "tslib: this is not an eGalax touchscreen (3,0x0EEF,1,0x0112)\n" -+ "Your device: bus=%d, vendor=0x%X, product=0x%X, version=0x%X\n", -+ infos.bustype, infos.vendor, infos.product, infos.version); -+ return SANE_ERROR; -+ } -+ -+ if ((ioctl(ts->fd, EVIOCGBIT(0, EV_CNT), evbit) < 0) || -+ !(evbit[BIT_WORD(EV_ABS)] & BIT_MASK(EV_ABS)) || -+ !(evbit[BIT_WORD(EV_KEY)] & BIT_MASK(EV_KEY)) ) { -+ fprintf (stderr, "tslib: device does not support ABS and KEY event types\n"); -+ return SANE_ERROR; -+ } -+ -+ if ((ioctl(ts->fd, EVIOCGBIT(EV_ABS, ABS_CNT), absbit)) < 0 || -+ !(absbit[BIT_WORD(ABS_X)] & BIT_MASK(ABS_X)) || -+ !(absbit[BIT_WORD(ABS_Y)] & BIT_MASK(ABS_Y))) { -+ fprintf (stderr, "tslib: device does not support ABS_X and ABS_Y events\n"); -+ return SANE_ERROR; -+ } -+ -+ /* Since some touchscreens (eg. infrared) physically can't measure pressure, -+ the input system doesn't report it on those. Tslib relies on pressure, thus -+ we set it to constant 255. It's still controlled by BTN_TOUCH - when not -+ touched, the pressure is forced to 0. */ -+ if (!(absbit[BIT_WORD(ABS_PRESSURE)] & BIT_MASK(ABS_PRESSURE))) { -+ i->current_pressure = 255; -+ -+ if ((ioctl(ts->fd, EVIOCGBIT(EV_KEY, KEY_CNT), keybit) < 0) || -+ !(keybit[BIT_WORD(BTN_TOUCH)] & BIT_MASK(BTN_TOUCH)) ) { -+ fprintf (stderr, "tslib: device does support BTN_TOUCH events\n"); -+ return SANE_ERROR; -+ } -+ } -+ -+ if (! (evbit[BIT_WORD(EV_SYN)] & BIT_MASK(EV_SYN))) { -+ fprintf (stderr, "tslib: device does not use EV_SYN\n"); -+ return SANE_ERROR; -+ } -+ -+ if (i->grab_events == GRAB_EVENTS_WANTED) { -+ if (ioctl(ts->fd, EVIOCGRAB, (void *)1)) { -+ fprintf (stderr, "tslib: unable to grab selected input device\n"); -+ return -1; -+ } -+ i->grab_events = GRAB_EVENTS_ACTIVE; -+ } -+ -+ return SANE_OK; -+} -+ -+ -+ -+static int ts_galax_read (struct tslib_module_info *inf, -+ struct ts_sample *samp, int nr) -+{ -+ struct tslib_galax *i = (struct tslib_galax *)inf; -+ struct tsdev *ts = inf->dev; -+ struct input_event ev; -+ int ret = nr; -+ int total = 0; -+ -+ if (i->sane_fd == SANE_INIT) -+ i->sane_fd = ts_galax_check_fd(i); -+ -+ if (i->sane_fd == SANE_ERROR) -+ return 0; -+ -+ while (total < nr) { -+ -+ ret = read(ts->fd, &ev, sizeof(struct input_event)); -+ if (ret < (int)sizeof(struct input_event)) { -+ total = -1; -+ break; -+ } -+ -+ switch (ev.type) { -+ 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_pressure = 0; -+ } else { -+ i->current_pressure = 255; -+ } -+ 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_pressure; -+ samp->tv = ev.time; -+ samp++; -+ total++; -+ break; -+ -+ case EV_ABS: -+ switch (ev.code) { -+ case ABS_X+2: i->current_x = ev.value; break; -+ case ABS_Y+2: i->current_y = ev.value; break; -+ case ABS_PRESSURE: i->current_pressure = ev.value; break; -+ } -+ break; -+ } -+ } -+ ret = total; -+ -+ return ret; -+} -+ -+ -+ -+static int ts_galax_fini (struct tslib_module_info *inf) -+{ -+ struct tslib_galax *i = (struct tslib_galax *)inf; -+ struct tsdev *ts = inf->dev; -+ -+ if (i->grab_events == GRAB_EVENTS_ACTIVE) { -+ if (ioctl (ts->fd, EVIOCGRAB, (void *)0)) { -+ fprintf (stderr, "tslib: Unable to un-grab selected input device\n"); -+ } -+ } -+ -+ free (inf); -+ return 0; -+} -+ -+ -+ -+static const struct tslib_ops __ts_galax_ops = { -+ .read = ts_galax_read, -+ .fini = ts_galax_fini, -+}; -+ -+ -+ -+static int parse_raw_grab (struct tslib_module_info *inf, char *str, void *data) -+{ -+ struct tslib_galax *i = (struct tslib_galax *)inf; -+ unsigned long v; -+ int err = errno; -+ -+ v = strtoul (str, NULL, 0); -+ -+ if (v == ULONG_MAX && errno == ERANGE) -+ return -1; -+ -+ errno = err; -+ switch ((int)data) { -+ case 1: -+ if (v) -+ i->grab_events = GRAB_EVENTS_WANTED; -+ break; -+ default: -+ return -1; -+ } -+ return 0; -+} -+ -+ -+ -+static const struct tslib_vars raw_vars[] = -+{ -+ { "grab_events", (void *)1, parse_raw_grab }, -+}; -+ -+#define NR_VARS (sizeof(raw_vars) / sizeof(raw_vars[0])) -+ -+ -+ -+TSAPI struct tslib_module_info *mod_init (struct tsdev *dev, const char *params) -+{ -+ struct tslib_galax *i; -+ -+ i = malloc (sizeof (struct tslib_galax)); -+ if (i == NULL) -+ return NULL; -+ -+ i->module.ops = &__ts_galax_ops; -+ i->current_x = 0; -+ i->current_y = 0; -+ i->current_pressure = 0; -+ i->sane_fd = SANE_INIT; -+ i->grab_events = GRAB_EVENTS_NO; -+ -+ if (tslib_parse_vars (&i->module, raw_vars, NR_VARS, params)) { -+ free (i); -+ return NULL; -+ } -+ -+ return &(i->module); -+} -diff -Naur tslib/plugins/Makefile.am tslib-1.0-mine/plugins/Makefile.am ---- tslib/plugins/Makefile.am 2009-03-24 19:02:37.000000000 +0100 -+++ tslib-1.0-mine/plugins/Makefile.am 2009-06-30 13:49:07.000000000 +0200 -@@ -91,6 +91,18 @@ - INPUT_MODULE = - endif - -+if ENABLE_GALAX_MODULE -+GALAX_MODULE = galax.la -+else -+GALAX_MODULE = -+endif -+ -+if ENABLE_TOUCHKIT_MODULE -+TOUCHKIT_MODULE = touchkit.la -+else -+TOUCHKIT_MODULE = -+endif -+ - if ENABLE_H2200_LINEAR_MODULE - H2200_LINEAR_MODULE = linear_h2200.la - else -@@ -110,8 +122,10 @@ - $(ARCTIC2_MODULE) \ - $(DMC_MODULE) \ - $(H2200_LINEAR_MODULE) \ -- $(INPUT_MODULE) -- -+ $(INPUT_MODULE) \ -+ $(GALAX_MODULE) \ -+ $(TOUCHKIT_MODULE) -+ - variance_la_SOURCES = variance.c - variance_la_LDFLAGS = -module $(LTVSN) - -@@ -154,5 +168,12 @@ - input_la_LDFLAGS = -module $(LTVSN) - input_la_LIBADD = $(top_builddir)/src/libts.la - -+galax_la_SOURCES = galax-raw.c -+galax_la_LDFLAGS = -module $(LTVSN) -+galax_la_LIBADD = $(top_builddir)/src/libts.la -+ -+touchkit_la_SOURCES = touchkit-raw.c -+touchkit_la_LDFLAGS = -module $(LTVSN) -+ - linear_h2200_la_SOURCES = linear-h2200.c - linear_h2200_la_LDFLAGS = -module $(LTVSN) -diff -Naur tslib/plugins/touchkit-raw.c tslib-1.0-mine/plugins/touchkit-raw.c ---- tslib/plugins/touchkit-raw.c 1970-01-01 01:00:00.000000000 +0100 -+++ tslib-1.0-mine/plugins/touchkit-raw.c 2009-07-07 14:43:40.000000000 +0200 -@@ -0,0 +1,160 @@ -+ -+#include <stdlib.h> -+#include <stdio.h> -+#include <unistd.h> -+#include <termios.h> -+#include <string.h> -+ -+#include "config.h" -+#include "tslib-private.h" -+ -+/* -+ * TouchKit RS232 driver -+ * (controller type SAT4000UR) -+ * 2009.07 Fred Salabartan -+ * -+ * Packet format for position report (5 bytes): -+ * [0] 1 0 0 0 0 0 0 t = header (t=touched) -+ * [1] 0 0 0 0 X X X X = X coord most significant bits -+ * [2] 0 X X X X X X X = X coord less significant bits -+ * [3] 0 0 0 0 Y Y Y Y = Y coord most significant bits -+ * [4] 0 Y Y Y Y Y Y Y = Y coord less significant bits -+ * -+ * Problem: sometimes some packets overlap, so it is possible -+ * to find a new packet in the middle of another packet. -+ * -> check that no byte in the packet (but the first one) -+ * have its first bit set (0x80 = start) -+ * -+ * This file is placed under the LGPL. Please see the file -+ * COPYING for more details. -+*/ -+ -+enum { -+ PACKET_SIZE = 5, -+ BUFFER_SIZE = 100, -+ PACKET_SIGNATURE = 0x81 -+}; -+ -+// Is is a start of packet ? -+#define IsStart(x) (((x)|1) == PACKET_SIGNATURE) -+ -+ -+//------------------------------------------------------------------------------ -+ -+ -+static int touchkit_init (int dev) -+{ -+ struct termios tty; -+ -+ tcgetattr (dev, &tty); -+ tty.c_iflag = IGNBRK | IGNPAR; -+ tty.c_oflag = 0; -+ tty.c_lflag = 0; -+ tty.c_line = 0; -+ tty.c_cc[VTIME] = 0; -+ tty.c_cc[VMIN] = 1; -+ tty.c_cflag = CS8|CREAD|CLOCAL|HUPCL; -+ tty.c_cflag |= B9600; -+ tcsetattr (dev, TCSAFLUSH, &tty); -+ -+ return 1; -+} -+ -+ -+ -+static int touchkit_read (struct tslib_module_info *inf, struct ts_sample *samp, int nr) -+{ -+ static initDone = 0; -+ static unsigned char buffer[BUFFER_SIZE]; // enough space for 2 "normal" packets -+ static int pos = 0; -+ -+ struct tsdev *ts = inf->dev; -+ -+ if (initDone == 0) { -+ initDone = touchkit_init (ts->fd); -+ if (initDone == -1) -+ return -1; -+ } -+ -+ // read some new bytes (enough for 1 normal packet) -+ int ret = read (ts->fd, buffer+pos, PACKET_SIZE); -+ if (ret <= 0) return -1; -+ -+ pos += ret; -+ if (pos < PACKET_SIZE) return 0; -+ -+ // find start -+ int p; -+ int total = 0; -+ for (p = 0; p < pos; ++p) -+ if (IsStart (buffer[p])) { -+ // we have enough data for a packet ? -+ if (p+PACKET_SIZE > pos) { -+ if (p > 0) { -+ // we have found a start >0, it means we have garbage -+ // at beginning of buffer -+ // so let's shift data to ignore this garbage -+ memcpy (buffer, buffer+p, pos-p); -+ pos -= p; -+ } -+ break; -+ } -+ -+ unsigned char *data = buffer + p; -+ -+ // check if all bytes are ok (no 'start' embedded) -+ int q; -+ for (q = 1; q < PACKET_SIZE; ++q) -+ if (IsStart (buffer[p+q])) -+ break; -+ if (q < PACKET_SIZE) { -+#ifdef DEBUG -+ fprintf (stderr, "Start found within packet [%X %X %X %X %X] ignore %d bytes\n", -+ data[0], data[1], data[2], data[3], data[4], q); -+#endif -+ p += q-1; -+ continue; -+ } -+ -+ // now let's decode it -+ samp->x = (data[1] & 0x000F) << 7 | (data[2] & 0x007F); -+ samp->y = ((data[3] & 0x000F) << 7 | (data[4] & 0x007F)); -+ samp->pressure = (data[0] & 1) ? 200 : 0; -+ gettimeofday (&samp->tv, NULL); -+#ifdef DEBUG -+ fprintf (stderr, "RAW -------------------------> data=[%X %X %X %X %X] x=%d y=%d pres=%d\n", -+ nr, data[0], data[1], data[2], data[3], data[4], -+ samp->x, samp->y, samp->pressure); -+#endif -+ samp++; -+ -+ // now remove it -+ memcpy (buffer, buffer+p+PACKET_SIZE, pos-p-PACKET_SIZE); -+ pos -= p+PACKET_SIZE; -+ total = 1; -+ break; -+ } -+ -+ return total; -+} -+ -+ -+ -+static const struct tslib_ops touchkit_ops = -+ { -+ .read = touchkit_read, -+ }; -+ -+ -+ -+TSAPI struct tslib_module_info *mod_init (struct tsdev *dev, const char *params) -+{ -+ struct tslib_module_info *m; -+ -+ m = malloc (sizeof(struct tslib_module_info)); -+ if (m == NULL) -+ return NULL; -+ -+ m->ops = &touchkit_ops; -+ return m; -+} diff --git a/patches/tslib-1.0/fix-autotools.diff b/patches/tslib-1.0/fix-autotools.diff deleted file mode 100644 index caaa9275c..000000000 --- a/patches/tslib-1.0/fix-autotools.diff +++ /dev/null @@ -1,23 +0,0 @@ -From: Michael Olbrich <m.olbrich@pengutronix.de> -Subject: autotools bugfix - -There is no directory m4/external - -Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> ---- - Makefile.am | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Index: b/Makefile.am -=================================================================== ---- a/Makefile.am -+++ b/Makefile.am -@@ -12,7 +12,7 @@ - SUBDIRS = etc src plugins tests - EXTRA_DIST = autogen.sh - --ACLOCAL_AMFLAGS = -I m4/internal -I m4/external -+ACLOCAL_AMFLAGS = -I m4/internal - AUTOMAKE_OPTIONS = 1.6 - - pkgconfigdir = $(libdir)/pkgconfig diff --git a/patches/tslib-1.0/r52-This-patch-adds-support-for-EVIOCGRAB-on-the-input-d.patch b/patches/tslib-1.0/r52-This-patch-adds-support-for-EVIOCGRAB-on-the-input-d.patch deleted file mode 100644 index 22a1c70df..000000000 --- a/patches/tslib-1.0/r52-This-patch-adds-support-for-EVIOCGRAB-on-the-input-d.patch +++ /dev/null @@ -1,132 +0,0 @@ -From 9611f7807a4bf16df107f03e6c057585bcf49a78 Mon Sep 17 00:00:00 2001 -From: kergoth <kergoth@a933c7a4-9bf7-0310-9141-a2e45189604d> -Date: Wed, 11 Jul 2007 19:49:33 +0000 -Subject: [PATCH 04/30] This patch adds support for "EVIOCGRAB" on the input device, which - tells the kernel _not_ to deliver events of the touchscreen to - /dev/input/mice. - -This is probably what most people want, since unprocessed raw touchscreen -events should not be converted to emulated PS/2 mouse movements. - -Signed-off-by: Harald Welte <laforge@openmoko.org> -Signed-off-by: Chris Larson <clarson@kergoth.com> - -git-svn-id: svn://svn.berlios.de/tslib/trunk/tslib@52 a933c7a4-9bf7-0310-9141-a2e45189604d ---- - plugins/input-raw.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++ - 1 files changed, 59 insertions(+), 0 deletions(-) - -diff --git a/plugins/input-raw.c b/plugins/input-raw.c -index 9659eac..6b01fd8 100644 ---- a/plugins/input-raw.c -+++ b/plugins/input-raw.c -@@ -18,6 +18,7 @@ - - #include <errno.h> - #include <stdio.h> -+#include <limits.h> - - #include <stdlib.h> - #ifdef HAVE_UNISTD_H -@@ -33,6 +34,9 @@ - - #include "tslib-private.h" - -+#define GRAB_EVENTS_WANTED 1 -+#define GRAB_EVENTS_ACTIVE 2 -+ - struct tslib_input { - struct tslib_module_info module; - -@@ -42,6 +46,7 @@ struct tslib_input { - - int sane_fd; - int using_syn; -+ int grab_events; - }; - - static int check_fd(struct tslib_input *i) -@@ -64,6 +69,14 @@ static int check_fd(struct tslib_input *i) - - if (bit & (1 << EV_SYN)) - i->using_syn = 1; -+ -+ if (i->grab_events == GRAB_EVENTS_WANTED) { -+ if (ioctl(ts->fd, EVIOCGRAB, (void *)1)) { -+ fprintf(stderr, "Unable to grab selected input device\n"); -+ return -1; -+ } -+ i->grab_events = GRAB_EVENTS_ACTIVE; -+ } - - return 0; - } -@@ -222,6 +235,15 @@ static int ts_input_read(struct tslib_module_info *inf, - - static int ts_input_fini(struct tslib_module_info *inf) - { -+ struct tslib_input *i = (struct tslib_input *)inf; -+ struct tsdev *ts = inf->dev; -+ -+ if (i->grab_events == GRAB_EVENTS_ACTIVE) { -+ if (ioctl(ts->fd, EVIOCGRAB, (void *)0)) { -+ fprintf(stderr, "Unable to un-grab selected input device\n"); -+ } -+ } -+ - free(inf); - return 0; - } -@@ -231,6 +253,36 @@ static const struct tslib_ops __ts_input_ops = { - .fini = ts_input_fini, - }; - -+static int parse_raw_grab(struct tslib_module_info *inf, char *str, void *data) -+{ -+ struct tslib_input *i = (struct tslib_input *)inf; -+ unsigned long v; -+ int err = errno; -+ -+ v = strtoul(str, NULL, 0); -+ -+ if (v == ULONG_MAX && errno == ERANGE) -+ return -1; -+ -+ errno = err; -+ switch ((int)data) { -+ case 1: -+ if (v) -+ i->grab_events = GRAB_EVENTS_WANTED; -+ break; -+ default: -+ return -1; -+ } -+ return 0; -+} -+ -+static const struct tslib_vars raw_vars[] = -+{ -+ { "grab_events", (void *)1, parse_raw_grab }, -+}; -+ -+#define NR_VARS (sizeof(raw_vars) / sizeof(raw_vars[0])) -+ - TSAPI struct tslib_module_info *mod_init(struct tsdev *dev, const char *params) - { - struct tslib_input *i; -@@ -245,5 +297,12 @@ TSAPI struct tslib_module_info *mod_init(struct tsdev *dev, const char *params) - i->current_p = 0; - i->sane_fd = 0; - i->using_syn = 0; -+ i->grab_events = 0; -+ -+ if (tslib_parse_vars(&i->module, raw_vars, NR_VARS, params)) { -+ free(i); -+ return NULL; -+ } -+ - return &(i->module); - } --- -1.6.5.2 - diff --git a/patches/tslib-1.0/r57-Fix-use-with-devices-that-can-t-measure-pressure-cou.patch b/patches/tslib-1.0/r57-Fix-use-with-devices-that-can-t-measure-pressure-cou.patch deleted file mode 100644 index 87410e2ed..000000000 --- a/patches/tslib-1.0/r57-Fix-use-with-devices-that-can-t-measure-pressure-cou.patch +++ /dev/null @@ -1,97 +0,0 @@ -From c054ab7b2a3b32399f20066f7c600c208b11ef2a Mon Sep 17 00:00:00 2001 -From: kergoth <kergoth@a933c7a4-9bf7-0310-9141-a2e45189604d> -Date: Sat, 1 Nov 2008 22:18:06 +0000 -Subject: [PATCH 09/30] Fix use with devices that can't measure pressure, courtesy Vojtech Pavlik. - -Signed-off-by: Chris Larson <clarson@kergoth.com> - -git-svn-id: svn://svn.berlios.de/tslib/trunk/tslib@57 a933c7a4-9bf7-0310-9141-a2e45189604d ---- - plugins/input-raw.c | 64 +++++++++++++++++++++++++++++++++++++++++--------- - 1 files changed, 52 insertions(+), 12 deletions(-) - -diff --git a/plugins/input-raw.c b/plugins/input-raw.c -index 6b01fd8..e1d393e 100644 ---- a/plugins/input-raw.c -+++ b/plugins/input-raw.c -@@ -49,25 +49,65 @@ struct tslib_input { - int grab_events; - }; - -+#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) -+#define BIT(nr) (1UL << (nr)) -+#define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) -+#define BIT_WORD(nr) ((nr) / BITS_PER_LONG) -+#define BITS_PER_BYTE 8 -+#define BITS_PER_LONG (sizeof(long) * BITS_PER_BYTE) -+#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) -+ - static int check_fd(struct tslib_input *i) - { - struct tsdev *ts = i->module.dev; - int version; -- u_int32_t bit; -- u_int64_t absbit; -- -- if (! ((ioctl(ts->fd, EVIOCGVERSION, &version) >= 0) && -- (version == EV_VERSION) && -- (ioctl(ts->fd, EVIOCGBIT(0, sizeof(bit) * 8), &bit) >= 0) && -- (bit & (1 << EV_ABS)) && -- (ioctl(ts->fd, EVIOCGBIT(EV_ABS, sizeof(absbit) * 8), &absbit) >= 0) && -- (absbit & (1 << ABS_X)) && -- (absbit & (1 << ABS_Y)) && (absbit & (1 << ABS_PRESSURE)))) { -- fprintf(stderr, "selected device is not a touchscreen I understand\n"); -+ long evbit[BITS_TO_LONGS(EV_CNT)]; -+ long absbit[BITS_TO_LONGS(ABS_CNT)]; -+ long keybit[BITS_TO_LONGS(KEY_CNT)]; -+ -+ if (ioctl(ts->fd, EVIOCGVERSION, &version) < 0) { -+ fprintf(stderr, "selected device is not a Linux input event device\n"); -+ return -1; -+ } -+ -+ if (version != EV_VERSION) { -+ fprintf(stderr, "selected device uses a different version of the -+event protocol than tslib was compiled for\n"); -+ return -1; -+ } -+ -+ if ( (ioctl(ts->fd, EVIOCGBIT(0, EV_CNT), evbit) < 0) || -+ !(evbit[BIT_WORD(EV_ABS)] & BIT_MASK(EV_ABS)) || -+ !(evbit[BIT_WORD(EV_KEY)] & BIT_MASK(EV_KEY)) ) { -+ fprintf(stderr, "selected device uses is not a touchscreen (must -+support ABS and KEY event types)\n"); -+ return -1; -+ } -+ -+ if ((ioctl(ts->fd, EVIOCGBIT(EV_ABS, ABS_CNT), absbit)) < 0 || -+ !(absbit[BIT_WORD(ABS_X)] & BIT_MASK(ABS_X)) || -+ !(absbit[BIT_WORD(ABS_Y)] & BIT_MASK(ABS_Y))) { -+ fprintf(stderr, "selected device uses is not a touchscreen (must -+support ABS_X and ABS_Y events)\n"); - return -1; - } - -- if (bit & (1 << EV_SYN)) -+ /* Since some touchscreens (eg. infrared) physically can't measure pressure, -+ the input system doesn't report it on those. Tslib relies on pressure, thus -+ we set it to constant 255. It's still controlled by BTN_TOUCH - when not -+ touched, the pressure is forced to 0. */ -+ -+ if (!(absbit[BIT_WORD(ABS_PRESSURE)] & BIT_MASK(ABS_PRESSURE))) -+ i->current_p = 255; -+ -+ if ((ioctl(ts->fd, EVIOCGBIT(EV_KEY, KEY_CNT), keybit) < 0) || -+ !(absbit[BIT_WORD(BTN_TOUCH)] & BIT_MASK(BTN_TOUCH)) ) { -+ fprintf(stderr, "selected device uses is not a touchscreen (must -+support BTN_TOUCH events)\n"); -+ return -1; -+ } -+ -+ if (evbit[BIT_WORD(EV_SYN)] & BIT_MASK(EV_SYN)) - i->using_syn = 1; - - if (i->grab_events == GRAB_EVENTS_WANTED) { --- -1.6.5.2 - diff --git a/patches/tslib-1.0/r62-Cleanup-and-kill-syntax-errors-introduced-by-copying.patch b/patches/tslib-1.0/r62-Cleanup-and-kill-syntax-errors-introduced-by-copying.patch deleted file mode 100644 index 443ca5098..000000000 --- a/patches/tslib-1.0/r62-Cleanup-and-kill-syntax-errors-introduced-by-copying.patch +++ /dev/null @@ -1,115 +0,0 @@ -From: Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> -Subject: [tslib] add upstream patch - -From 48ff3b48b080d0c69dcdc32e578ccd6977c07729 Mon Sep 17 00:00:00 2001 -From: kergoth <kergoth@a933c7a4-9bf7-0310-9141-a2e45189604d> -Date: Tue, 11 Nov 2008 20:22:25 +0000 -Subject: [PATCH 14/30] Cleanup and kill syntax errors introduced by copying/pasting bits from a badly wrapped mail patch. - -git-svn-id: svn://svn.berlios.de/tslib/trunk/tslib@62 a933c7a4-9bf7-0310-9141-a2e45189604d - -Signed-off-by: Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> ---- - plugins/input-raw.c | 30 +++++++++++++----------------- - 1 files changed, 13 insertions(+), 17 deletions(-) - -diff --git a/plugins/input-raw.c b/plugins/input-raw.c -index e1d393e..9e2ea60 100644 ---- a/plugins/input-raw.c -+++ b/plugins/input-raw.c -@@ -71,24 +71,21 @@ static int check_fd(struct tslib_input *i) - } - - if (version != EV_VERSION) { -- fprintf(stderr, "selected device uses a different version of the --event protocol than tslib was compiled for\n"); -+ fprintf(stderr, "selected device uses a different version of the event protocol than tslib was compiled for\n"); - return -1; - } - - if ( (ioctl(ts->fd, EVIOCGBIT(0, EV_CNT), evbit) < 0) || - !(evbit[BIT_WORD(EV_ABS)] & BIT_MASK(EV_ABS)) || - !(evbit[BIT_WORD(EV_KEY)] & BIT_MASK(EV_KEY)) ) { -- fprintf(stderr, "selected device uses is not a touchscreen (must --support ABS and KEY event types)\n"); -+ fprintf(stderr, "selected device uses is not a touchscreen (must support ABS and KEY event types)\n"); - return -1; - } - - if ((ioctl(ts->fd, EVIOCGBIT(EV_ABS, ABS_CNT), absbit)) < 0 || - !(absbit[BIT_WORD(ABS_X)] & BIT_MASK(ABS_X)) || - !(absbit[BIT_WORD(ABS_Y)] & BIT_MASK(ABS_Y))) { -- fprintf(stderr, "selected device uses is not a touchscreen (must --support ABS_X and ABS_Y events)\n"); -+ fprintf(stderr, "selected device uses is not a touchscreen (must support ABS_X and ABS_Y events)\n"); - return -1; - } - -@@ -102,14 +99,13 @@ support ABS_X and ABS_Y events)\n"); - - if ((ioctl(ts->fd, EVIOCGBIT(EV_KEY, KEY_CNT), keybit) < 0) || - !(absbit[BIT_WORD(BTN_TOUCH)] & BIT_MASK(BTN_TOUCH)) ) { -- fprintf(stderr, "selected device uses is not a touchscreen (must --support BTN_TOUCH events)\n"); -- return -1; -- } -+ fprintf(stderr, "selected device uses is not a touchscreen (must support BTN_TOUCH events)\n"); -+ return -1; -+ } - -- if (evbit[BIT_WORD(EV_SYN)] & BIT_MASK(EV_SYN)) -+ if (evbit[BIT_WORD(EV_SYN)] & BIT_MASK(EV_SYN)) - i->using_syn = 1; -- -+ - if (i->grab_events == GRAB_EVENTS_WANTED) { - if (ioctl(ts->fd, EVIOCGRAB, (void *)1)) { - fprintf(stderr, "Unable to grab selected input device\n"); -@@ -143,7 +139,7 @@ static int ts_input_read(struct tslib_module_info *inf, - total = -1; - break; - } -- -+ - switch (ev.type) { - case EV_KEY: - switch (ev.code) { -@@ -193,7 +189,7 @@ static int ts_input_read(struct tslib_module_info *inf, - } else { - unsigned char *p = (unsigned char *) &ev; - int len = sizeof(struct input_event); -- -+ - while (total < nr) { - ret = read(ts->fd, p, len); - if (ret == -1) { -@@ -202,7 +198,7 @@ static int ts_input_read(struct tslib_module_info *inf, - } - break; - } -- -+ - if (ret < (int)sizeof(struct input_event)) { - /* short read - * restart read to get the rest of the event -@@ -212,7 +208,7 @@ static int ts_input_read(struct tslib_module_info *inf, - continue; - } - /* successful read of a whole event */ -- -+ - if (ev.type == EV_ABS) { - switch (ev.code) { - case ABS_X: -@@ -303,7 +299,7 @@ static int parse_raw_grab(struct tslib_module_info *inf, char *str, void *data) - - if (v == ULONG_MAX && errno == ERANGE) - return -1; -- -+ - errno = err; - switch ((int)data) { - case 1: --- -1.6.5.2 - diff --git a/patches/tslib-1.0/r64-BTN_TOUCH-is-only-required-when-the-device-isn-t-abl.patch b/patches/tslib-1.0/r64-BTN_TOUCH-is-only-required-when-the-device-isn-t-abl.patch deleted file mode 100644 index 8e36c15d3..000000000 --- a/patches/tslib-1.0/r64-BTN_TOUCH-is-only-required-when-the-device-isn-t-abl.patch +++ /dev/null @@ -1,41 +0,0 @@ -From ced2069da079be93b093f4274b5ef428e98870b5 Mon Sep 17 00:00:00 2001 -From: kergoth <kergoth@a933c7a4-9bf7-0310-9141-a2e45189604d> -Date: Tue, 11 Nov 2008 21:27:07 +0000 -Subject: [PATCH 16/30] BTN_TOUCH is only *required* when the device isn't able to measure pressure, - since we can also infer a press/release from the pressure value. - -Signed-off-by: Chris Larson <clarson@kergoth.com> - - -git-svn-id: svn://svn.berlios.de/tslib/trunk/tslib@64 a933c7a4-9bf7-0310-9141-a2e45189604d ---- - plugins/input-raw.c | 11 ++++++----- - 1 files changed, 6 insertions(+), 5 deletions(-) - -diff --git a/plugins/input-raw.c b/plugins/input-raw.c -index 9e2ea60..d342dc7 100644 ---- a/plugins/input-raw.c -+++ b/plugins/input-raw.c -@@ -94,13 +94,14 @@ static int check_fd(struct tslib_input *i) - we set it to constant 255. It's still controlled by BTN_TOUCH - when not - touched, the pressure is forced to 0. */ - -- if (!(absbit[BIT_WORD(ABS_PRESSURE)] & BIT_MASK(ABS_PRESSURE))) -+ if (!(absbit[BIT_WORD(ABS_PRESSURE)] & BIT_MASK(ABS_PRESSURE))) { - i->current_p = 255; - -- if ((ioctl(ts->fd, EVIOCGBIT(EV_KEY, KEY_CNT), keybit) < 0) || -- !(absbit[BIT_WORD(BTN_TOUCH)] & BIT_MASK(BTN_TOUCH)) ) { -- fprintf(stderr, "selected device uses is not a touchscreen (must support BTN_TOUCH events)\n"); -- return -1; -+ if ((ioctl(ts->fd, EVIOCGBIT(EV_KEY, KEY_CNT), keybit) < 0) || -+ !(absbit[BIT_WORD(BTN_TOUCH)] & BIT_MASK(BTN_TOUCH)) ) { -+ fprintf(stderr, "selected device uses is not a touchscreen (must support BTN_TOUCH events)\n"); -+ return -1; -+ } - } - - if (evbit[BIT_WORD(EV_SYN)] & BIT_MASK(EV_SYN)) --- -1.6.5.2 - diff --git a/patches/tslib-1.0/r66-Define-the-_CNT-macros-if-needed.patch b/patches/tslib-1.0/r66-Define-the-_CNT-macros-if-needed.patch deleted file mode 100644 index a77f60d0f..000000000 --- a/patches/tslib-1.0/r66-Define-the-_CNT-macros-if-needed.patch +++ /dev/null @@ -1,40 +0,0 @@ -From: Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> -Subject: [tslib] add upstream patch - -From b2b509ecaee7b449a093c512c78acd180ad53f78 Mon Sep 17 00:00:00 2001 -From: kergoth <kergoth@a933c7a4-9bf7-0310-9141-a2e45189604d> -Date: Tue, 18 Nov 2008 15:47:57 +0000 -Subject: [PATCH 18/30] Define the _CNT macros if needed. - -EV_CNT & friends weren't added to linux/input.h until 2.6.24-rc1. - -git-svn-id: svn://svn.berlios.de/tslib/trunk/tslib@66 a933c7a4-9bf7-0310-9141-a2e45189604d - -Signed-off-by: Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> ---- - plugins/input-raw.c | 9 +++++++++ - 1 files changed, 9 insertions(+), 0 deletions(-) - -diff --git a/plugins/input-raw.c b/plugins/input-raw.c -index d342dc7..2f7f454 100644 ---- a/plugins/input-raw.c -+++ b/plugins/input-raw.c -@@ -31,6 +31,15 @@ - #ifndef EV_SYN /* 2.4 kernel headers */ - # define EV_SYN 0x00 - #endif -+#ifndef EV_CNT -+# define EV_CNT (EV_MAX+1) -+#endif -+#ifndef ABS_CNT -+# define ABS_CNT (ABS_MAX+1) -+#endif -+#ifndef KEY_CNT -+# define KEY_CNT (KEY_MAX+1) -+#endif - - #include "tslib-private.h" - --- -1.6.5.2 - diff --git a/patches/tslib-1.0/r67-Kill-old-unused-ts_read_raw_module.c.patch b/patches/tslib-1.0/r67-Kill-old-unused-ts_read_raw_module.c.patch deleted file mode 100644 index 91edbf225..000000000 --- a/patches/tslib-1.0/r67-Kill-old-unused-ts_read_raw_module.c.patch +++ /dev/null @@ -1,28 +0,0 @@ -From b63e56db2659a82f33999266635e8288bf80d236 Mon Sep 17 00:00:00 2001 -From: kergoth <kergoth@a933c7a4-9bf7-0310-9141-a2e45189604d> -Date: Thu, 20 Nov 2008 16:15:27 +0000 -Subject: [PATCH 19/30] Kill old unused ts_read_raw_module.c - -Signed-off-by: Chris Larson <clarson@kergoth.com> - -git-svn-id: svn://svn.berlios.de/tslib/trunk/tslib@67 a933c7a4-9bf7-0310-9141-a2e45189604d ---- - plugins/input-raw.c | 2 +- - src/ts_read_raw_module.c | 190 ---------------------------------------------- - 2 files changed, 1 insertions(+), 191 deletions(-) - delete mode 100644 src/ts_read_raw_module.c - -src/ts_read_raw_module.c isn't included in the upstream tarball. So this diff -doesn't match upstream's change. [ukl] - -Index: tslib-1.0/plugins/input-raw.c -=================================================================== ---- tslib-1.0.orig/plugins/input-raw.c 2009-11-11 22:40:03.000000000 +0100 -+++ tslib-1.0/plugins/input-raw.c 2009-11-11 22:42:55.000000000 +0100 -@@ -1,5 +1,5 @@ - /* -- * tslib/src/ts_read_raw_module.c -+ * tslib/plugins/input-raw.c - * - * Original version: - * Copyright (C) 2001 Russell King. diff --git a/patches/tslib-1.0/r71-Fix-regularly-reported-absbit-keybit-copy-paste-bug.patch b/patches/tslib-1.0/r71-Fix-regularly-reported-absbit-keybit-copy-paste-bug.patch deleted file mode 100644 index e1053f7c5..000000000 --- a/patches/tslib-1.0/r71-Fix-regularly-reported-absbit-keybit-copy-paste-bug.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 77dcc76c59d6faa4ea384107fe2414cad1000d55 Mon Sep 17 00:00:00 2001 -From: kergoth <kergoth@a933c7a4-9bf7-0310-9141-a2e45189604d> -Date: Sun, 22 Mar 2009 02:20:07 +0000 -Subject: [PATCH 23/30] Fix regularly reported absbit/keybit copy/paste bug. - -Sorry for the delay, folks, I've been busy switching to my new position within -MontaVista. - -Signed-off-by: Chris Larson <clarson@kergoth.com> - -git-svn-id: svn://svn.berlios.de/tslib/trunk/tslib@71 a933c7a4-9bf7-0310-9141-a2e45189604d ---- - plugins/input-raw.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/plugins/input-raw.c b/plugins/input-raw.c -index 855525e..5c4e0ca 100644 ---- a/plugins/input-raw.c -+++ b/plugins/input-raw.c -@@ -107,7 +107,7 @@ static int check_fd(struct tslib_input *i) - i->current_p = 255; - - if ((ioctl(ts->fd, EVIOCGBIT(EV_KEY, KEY_CNT), keybit) < 0) || -- !(absbit[BIT_WORD(BTN_TOUCH)] & BIT_MASK(BTN_TOUCH)) ) { -+ !(keybit[BIT_WORD(BTN_TOUCH)] & BIT_MASK(BTN_TOUCH)) ) { - fprintf(stderr, "selected device uses is not a touchscreen (must support BTN_TOUCH events)\n"); - return -1; - } --- -1.6.5.2 - diff --git a/patches/tslib-1.0/r73-Prefix-correct-some-error-messages-in-input-raw-modu.patch b/patches/tslib-1.0/r73-Prefix-correct-some-error-messages-in-input-raw-modu.patch deleted file mode 100644 index 6ac74e52b..000000000 --- a/patches/tslib-1.0/r73-Prefix-correct-some-error-messages-in-input-raw-modu.patch +++ /dev/null @@ -1,102 +0,0 @@ -From 7ad7a4665c8d13cce1a11623ce672f14fab1c8e3 Mon Sep 17 00:00:00 2001 -From: kergoth <kergoth@a933c7a4-9bf7-0310-9141-a2e45189604d> -Date: Tue, 24 Mar 2009 17:54:45 +0000 -Subject: [PATCH 25/30] Prefix/correct some error messages in input-raw module - -I guess there were some copy & paste mistakes in the error messages in the -input-raw module and BTW I unified the messages with the tslib prefix used in -other messages. - -Signed-off-by: Michael Heimpold <michael.heimpold@s2000.tu-chemnitz.de> -Signed-off-by: Chris Larson <clarson@kergoth.com> - -git-svn-id: svn://svn.berlios.de/tslib/trunk/tslib@73 a933c7a4-9bf7-0310-9141-a2e45189604d ---- - plugins/input-raw.c | 20 ++++++++++---------- - 1 files changed, 10 insertions(+), 10 deletions(-) - -diff --git a/plugins/input-raw.c b/plugins/input-raw.c -index 5c4e0ca..a22390d 100644 ---- a/plugins/input-raw.c -+++ b/plugins/input-raw.c -@@ -75,26 +75,26 @@ static int check_fd(struct tslib_input *i) - long keybit[BITS_TO_LONGS(KEY_CNT)]; - - if (ioctl(ts->fd, EVIOCGVERSION, &version) < 0) { -- fprintf(stderr, "selected device is not a Linux input event device\n"); -+ fprintf(stderr, "tslib: Selected device is not a Linux input event device\n"); - return -1; - } - - if (version != EV_VERSION) { -- fprintf(stderr, "selected device uses a different version of the event protocol than tslib was compiled for\n"); -+ fprintf(stderr, "tslib: Selected device uses a different version of the event protocol than tslib was compiled for\n"); - return -1; - } - - if ( (ioctl(ts->fd, EVIOCGBIT(0, EV_CNT), evbit) < 0) || - !(evbit[BIT_WORD(EV_ABS)] & BIT_MASK(EV_ABS)) || - !(evbit[BIT_WORD(EV_KEY)] & BIT_MASK(EV_KEY)) ) { -- fprintf(stderr, "selected device uses is not a touchscreen (must support ABS and KEY event types)\n"); -+ fprintf(stderr, "tslib: Selected device is not a touchscreen (must support ABS and KEY event types)\n"); - return -1; - } - - if ((ioctl(ts->fd, EVIOCGBIT(EV_ABS, ABS_CNT), absbit)) < 0 || - !(absbit[BIT_WORD(ABS_X)] & BIT_MASK(ABS_X)) || - !(absbit[BIT_WORD(ABS_Y)] & BIT_MASK(ABS_Y))) { -- fprintf(stderr, "selected device uses is not a touchscreen (must support ABS_X and ABS_Y events)\n"); -+ fprintf(stderr, "tslib: Selected device is not a touchscreen (must support ABS_X and ABS_Y events)\n"); - return -1; - } - -@@ -108,7 +108,7 @@ static int check_fd(struct tslib_input *i) - - if ((ioctl(ts->fd, EVIOCGBIT(EV_KEY, KEY_CNT), keybit) < 0) || - !(keybit[BIT_WORD(BTN_TOUCH)] & BIT_MASK(BTN_TOUCH)) ) { -- fprintf(stderr, "selected device uses is not a touchscreen (must support BTN_TOUCH events)\n"); -+ fprintf(stderr, "tslib: Selected device is not a touchscreen (must support BTN_TOUCH events)\n"); - return -1; - } - } -@@ -118,7 +118,7 @@ static int check_fd(struct tslib_input *i) - - if (i->grab_events == GRAB_EVENTS_WANTED) { - if (ioctl(ts->fd, EVIOCGRAB, (void *)1)) { -- fprintf(stderr, "Unable to grab selected input device\n"); -+ fprintf(stderr, "tslib: Unable to grab selected input device\n"); - return -1; - } - i->grab_events = GRAB_EVENTS_ACTIVE; -@@ -176,8 +176,8 @@ static int ts_input_read(struct tslib_module_info *inf, - fprintf(stderr, "RAW---------------------> %d %d %d %d.%d\n", - samp->x, samp->y, samp->pressure, samp->tv.tv_sec, - samp->tv.tv_usec); -- #endif /*DEBUG*/ -- samp++; -+ #endif /* DEBUG */ -+ samp++; - total++; - break; - case EV_ABS: -@@ -251,7 +251,7 @@ static int ts_input_read(struct tslib_module_info *inf, - #ifdef DEBUG - fprintf(stderr, "RAW---------------------------> %d %d %d\n", - samp->x, samp->y, samp->pressure); -- #endif /*DEBUG*/ -+ #endif /* DEBUG */ - samp++; - total++; - } else if (ev.type == EV_KEY) { -@@ -286,7 +286,7 @@ static int ts_input_fini(struct tslib_module_info *inf) - - if (i->grab_events == GRAB_EVENTS_ACTIVE) { - if (ioctl(ts->fd, EVIOCGRAB, (void *)0)) { -- fprintf(stderr, "Unable to un-grab selected input device\n"); -+ fprintf(stderr, "tslib: Unable to un-grab selected input device\n"); - } - } - --- -1.6.5.2 - diff --git a/patches/tslib-1.0/r75-Rely-on-SYN-Events-when-pen-is-lifted.patch b/patches/tslib-1.0/r75-Rely-on-SYN-Events-when-pen-is-lifted.patch deleted file mode 100644 index e192da619..000000000 --- a/patches/tslib-1.0/r75-Rely-on-SYN-Events-when-pen-is-lifted.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 34cd525d9cf190d0d89a60f7483327f8d21bfb80 Mon Sep 17 00:00:00 2001 -From: kergoth <kergoth@a933c7a4-9bf7-0310-9141-a2e45189604d> -Date: Tue, 24 Mar 2009 18:05:15 +0000 -Subject: [PATCH 27/30] Rely on SYN-Events when pen is lifted - -when the input-raw module of tslib relies on SYN-Events, it should not report -a BTN_TOUCH to upper layers before the corresponding EV_SYN was seen. - -This prevents seeing two pen up events as described in my posting from -Jan, 14 2009. - -Signed-off-by: Michael Heimpold <michael.heimpold@s2000.tu-chemnitz.de> -Signed-off-by: Chris Larson <clarson@kergoth.com> - -git-svn-id: svn://svn.berlios.de/tslib/trunk/tslib@75 a933c7a4-9bf7-0310-9141-a2e45189604d ---- - plugins/input-raw.c | 9 +++------ - 1 files changed, 3 insertions(+), 6 deletions(-) - -diff --git a/plugins/input-raw.c b/plugins/input-raw.c -index a22390d..d75afef 100644 ---- a/plugins/input-raw.c -+++ b/plugins/input-raw.c -@@ -156,12 +156,9 @@ static int ts_input_read(struct tslib_module_info *inf, - case BTN_TOUCH: - if (ev.value == 0) { - /* pen up */ -- samp->x = 0; -- samp->y = 0; -- samp->pressure = 0; -- samp->tv = ev.time; -- samp++; -- total++; -+ i->current_x = 0; -+ i->current_y = 0; -+ i->current_p = 0; - } - break; - } --- -1.6.5.2 - diff --git a/patches/tslib-1.0/r78-input-raw-Handling-of-EVIOCGBIT-ioctl-coding.patch b/patches/tslib-1.0/r78-input-raw-Handling-of-EVIOCGBIT-ioctl-coding.patch deleted file mode 100644 index 5bb813987..000000000 --- a/patches/tslib-1.0/r78-input-raw-Handling-of-EVIOCGBIT-ioctl-coding.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 16a7c3815c90edce575336bd0da871a9bc606b6b Mon Sep 17 00:00:00 2001 -From: kergoth <kergoth@a933c7a4-9bf7-0310-9141-a2e45189604d> -Date: Wed, 30 Sep 2009 21:25:09 +0000 -Subject: [PATCH 30/30] input-raw: Handling of EVIOCGBIT() ioctl coding - -Correct the coding of ioctl() when using EVIOCGBIT() macro. -Indeed, instead of a number of bits, this field requires -a size in bytes. -This bug is described in the Linux kernel drivers/input/evdev.c -file and in this webpage: -http://userweb.kernel.org/~dtor/eviocgbit-bug.html - -Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> -Signed-off-by: Chris Larson <clarson@mvista.com> - -git-svn-id: svn://svn.berlios.de/tslib/trunk/tslib@78 a933c7a4-9bf7-0310-9141-a2e45189604d ---- - plugins/input-raw.c | 6 +++--- - 1 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/plugins/input-raw.c b/plugins/input-raw.c -index d75afef..6bca86b 100644 ---- a/plugins/input-raw.c -+++ b/plugins/input-raw.c -@@ -84,14 +84,14 @@ static int check_fd(struct tslib_input *i) - return -1; - } - -- if ( (ioctl(ts->fd, EVIOCGBIT(0, EV_CNT), evbit) < 0) || -+ if ( (ioctl(ts->fd, EVIOCGBIT(0, sizeof(evbit)), evbit) < 0) || - !(evbit[BIT_WORD(EV_ABS)] & BIT_MASK(EV_ABS)) || - !(evbit[BIT_WORD(EV_KEY)] & BIT_MASK(EV_KEY)) ) { - fprintf(stderr, "tslib: Selected device is not a touchscreen (must support ABS and KEY event types)\n"); - return -1; - } - -- if ((ioctl(ts->fd, EVIOCGBIT(EV_ABS, ABS_CNT), absbit)) < 0 || -+ if ((ioctl(ts->fd, EVIOCGBIT(EV_ABS, sizeof(absbit)), absbit)) < 0 || - !(absbit[BIT_WORD(ABS_X)] & BIT_MASK(ABS_X)) || - !(absbit[BIT_WORD(ABS_Y)] & BIT_MASK(ABS_Y))) { - fprintf(stderr, "tslib: Selected device is not a touchscreen (must support ABS_X and ABS_Y events)\n"); -@@ -106,7 +106,7 @@ static int check_fd(struct tslib_input *i) - if (!(absbit[BIT_WORD(ABS_PRESSURE)] & BIT_MASK(ABS_PRESSURE))) { - i->current_p = 255; - -- if ((ioctl(ts->fd, EVIOCGBIT(EV_KEY, KEY_CNT), keybit) < 0) || -+ if ((ioctl(ts->fd, EVIOCGBIT(EV_KEY, sizeof(keybit)), keybit) < 0) || - !(keybit[BIT_WORD(BTN_TOUCH)] & BIT_MASK(BTN_TOUCH)) ) { - fprintf(stderr, "tslib: Selected device is not a touchscreen (must support BTN_TOUCH events)\n"); - return -1; --- -1.6.5.2 - diff --git a/patches/tslib-1.0/series b/patches/tslib-1.0/series deleted file mode 100644 index 0f8aa0a04..000000000 --- a/patches/tslib-1.0/series +++ /dev/null @@ -1,21 +0,0 @@ -tslib-1.0_link_plugins_against_libts.patch -ts_test_add_quit_button.diff -p0 -tests_assume_input_api.diff -p0 -tests_clear_screen_at_end.diff -p0 -dmc-support.diff -add-open-env.diff -egalax.diff -fix-autotools.diff -r52-This-patch-adds-support-for-EVIOCGRAB-on-the-input-d.patch -r57-Fix-use-with-devices-that-can-t-measure-pressure-cou.patch -r62-Cleanup-and-kill-syntax-errors-introduced-by-copying.patch -r64-BTN_TOUCH-is-only-required-when-the-device-isn-t-abl.patch -r66-Define-the-_CNT-macros-if-needed.patch -r67-Kill-old-unused-ts_read_raw_module.c.patch -r71-Fix-regularly-reported-absbit-keybit-copy-paste-bug.patch -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 -0001-tslib-fails-to-compile-on-Ubuntu-8.10-easy-patch.patch diff --git a/patches/tslib-1.0/tests_assume_input_api.diff b/patches/tslib-1.0/tests_assume_input_api.diff deleted file mode 100644 index 7c615e4fd..000000000 --- a/patches/tslib-1.0/tests_assume_input_api.diff +++ /dev/null @@ -1,46 +0,0 @@ -Subject: tests: assume INPUT_API for tests, so /den/input/event0 is read as default -From: Wolfram Sang <w.sang@pengutronix.de> - -Subject says it all. - -Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> - ---- -# 20081124: wsa: already sent upstream. got improved & applied. - - tests/ts_calibrate.c | 4 ---- - tests/ts_test.c | 4 ---- - 2 files changed, 8 deletions(-) - -Index: tests/ts_calibrate.c -=================================================================== ---- tests/ts_calibrate.c.orig -+++ tests/ts_calibrate.c -@@ -179,11 +179,7 @@ int main() - if( (tsdevice = getenv("TSLIB_TSDEVICE")) != NULL ) { - ts = ts_open(tsdevice,0); - } else { --#ifdef USE_INPUT_API - ts = ts_open("/dev/input/event0", 0); --#else -- ts = ts_open("/dev/touchscreen/ucb1x00", 0); --#endif /* USE_INPUT_API */ - } - - if (!ts) { -Index: tests/ts_test.c -=================================================================== ---- tests/ts_test.c.orig -+++ tests/ts_test.c -@@ -121,11 +121,7 @@ int main() - signal(SIGTERM, sig); - - if ((tsdevice = getenv("TSLIB_TSDEVICE")) == NULL) { --#ifdef USE_INPUT_API - tsdevice = strdup ("/dev/input/event0"); --#else -- tsdevice = strdup ("/dev/touchscreen/ucb1x00"); --#endif /* USE_INPUT_API */ - } - - ts = ts_open (tsdevice, 0); diff --git a/patches/tslib-1.0/tests_clear_screen_at_end.diff b/patches/tslib-1.0/tests_clear_screen_at_end.diff deleted file mode 100644 index 944b678ba..000000000 --- a/patches/tslib-1.0/tests_clear_screen_at_end.diff +++ /dev/null @@ -1,37 +0,0 @@ -Subject: ts_test: clear screen on exit -From: Wolfram Sang <w.sang@pengutronix.de> - -Make sure that ts_test clears the screen on exit. - -Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> - ---- -# 20081124: wsa: sent upstream as RFC. - - tests/ts_calibrate.c | 1 + - tests/ts_test.c | 1 + - 2 files changed, 2 insertions(+) - -Index: tests/ts_test.c -=================================================================== ---- tests/ts_test.c.orig -+++ tests/ts_test.c -@@ -213,5 +213,6 @@ int main() - if (quit_pressed) - break; - } -+ fillrect (0, 0, xres - 1, yres - 1, 0); - close_framebuffer(); - } -Index: tests/ts_calibrate.c -=================================================================== ---- tests/ts_calibrate.c.orig -+++ tests/ts_calibrate.c -@@ -235,6 +235,7 @@ int main() - i = -1; - } - -+ fillrect (0, 0, xres - 1, yres - 1, 0); - close_framebuffer(); - return i; - } diff --git a/patches/tslib-1.0/ts_test_add_quit_button.diff b/patches/tslib-1.0/ts_test_add_quit_button.diff deleted file mode 100644 index b8bd3ffdc..000000000 --- a/patches/tslib-1.0/ts_test_add_quit_button.diff +++ /dev/null @@ -1,73 +0,0 @@ -Subject: ts_test: add quit button -From: Wolfram Sang <w.sang@pengutronix.de> - -Add a quit button to ts_test. - -Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> - ---- -# 20081124: wsa: already sent upstream. applied. - - tests/ts_test.c | 19 +++++++++++++------ - 1 file changed, 13 insertions(+), 6 deletions(-) - -Index: tests/ts_test.c -=================================================================== ---- tests/ts_test.c.orig -+++ tests/ts_test.c -@@ -44,7 +44,7 @@ static int button_palette [6] = - 1, 5, 0 - }; - --#define NR_BUTTONS 2 -+#define NR_BUTTONS 3 - static struct ts_button buttons [NR_BUTTONS]; - - static void sig(int sig) -@@ -112,6 +112,7 @@ int main() - int x, y; - unsigned int i; - unsigned int mode = 0; -+ int quit_pressed = 0; - - char *tsdevice=NULL; - -@@ -152,13 +153,15 @@ int main() - - /* Initialize buttons */ - memset (&buttons, 0, sizeof (buttons)); -- buttons [0].w = buttons [1].w = xres / 4; -- buttons [0].h = buttons [1].h = 20; -- buttons [0].x = xres / 4 - buttons [0].w / 2; -- buttons [1].x = (3 * xres) / 4 - buttons [0].w / 2; -- buttons [0].y = buttons [1].y = 10; -+ buttons [0].w = buttons [1].w = buttons [2].w = xres / 4; -+ buttons [0].h = buttons [1].h = buttons [2].h = 20; -+ buttons [0].x = 0; -+ buttons [1].x = (3 * xres) / 8; -+ buttons [2].x = (3 * xres) / 4; -+ buttons [0].y = buttons [1].y = buttons [2].y = 10; - buttons [0].text = "Drag"; - buttons [1].text = "Draw"; -+ buttons [2].text = "Quit"; - - refresh_screen (); - -@@ -196,6 +199,8 @@ int main() - mode = 1; - refresh_screen (); - break; -+ case 2: -+ quit_pressed = 1; - } - - printf("%ld.%06ld: %6d %6d %6d\n", samp.tv.tv_sec, samp.tv.tv_usec, -@@ -209,6 +214,8 @@ int main() - mode |= 0x80000000; - } else - mode &= ~0x80000000; -+ if (quit_pressed) -+ break; - } - close_framebuffer(); - } diff --git a/patches/tslib-1.0/tslib-1.0_link_plugins_against_libts.patch b/patches/tslib-1.0/tslib-1.0_link_plugins_against_libts.patch deleted file mode 100644 index c1eb193fb..000000000 --- a/patches/tslib-1.0/tslib-1.0_link_plugins_against_libts.patch +++ /dev/null @@ -1,68 +0,0 @@ -From: Denis Oliver Kropp <dok@directfb.org> -Subject: Link plugins against main library to allow dynamic loading of libts without RTLD_GLOBAL - -Signed-off-by: Denis Oliver Kropp <dok@directfb.org> ---- -#20081124: wsa: printf already fixed in upstream. Makefile.in not present in scm. -# Makefile.am fix sent upstream. - -diff -pur tslib-1.0/plugins/Makefile.am tslib-1.0-hacked/plugins/Makefile.am ---- tslib-1.0/plugins/Makefile.am 2006-08-24 23:02:54.000000000 +0200 -+++ tslib-1.0-hacked/plugins/Makefile.am 2007-12-02 05:45:39.000000000 +0100 -@@ -16,7 +16,7 @@ INCLUDES = -I$(top_srcdir)/src - #LTVSN = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ - # -release $(LT_RELEASE) - LTVSN = -avoid-version --LIBS = -+LIBS = $(top_srcdir)/src/libts.la - pluginexecdir = $(PLUGIN_DIR) - - if ENABLE_LINEAR_MODULE -diff -pur tslib-1.0/plugins/Makefile.in tslib-1.0-hacked/plugins/Makefile.in ---- tslib-1.0/plugins/Makefile.in 2007-08-29 10:42:51.000000000 +0200 -+++ tslib-1.0-hacked/plugins/Makefile.in 2007-12-02 05:45:46.000000000 +0100 -@@ -219,7 +219,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_P - LDFLAGS = @LDFLAGS@ - LIBFLAGS = @LIBFLAGS@ - LIBOBJS = @LIBOBJS@ --LIBS = -+LIBS = $(top_srcdir)/src/libts.la - LIBTOOL = @LIBTOOL@ - LN_S = @LN_S@ - LTLIBOBJS = @LTLIBOBJS@ -diff -pur tslib-1.0/src/ts_load_module.c tslib-1.0-hacked/src/ts_load_module.c ---- tslib-1.0/src/ts_load_module.c 2006-08-24 23:02:55.000000000 +0200 -+++ tslib-1.0-hacked/src/ts_load_module.c 2007-12-02 05:36:24.000000000 +0100 -@@ -46,17 +46,21 @@ int __ts_load_module(struct tsdev *ts, c - printf ("Loading module %s\n", fn); - #endif - handle = dlopen(fn, RTLD_NOW); -- if (!handle) -- return -1; -+ if (!handle) { -+ printf("tslib: dlopen(\"%s\") failed: %s\n", fn, dlerror()); -+ return -1; -+ } - - init = dlsym(handle, "mod_init"); - if (!init) { -+ printf("tslib: dlsym(handle, \"mod_init\") failed: %s\n", dlerror()); - dlclose(handle); - return -1; - } - - info = init(ts, params); - if (!info) { -+ printf("tslib: init() failed!\n"); - dlclose(handle); - return -1; - } -@@ -67,6 +71,8 @@ int __ts_load_module(struct tsdev *ts, c - ret = __ts_attach_raw(ts, info); - } else { - ret = __ts_attach(ts, info); -+ if (ret) -+ printf("tslib: __ts_attach(ts, info) failed with code %d!\n", ret); - } - if (ret) { - info->ops->fini(info); diff --git a/patches/tslib-1.1/0001-Link-plugins-against-main-library-to-allow-dynamic-l.patch b/patches/tslib-1.1/0001-Link-plugins-against-main-library-to-allow-dynamic-l.patch new file mode 100644 index 000000000..941d36410 --- /dev/null +++ b/patches/tslib-1.1/0001-Link-plugins-against-main-library-to-allow-dynamic-l.patch @@ -0,0 +1,23 @@ +From: Denis Oliver Kropp <dok@directfb.org> +Date: Mon, 3 Feb 2014 09:57:25 +0100 +Subject: [PATCH] Link plugins against main library to allow dynamic loading of + libts without RTLD_GLOBAL + +Signed-off-by: Denis Oliver Kropp <dok@directfb.org> +--- + plugins/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/plugins/Makefile.am b/plugins/Makefile.am +index e938e17..d8cbfd9 100644 +--- a/plugins/Makefile.am ++++ b/plugins/Makefile.am +@@ -15,7 +15,7 @@ INCLUDES = -I$(top_srcdir)/src + #LTVSN = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ + # -release $(LT_RELEASE) + LTVSN = -avoid-version +-LIBS = ++LIBS = $(top_srcdir)/src/libts.la + pluginexecdir = $(PLUGIN_DIR) + + if ENABLE_LINEAR_MODULE diff --git a/patches/tslib-1.1/0002-ts_test-clear-screen-on-exit.patch b/patches/tslib-1.1/0002-ts_test-clear-screen-on-exit.patch new file mode 100644 index 000000000..a1db4a147 --- /dev/null +++ b/patches/tslib-1.1/0002-ts_test-clear-screen-on-exit.patch @@ -0,0 +1,36 @@ +From: Wolfram Sang <w.sang@pengutronix.de> +Date: Mon, 3 Feb 2014 09:57:25 +0100 +Subject: [PATCH] ts_test: clear screen on exit + +Make sure that ts_test clears the screen on exit. + +Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> +--- + tests/ts_calibrate.c | 1 + + tests/ts_test.c | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/tests/ts_calibrate.c b/tests/ts_calibrate.c +index eb0aca3..ea503a4 100644 +--- a/tests/ts_calibrate.c ++++ b/tests/ts_calibrate.c +@@ -268,6 +268,7 @@ int main() + i = -1; + } + ++ fillrect (0, 0, xres - 1, yres - 1, 0); + close_framebuffer(); + return i; + } +diff --git a/tests/ts_test.c b/tests/ts_test.c +index fbbc9b8..d47c6e0 100644 +--- a/tests/ts_test.c ++++ b/tests/ts_test.c +@@ -213,6 +213,7 @@ int main() + if (quit_pressed) + break; + } ++ fillrect (0, 0, xres - 1, yres - 1, 0); + close_framebuffer(); + + return 0; diff --git a/patches/tslib-1.1/0003-input-raw-call-check_fd-only-once.patch b/patches/tslib-1.1/0003-input-raw-call-check_fd-only-once.patch new file mode 100644 index 000000000..d977c6365 --- /dev/null +++ b/patches/tslib-1.1/0003-input-raw-call-check_fd-only-once.patch @@ -0,0 +1,22 @@ +From: Michael Olbrich <m.olbrich@pengutronix.de> +Date: Mon, 3 Feb 2014 10:55:42 +0100 +Subject: [PATCH] input-raw: call check_fd() only once + +Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> +--- + plugins/input-raw.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/plugins/input-raw.c b/plugins/input-raw.c +index 10454da..5ce0abb 100644 +--- a/plugins/input-raw.c ++++ b/plugins/input-raw.c +@@ -129,7 +129,7 @@ static int check_fd(struct tslib_input *i) + i->grab_events = GRAB_EVENTS_ACTIVE; + } + +- return 0; ++ return 1; + } + + static int ts_input_read(struct tslib_module_info *inf, diff --git a/patches/tslib-1.0/autogen.sh b/patches/tslib-1.1/autogen.sh index 9f8a4cb7d..9f8a4cb7d 120000 --- a/patches/tslib-1.0/autogen.sh +++ b/patches/tslib-1.1/autogen.sh diff --git a/patches/tslib-1.1/series b/patches/tslib-1.1/series new file mode 100644 index 000000000..adb440589 --- /dev/null +++ b/patches/tslib-1.1/series @@ -0,0 +1,6 @@ +# generated by git-ptx-patches +#tag:base --start-number 1 +0001-Link-plugins-against-main-library-to-allow-dynamic-l.patch +0002-ts_test-clear-screen-on-exit.patch +0003-input-raw-call-check_fd-only-once.patch +# bc8437f799188bde6c8ef1bd1f0ce6b7 - git-ptx-patches magic diff --git a/rules/tslib.make b/rules/tslib.make index a0f48543d..9ec343e03 100644 --- a/rules/tslib.make +++ b/rules/tslib.make @@ -17,11 +17,11 @@ PACKAGES-$(PTXCONF_TSLIB) += tslib # # Paths and names # -TSLIB_VERSION := 1.0 -TSLIB_MD5 := 970cc089da1a75f6626172543a2e8df4 +TSLIB_VERSION := 1.1 +TSLIB_MD5 := 6ee9bf26c18f06cfc0ceb278bb927589 TSLIB := tslib-$(TSLIB_VERSION) TSLIB_SUFFIX := tar.bz2 -TSLIB_URL := http://www.pengutronix.de/software/ptxdist/temporary-src/$(TSLIB).$(TSLIB_SUFFIX) +TSLIB_URL := https://github.com/kergoth/tslib/releases/download/1.1/$(TSLIB).$(TSLIB_SUFFIX) TSLIB_SOURCE := $(SRCDIR)/$(TSLIB).$(TSLIB_SUFFIX) TSLIB_DIR := $(BUILDDIR)/$(TSLIB) @@ -29,13 +29,21 @@ TSLIB_DIR := $(BUILDDIR)/$(TSLIB) # Prepare # ---------------------------------------------------------------------------- -TSLIB_PATH := PATH=$(CROSS_PATH) -TSLIB_ENV := $(CROSS_ENV) - # # autoconf # -TSLIB_AUTOCONF := $(CROSS_AUTOCONF_USR) +TSLIB_CONF_TOOL :autoconf +TSLIB_CONF_OPT := \ + $(CROSS_AUTOCONF_USR) \ + --disable-static \ + --enable-shared \ + --enable-linear \ + --enable-dejitter \ + --enable-linear-h2200 \ + --enable-variance \ + --enable-pthres \ + --disable-debug + # ---------------------------------------------------------------------------- # Target-Install @@ -53,7 +61,7 @@ $(STATEDIR)/tslib.targetinstall: @$(call install_alternative, tslib, 0, 0, 0644, \ /etc/ts.conf) - @$(call install_lib, tslib, 0, 0, 0644, libts-0.0) + @$(call install_lib, tslib, 0, 0, 0644, libts-1.0) ifdef PTXCONF_TSLIB_TS_CALIBRATE @$(call install_copy, tslib, 0, 0, 0755, -, /usr/bin/ts_calibrate) |