From ea0ed6298a772fd62b0248717b04ac116f8221b4 Mon Sep 17 00:00:00 2001 From: Rolf Leggewie Date: Wed, 13 Feb 2008 11:05:34 +0000 Subject: tslib: consolidate, taking extra care 0038f02055e33a3dad0ba914de112ce9450c45d4 is dealt with properly --- packages/tslib/tslib-1.0/bd-neon/.mtn2git_empty | 0 packages/tslib/tslib-1.0/bd-neon/ts.conf | 5 - packages/tslib/tslib-1.0/bd-neon/tslib.sh | 6 -- packages/tslib/tslib-1.0/fic-gta01/.mtn2git_empty | 0 packages/tslib/tslib-1.0/fic-gta01/ts.conf | 25 ----- packages/tslib/tslib-1.0/ts.conf | 25 ----- .../tslib-1.0/tslib-input_raw-grab_events.patch | 120 --------------------- packages/tslib/tslib/bd-neon/.mtn2git_empty | 0 packages/tslib/tslib/bd-neon/ts.conf | 5 + packages/tslib/tslib/bd-neon/tslib.sh | 6 ++ packages/tslib/tslib/fic-gta01/.mtn2git_empty | 0 packages/tslib/tslib/fic-gta01/ts.conf | 25 +++++ packages/tslib/tslib/ts.conf | 2 +- .../tslib/tslib/tslib-input_raw-grab_events.patch | 120 +++++++++++++++++++++ 14 files changed, 157 insertions(+), 182 deletions(-) delete mode 100644 packages/tslib/tslib-1.0/bd-neon/.mtn2git_empty delete mode 100644 packages/tslib/tslib-1.0/bd-neon/ts.conf delete mode 100644 packages/tslib/tslib-1.0/bd-neon/tslib.sh delete mode 100644 packages/tslib/tslib-1.0/fic-gta01/.mtn2git_empty delete mode 100644 packages/tslib/tslib-1.0/fic-gta01/ts.conf delete mode 100644 packages/tslib/tslib-1.0/ts.conf delete mode 100644 packages/tslib/tslib-1.0/tslib-input_raw-grab_events.patch create mode 100644 packages/tslib/tslib/bd-neon/.mtn2git_empty create mode 100644 packages/tslib/tslib/bd-neon/ts.conf create mode 100644 packages/tslib/tslib/bd-neon/tslib.sh create mode 100644 packages/tslib/tslib/fic-gta01/.mtn2git_empty create mode 100644 packages/tslib/tslib/fic-gta01/ts.conf create mode 100644 packages/tslib/tslib/tslib-input_raw-grab_events.patch (limited to 'packages') diff --git a/packages/tslib/tslib-1.0/bd-neon/.mtn2git_empty b/packages/tslib/tslib-1.0/bd-neon/.mtn2git_empty deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/packages/tslib/tslib-1.0/bd-neon/ts.conf b/packages/tslib/tslib-1.0/bd-neon/ts.conf deleted file mode 100644 index 15fe294ce6..0000000000 --- a/packages/tslib/tslib-1.0/bd-neon/ts.conf +++ /dev/null @@ -1,5 +0,0 @@ -module_raw ucb1x00 -module pthres pmin=1 -module variance delta=500 -module dejitter delta=10000 -module linear diff --git a/packages/tslib/tslib-1.0/bd-neon/tslib.sh b/packages/tslib/tslib-1.0/bd-neon/tslib.sh deleted file mode 100644 index b5f1c906f3..0000000000 --- a/packages/tslib/tslib-1.0/bd-neon/tslib.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -TSLIB_TSDEVICE=/dev/touch_ucb1x00 - -export TSLIB_TSDEVICE - diff --git a/packages/tslib/tslib-1.0/fic-gta01/.mtn2git_empty b/packages/tslib/tslib-1.0/fic-gta01/.mtn2git_empty deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/packages/tslib/tslib-1.0/fic-gta01/ts.conf b/packages/tslib/tslib-1.0/fic-gta01/ts.conf deleted file mode 100644 index 82f712ef41..0000000000 --- a/packages/tslib/tslib-1.0/fic-gta01/ts.conf +++ /dev/null @@ -1,25 +0,0 @@ -# Uncomment if you wish to use the linux input layer event interface -module_raw input grab_events=1 - -# Uncomment if you're using a Sharp Zaurus SL-5500/SL-5000d -# module_raw collie - -# Uncomment if you're using a Sharp Zaurus SL-C700/C750/C760/C860 -# module_raw corgi - -# Uncomment if you're using a device with a UCB1200/1300/1400 TS interface -# module_raw ucb1x00 - -# Uncomment if you're using an HP iPaq h3600 or similar -# module_raw h3600 - -# Uncomment if you're using a Hitachi Webpad -# module_raw mk712 - -# Uncomment if you're using an IBM Arctic II -# module_raw arctic2 - -module pthres pmin=1 -module variance delta=30 -module dejitter delta=100 -module linear diff --git a/packages/tslib/tslib-1.0/ts.conf b/packages/tslib/tslib-1.0/ts.conf deleted file mode 100644 index 1abde2fc7f..0000000000 --- a/packages/tslib/tslib-1.0/ts.conf +++ /dev/null @@ -1,25 +0,0 @@ -# Uncomment if you wish to use the linux input layer event interface -module_raw input grab_events=0 - -# Uncomment if you're using a Sharp Zaurus SL-5500/SL-5000d -# module_raw collie - -# Uncomment if you're using a Sharp Zaurus SL-C700/C750/C760/C860 -# module_raw corgi - -# Uncomment if you're using a device with a UCB1200/1300/1400 TS interface -# module_raw ucb1x00 - -# Uncomment if you're using an HP iPaq h3600 or similar -# module_raw h3600 - -# Uncomment if you're using a Hitachi Webpad -# module_raw mk712 - -# Uncomment if you're using an IBM Arctic II -# module_raw arctic2 - -module pthres pmin=1 -module variance delta=30 -module dejitter delta=100 -module linear diff --git a/packages/tslib/tslib-1.0/tslib-input_raw-grab_events.patch b/packages/tslib/tslib-1.0/tslib-input_raw-grab_events.patch deleted file mode 100644 index 4bd0a05531..0000000000 --- a/packages/tslib/tslib-1.0/tslib-input_raw-grab_events.patch +++ /dev/null @@ -1,120 +0,0 @@ -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 - -Index: a/plugins/input-raw.c -=================================================================== ---- a/plugins/input-raw.c (revision 49) -+++ b/plugins/input-raw.c (working copy) -@@ -18,6 +18,7 @@ - - #include - #include -+#include - - #include - #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 @@ - - int sane_fd; - int using_syn; -+ int grab_events; - }; - - static int check_fd(struct tslib_input *i) -@@ -64,6 +69,14 @@ - - 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_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 @@ - .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 @@ - 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); - } diff --git a/packages/tslib/tslib/bd-neon/.mtn2git_empty b/packages/tslib/tslib/bd-neon/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/tslib/tslib/bd-neon/ts.conf b/packages/tslib/tslib/bd-neon/ts.conf new file mode 100644 index 0000000000..15fe294ce6 --- /dev/null +++ b/packages/tslib/tslib/bd-neon/ts.conf @@ -0,0 +1,5 @@ +module_raw ucb1x00 +module pthres pmin=1 +module variance delta=500 +module dejitter delta=10000 +module linear diff --git a/packages/tslib/tslib/bd-neon/tslib.sh b/packages/tslib/tslib/bd-neon/tslib.sh new file mode 100644 index 0000000000..b5f1c906f3 --- /dev/null +++ b/packages/tslib/tslib/bd-neon/tslib.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +TSLIB_TSDEVICE=/dev/touch_ucb1x00 + +export TSLIB_TSDEVICE + diff --git a/packages/tslib/tslib/fic-gta01/.mtn2git_empty b/packages/tslib/tslib/fic-gta01/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/tslib/tslib/fic-gta01/ts.conf b/packages/tslib/tslib/fic-gta01/ts.conf new file mode 100644 index 0000000000..82f712ef41 --- /dev/null +++ b/packages/tslib/tslib/fic-gta01/ts.conf @@ -0,0 +1,25 @@ +# Uncomment if you wish to use the linux input layer event interface +module_raw input grab_events=1 + +# Uncomment if you're using a Sharp Zaurus SL-5500/SL-5000d +# module_raw collie + +# Uncomment if you're using a Sharp Zaurus SL-C700/C750/C760/C860 +# module_raw corgi + +# Uncomment if you're using a device with a UCB1200/1300/1400 TS interface +# module_raw ucb1x00 + +# Uncomment if you're using an HP iPaq h3600 or similar +# module_raw h3600 + +# Uncomment if you're using a Hitachi Webpad +# module_raw mk712 + +# Uncomment if you're using an IBM Arctic II +# module_raw arctic2 + +module pthres pmin=1 +module variance delta=30 +module dejitter delta=100 +module linear diff --git a/packages/tslib/tslib/ts.conf b/packages/tslib/tslib/ts.conf index 1b0da937e8..1abde2fc7f 100644 --- a/packages/tslib/tslib/ts.conf +++ b/packages/tslib/tslib/ts.conf @@ -1,5 +1,5 @@ # Uncomment if you wish to use the linux input layer event interface -module_raw input +module_raw input grab_events=0 # Uncomment if you're using a Sharp Zaurus SL-5500/SL-5000d # module_raw collie diff --git a/packages/tslib/tslib/tslib-input_raw-grab_events.patch b/packages/tslib/tslib/tslib-input_raw-grab_events.patch new file mode 100644 index 0000000000..4bd0a05531 --- /dev/null +++ b/packages/tslib/tslib/tslib-input_raw-grab_events.patch @@ -0,0 +1,120 @@ +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 + +Index: a/plugins/input-raw.c +=================================================================== +--- a/plugins/input-raw.c (revision 49) ++++ b/plugins/input-raw.c (working copy) +@@ -18,6 +18,7 @@ + + #include + #include ++#include + + #include + #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 @@ + + int sane_fd; + int using_syn; ++ int grab_events; + }; + + static int check_fd(struct tslib_input *i) +@@ -64,6 +69,14 @@ + + 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_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 @@ + .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 @@ + 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); + } -- cgit v1.2.3