summaryrefslogtreecommitdiff
path: root/tslib
diff options
context:
space:
mode:
authorChris Larson <clarson@kergoth.com>2004-12-09 09:47:41 +0000
committerChris Larson <clarson@kergoth.com>2004-12-09 09:47:41 +0000
commit2c5b8ec6d95cf68650265941530e5ce38c8dd6d9 (patch)
treebf879bea7ef8517ba8c3d1286ef300401d3d484c /tslib
parent101e2f1623def0a355d20aacb8bd93810703e834 (diff)
Merge oe-devel@oe-devel.bkbits.net:openembedded
into hyperion.kergoth.com:/home/kergoth/code/openembedded 2004/12/09 03:39:39-06:00 kergoth.com!kergoth Break people's builds again.. this time moving the packages into a packages/ subdir to clean things up a bit. BKrev: 41b81f3dvlp3rU7_8MUXLcI8LDdDoA
Diffstat (limited to 'tslib')
-rw-r--r--tslib/tslib/automake.patch97
-rw-r--r--tslib/tslib/beagle/ts.conf5
-rw-r--r--tslib/tslib/beagle/tslib.sh6
-rw-r--r--tslib/tslib/collie/ts.conf0
-rw-r--r--tslib/tslib/collie/tslib.sh10
-rw-r--r--tslib/tslib/corgi/ts.conf0
-rw-r--r--tslib/tslib/corgi/tslib.sh6
-rw-r--r--tslib/tslib/devfs.patch18
-rw-r--r--tslib/tslib/doc.patch50
-rw-r--r--tslib/tslib/event1.patch44
-rw-r--r--tslib/tslib/h3600/ts.conf0
-rw-r--r--tslib/tslib/h3600/tslib.sh6
-rw-r--r--tslib/tslib/h3900/ts.conf0
-rw-r--r--tslib/tslib/h3900/tslib.sh6
-rw-r--r--tslib/tslib/husky/ts.conf0
-rw-r--r--tslib/tslib/husky/tslib.sh6
-rw-r--r--tslib/tslib/initialize_djs.patch20
-rw-r--r--tslib/tslib/jornada56x/ts.conf0
-rw-r--r--tslib/tslib/jornada56x/tslib.sh6
-rw-r--r--tslib/tslib/multievent.patch843
-rw-r--r--tslib/tslib/omap1610h2/ts.conf0
-rw-r--r--tslib/tslib/omap1610h2/tslib.sh5
-rw-r--r--tslib/tslib/pointercal.patch13
-rw-r--r--tslib/tslib/poodle/ts.conf0
-rw-r--r--tslib/tslib/poodle/tslib.sh10
-rw-r--r--tslib/tslib/pthres.patch295
-rw-r--r--tslib/tslib/ramses/ts.conf5
-rw-r--r--tslib/tslib/raw-hwread.patch706
-rw-r--r--tslib/tslib/raw.patch923
-rw-r--r--tslib/tslib/shepherd/ts.conf0
-rw-r--r--tslib/tslib/shepherd/tslib.sh6
-rw-r--r--tslib/tslib/simpad/ts.conf0
-rw-r--r--tslib/tslib/simpad/tslib.sh5
-rw-r--r--tslib/tslib/tosa/ts.conf0
-rw-r--r--tslib/tslib/tosa/tslib.sh6
-rw-r--r--tslib/tslib/ts.conf0
-rw-r--r--tslib/tslib/ts_calibrate.patch23
-rw-r--r--tslib/tslib/tslib.sh0
-rw-r--r--tslib/tslib/zap.patch1684
-rw-r--r--tslib/tslib_cvs.bb0
40 files changed, 0 insertions, 4804 deletions
diff --git a/tslib/tslib/automake.patch b/tslib/tslib/automake.patch
deleted file mode 100644
index 711536f753..0000000000
--- a/tslib/tslib/automake.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-
-#
-# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
-#
-
---- tslib/configure.in~automake
-+++ tslib/configure.in
-@@ -22,18 +22,15 @@
- fi
-
- AC_MSG_CHECKING(--enable-inputapi argument)
--AC_ARG_ENABLE(inputapi, [ --enable-inputapi Enable use of the input API [default=yes]],
-- , [enable_inputapi="yes"])
-+AC_ARG_ENABLE(inputapi,
-+ [ --enable-inputapi Enable use of the input API [default=no]],
-+ [AC_DEFINE(USE_INPUT_API,1)],
-+ [enable_inputapi="no"])
- AC_MSG_RESULT($enable_inputapi)
--if test "$enable_inputapi" = "yes"; then
-- INPUTAPIFLAG="-DUSE_INPUT_API"
--else
-- INPUTAPIFLAG=""
--fi
-+AH_TEMPLATE([USE_INPUT_API],
-+ [Define if using the input layer.])
-
- AC_SUBST(DEBUGFLAGS)
--AC_SUBST(INPUTAPIFLAG)
--
- AC_SUBST(PLUGINS)
-
- AM_DISABLE_STATIC
---- tslib/./src/Makefile.am~automake
-+++ tslib/./src/Makefile.am
-@@ -9,7 +9,7 @@
- # $Id$
- #
-
--CFLAGS := $(CFLAGS) -DPLUGIN_DIR=\"@PLUGIN_DIR@\" -DTS_CONF=\"@TS_CONF@\" $(DEBUGFLAGS) $(INPUTAPIFLAG)
-+AM_CFLAGS = -DPLUGIN_DIR=\"@PLUGIN_DIR@\" -DTS_CONF=\"@TS_CONF@\" $(DEBUGFLAGS)
-
- noinst_HEADERS = tslib-private.h tslib-filter.h
- include_HEADERS = tslib.h
---- tslib/./plugins/Makefile.am~automake
-+++ tslib/./plugins/Makefile.am
-@@ -9,24 +9,24 @@
- # $Id$
- #
-
--CFLAGS := $(CFLAGS) $(DEBUGFLAGS) $(INPUTAPIFLAG)
--INCLUDES = -I$(top_srcdir)/src
--LDFLAGS := $(LDFLAGS) -rpath $(PLUGIN_DIR)
--#LTVSN := -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
--# -release $(LT_RELEASE)
--LTVSN := -avoid-version
--LIBS =
-+AM_CFLAGS = $(DEBUGFLAGS)
-+AM_LDFLAGS = -rpath $(PLUGIN_DIR)
-+INCLUDES = -I$(top_srcdir)/src
-
--plugindir = $(PLUGIN_DIR)
-+#LTVSN = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
-+# -release $(LT_RELEASE)
-+LTVSN = -avoid-version
-+LIBS =
-+plugindir = $(PLUGIN_DIR)
-
--EXTRA_LTLIBRARIES = variance.la dejitter.la linear.la
--plugin_LTLIBRARIES = $(PLUGINS)
-+EXTRA_LTLIBRARIES = variance.la dejitter.la linear.la
-+plugin_LTLIBRARIES = $(PLUGINS)
-
--variance_la_SOURCES = variance.c
--variance_la_LDFLAGS = -module $(LTVSN)
-+variance_la_SOURCES = variance.c
-+variance_la_LDFLAGS = -module $(LTVSN)
-
--dejitter_la_SOURCES = dejitter.c
--dejitter_la_LDFLAGS = -module $(LTVSN)
-+dejitter_la_SOURCES = dejitter.c
-+dejitter_la_LDFLAGS = -module $(LTVSN)
-
--linear_la_SOURCES = linear.c
--linear_la_LDFLAGS = -module $(LTVSN)
-+linear_la_SOURCES = linear.c
-+linear_la_LDFLAGS = -module $(LTVSN)
---- tslib/./tests/Makefile.am~automake
-+++ tslib/./tests/Makefile.am
-@@ -9,7 +9,7 @@
- # $Id$
- #
-
--CFLAGS := $(CFLAGS) $(DEBUGFLAGS) $(INPUTAPIFLAG)
-+AM_CFLAGS = $(DEBUGFLAGS)
- INCLUDES = -I$(top_srcdir)/src
-
- bin_PROGRAMS = ts_test ts_calibrate ts_print ts_print_raw
diff --git a/tslib/tslib/beagle/ts.conf b/tslib/tslib/beagle/ts.conf
deleted file mode 100644
index 20729b6154..0000000000
--- a/tslib/tslib/beagle/ts.conf
+++ /dev/null
@@ -1,5 +0,0 @@
-module_raw h3600
-module pthres pmin=1
-module variance delta=30
-module dejitter delta=100
-module linear
diff --git a/tslib/tslib/beagle/tslib.sh b/tslib/tslib/beagle/tslib.sh
deleted file mode 100644
index 4d7951269e..0000000000
--- a/tslib/tslib/beagle/tslib.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-TSLIB_TSDEVICE=/dev/misc/touchscreen/ucb1x00
-TSLIB_TSEVENTTYPE=H3600
-
-export TSLIB_TSDEVICE TSLIB_TSEVENTTYPE
diff --git a/tslib/tslib/collie/ts.conf b/tslib/tslib/collie/ts.conf
deleted file mode 100644
index e69de29bb2..0000000000
--- a/tslib/tslib/collie/ts.conf
+++ /dev/null
diff --git a/tslib/tslib/collie/tslib.sh b/tslib/tslib/collie/tslib.sh
deleted file mode 100644
index 187b7ce6d2..0000000000
--- a/tslib/tslib/collie/tslib.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-if (uname -r|grep -q 'embedix'); then
- TSLIB_TSDEVICE=/dev/ts
- TSLIB_TSEVENTTYPE=COLLIE
-else
- TSLIB_TSDEVICE=/dev/input/event0
-fi
-
-export TSLIB_TSDEVICE TSLIB_TSEVENTTYPE
diff --git a/tslib/tslib/corgi/ts.conf b/tslib/tslib/corgi/ts.conf
deleted file mode 100644
index e69de29bb2..0000000000
--- a/tslib/tslib/corgi/ts.conf
+++ /dev/null
diff --git a/tslib/tslib/corgi/tslib.sh b/tslib/tslib/corgi/tslib.sh
deleted file mode 100644
index 417ccd06ba..0000000000
--- a/tslib/tslib/corgi/tslib.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-TSLIB_TSDEVICE=/dev/ts
-TSLIB_TSEVENTTYPE=CORGI
-
-export TSLIB_TSDEVICE TSLIB_TSEVENTTYPE
diff --git a/tslib/tslib/devfs.patch b/tslib/tslib/devfs.patch
deleted file mode 100644
index d7ef0a9589..0000000000
--- a/tslib/tslib/devfs.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-
-#
-# Patch managed by http://www.holgerschurig.de/patcher.html
-#
-
---- tslib/tests/fbutils.c~devfs.patch
-+++ tslib/tests/fbutils.c
-@@ -44,8 +44,8 @@
- static unsigned colormap [256];
- int xres, yres;
-
--static char *defaultfbdevice = "/dev/fb0";
--static char *defaultconsoledevice = "/dev/tty";
-+static char *defaultfbdevice = "/dev/fb/0";
-+static char *defaultconsoledevice = "/dev/vc/";
- static char *fbdevice = NULL;
- static char *consoledevice = NULL;
-
diff --git a/tslib/tslib/doc.patch b/tslib/tslib/doc.patch
deleted file mode 100644
index d8f51b1e19..0000000000
--- a/tslib/tslib/doc.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-
-#
-# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
-#
-
---- tslib/README~doc
-+++ tslib/README
-@@ -35,8 +35,42 @@
- There are a couple of programs in the tslib/test directory which give example
- usages. They are by no means exhaustive, nor probably even good examples.
- They are basically the programs I used to test this library.
-+
-+
-+Environment Variables
-+=====================
-+
-+TSLIB_TSEVENTTYPE Event type for non input api raw reads.
-+ Default: UCB1x00
-+TSLIB_TSDEVICE TS device file name.
-+ Default (non inputapi): /dev/touchscreen/ucb1x00
-+ Default (inputapi): /dev/input/event0
-+TSLIB_CALIBFILE Calibration file.
-+ Default: ${sysconfdir}/pointercal
-+TSLIB_CONFFILE Config file.
-+ Default: ${sysconfdir}/ts.conf
-+TSLIB_PLUGINDIR Plugin directory.
-+ Default: ${datadir}/plugins
-+TSLIB_CONSOLEDEVICE Console device.
-+ Default: /dev/tty
-+TSLIB_FBDEVICE Framebuffer device.
-+ Default: /dev/fb0
-
-
-+Module Creation Notes
-+=====================
-+
-+For those creating tslib modules, it is important to note a couple things with
-+regard to handling of the ability for a user to request more than one ts event
-+at a time. The first thing to note is that the lower layers may send up less
-+events than the user requested, but only if that was a result of a pen release.
-+Next, your module should send up just as many events as the user requested in
-+nr. If your module is one that consumes events, such as variance, then you
-+loop on the read from the lower layers, and only send the events up when
-+1) you have the number of events requested by the user, or 2) one of the events
-+from the lower layers was a pen release.
-+
-+
- Module Parameters
- =================
-
diff --git a/tslib/tslib/event1.patch b/tslib/tslib/event1.patch
deleted file mode 100644
index 33daded000..0000000000
--- a/tslib/tslib/event1.patch
+++ /dev/null
@@ -1,44 +0,0 @@
---- tslib/tests/ts_calibrate.c~event1
-+++ tslib/tests/ts_calibrate.c
-@@ -212,7 +212,7 @@
- ts = ts_open(tsdevice,0);
- } else {
- #ifdef USE_INPUT_API
-- ts = ts_open("/dev/input/event0", 0);
-+ ts = ts_open("/dev/input/event1", 0);
- #else
- ts = ts_open("/dev/touchscreen/ucb1x00", 0);
- #endif /* USE_INPUT_API */
---- tslib/tests/ts_print.c~event1
-+++ tslib/tests/ts_print.c
-@@ -30,7 +30,7 @@
- ts = ts_open(tsdevice,0);
- } else {
- #ifdef USE_INPUT_API
-- ts = ts_open("/dev/input/event0", 0);
-+ ts = ts_open("/dev/input/event1", 0);
- #else
- ts = ts_open("/dev/touchscreen/ucb1x00", 0);
- #endif /* USE_INPUT_API */
---- tslib/tests/ts_test.c~event1
-+++ tslib/tests/ts_test.c
-@@ -50,7 +50,7 @@
- ts = ts_open(tsdevice,0);
- } else {
- #ifdef USE_INPUT_API
-- ts = ts_open("/dev/input/event0", 0);
-+ ts = ts_open("/dev/input/event1", 0);
- #else
- ts = ts_open("/dev/touchscreen/ucb1x00", 0);
- #endif /* USE_INPUT_API */
---- tslib/tests/ts_print_raw.c~event1
-+++ tslib/tests/ts_print_raw.c
-@@ -30,7 +30,7 @@
- ts = ts_open(tsdevice,0);
- } else {
- #ifdef USE_INPUT_API
-- ts = ts_open("/dev/input/event0", 0);
-+ ts = ts_open("/dev/input/event1", 0);
- #else
- ts = ts_open("/dev/touchscreen/ucb1x00", 0);
- #endif /* USE_INPUT_API */
diff --git a/tslib/tslib/h3600/ts.conf b/tslib/tslib/h3600/ts.conf
deleted file mode 100644
index e69de29bb2..0000000000
--- a/tslib/tslib/h3600/ts.conf
+++ /dev/null
diff --git a/tslib/tslib/h3600/tslib.sh b/tslib/tslib/h3600/tslib.sh
deleted file mode 100644
index 9f7ac41209..0000000000
--- a/tslib/tslib/h3600/tslib.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-TSLIB_TSDEVICE=/dev/touchscreen/0raw
-TSLIB_TSEVENTTYPE=H3600
-
-export TSLIB_TSDEVICE TSLIB_TSEVENTTYPE
diff --git a/tslib/tslib/h3900/ts.conf b/tslib/tslib/h3900/ts.conf
deleted file mode 100644
index e69de29bb2..0000000000
--- a/tslib/tslib/h3900/ts.conf
+++ /dev/null
diff --git a/tslib/tslib/h3900/tslib.sh b/tslib/tslib/h3900/tslib.sh
deleted file mode 100644
index 9f7ac41209..0000000000
--- a/tslib/tslib/h3900/tslib.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-TSLIB_TSDEVICE=/dev/touchscreen/0raw
-TSLIB_TSEVENTTYPE=H3600
-
-export TSLIB_TSDEVICE TSLIB_TSEVENTTYPE
diff --git a/tslib/tslib/husky/ts.conf b/tslib/tslib/husky/ts.conf
deleted file mode 100644
index e69de29bb2..0000000000
--- a/tslib/tslib/husky/ts.conf
+++ /dev/null
diff --git a/tslib/tslib/husky/tslib.sh b/tslib/tslib/husky/tslib.sh
deleted file mode 100644
index 417ccd06ba..0000000000
--- a/tslib/tslib/husky/tslib.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-TSLIB_TSDEVICE=/dev/ts
-TSLIB_TSEVENTTYPE=CORGI
-
-export TSLIB_TSDEVICE TSLIB_TSEVENTTYPE
diff --git a/tslib/tslib/initialize_djs.patch b/tslib/tslib/initialize_djs.patch
deleted file mode 100644
index bfd8d1cc18..0000000000
--- a/tslib/tslib/initialize_djs.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-Sometimes after ts_open/ts_close/ts_open on the first
-sample(s) dejitter will crash (sorry no backtrace)
-
-memsetting tslib_dejitter so djt->nr is not random anymore
-
-
-#
-# Patch managed by http://www.holgerschurig.de/patcher.html
-#
-
---- tslib/plugins/dejitter.c~initialize_djs
-+++ tslib/plugins/dejitter.c
-@@ -205,6 +205,7 @@
- if (djt == NULL)
- return NULL;
-
-+ memset(djt, 0, sizeof(struct tslib_dejitter));
- djt->module.ops = &dejitter_ops;
-
- djt->delta = 100;
diff --git a/tslib/tslib/jornada56x/ts.conf b/tslib/tslib/jornada56x/ts.conf
deleted file mode 100644
index e69de29bb2..0000000000
--- a/tslib/tslib/jornada56x/ts.conf
+++ /dev/null
diff --git a/tslib/tslib/jornada56x/tslib.sh b/tslib/tslib/jornada56x/tslib.sh
deleted file mode 100644
index e64f644b74..0000000000
--- a/tslib/tslib/jornada56x/tslib.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-TSLIB_TSDEVICE=/dev/input/ts0
-TSLIB_TSEVENTTYPE=H3600
-
-export TSLIB_TSDEVICE TSLIB_TSEVENTTYPE
diff --git a/tslib/tslib/multievent.patch b/tslib/tslib/multievent.patch
deleted file mode 100644
index a4522324c3..0000000000
--- a/tslib/tslib/multievent.patch
+++ /dev/null
@@ -1,843 +0,0 @@
---- tslib/plugins/linear.c~multievent
-+++ tslib/plugins/linear.c
-@@ -39,14 +39,12 @@
- linear_read(struct tslib_module_info *info, struct ts_sample *samp, int nr)
- {
- struct tslib_linear *lin = (struct tslib_linear *)info;
-- int ret;
-+ int ret, i = 0;
- int xtemp,ytemp;
-
- ret = info->next->ops->read(info->next, samp, nr);
- if (ret >= 0) {
-- int nr;
--
-- for (nr = 0; nr < ret; nr++, samp++) {
-+ for (i = 0; i < ret; i++, samp++) {
- #ifdef DEBUG
- fprintf(stderr,"BEFORE CALIB--------------------> %d %d %d\n",samp->x, samp->y, samp->pressure);
- #endif /*DEBUG*/
-@@ -66,6 +64,7 @@
- samp->y = tmp;
- }
- }
-+ ret = i;
- }
-
- return ret;
---- tslib/plugins/dejitter.c~multievent
-+++ tslib/plugins/dejitter.c
-@@ -24,7 +24,6 @@
-
- struct tslib_threshold {
- struct tslib_module_info module;
-- int pthreshold;
- int xdelta;
- int ydelta;
- int delta2;
-@@ -36,40 +35,28 @@
- static int threshold_read(struct tslib_module_info *info, struct ts_sample *samp, int nr)
- {
- struct tslib_threshold *thr = (struct tslib_threshold *)info;
-- struct ts_sample *s;
-- int ret;
-+ struct ts_sample *src = samp, *dest = samp;
-+ int ret, i = 0;
-
- ret = info->next->ops->read(info->next, samp, nr);
- if (ret >= 0) {
-- int nr = 0;
--
-- for (s = samp; s < samp + ret; s++) {
-+ for (i = 0; i < ret; i++, samp++) {
- int dr2;
- #ifdef DEBUG
-- fprintf(stderr,"BEFORE DEJITTER---------------> %d %d %d\n",s->x,s->y,s->pressure);
-+ fprintf(stderr,"BEFORE DEJITTER---------------> %d %d %d\n", samp->x, samp->y, samp->pressure);
- #endif /*DEBUG*/
-- thr->down = (s->pressure >= thr->pthreshold);
-- if (thr->down) {
-- dr2 = (thr->x - s->x)*(thr->x - s->x)
-- + (thr->y - s->y)*(thr->y - s->y);
-- if(dr2 < thr->delta2) {
-- s->x = thr->x;
-- s->y = thr->y;
-- } else {
-- thr->x = s->x;
-- thr->y = s->y;
-- }
--
-+ dr2 = (thr->x - samp->x)*(thr->x - samp->x)
-+ + (thr->y - samp->y)*(thr->y - samp->y);
-+ if(dr2 < thr->delta2) {
-+ samp->x = thr->x;
-+ samp->y = thr->y;
- } else {
-- s->x = thr->x;
-- s->y = thr->y;
-+ thr->x = samp->x;
-+ thr->y = samp->y;
- }
--
--
-- samp[nr++] = *s;
- }
-
-- ret = nr;
-+ ret = i;
- }
- return ret;
- }
-@@ -106,10 +93,6 @@
- thr->ydelta = v;
- break;
-
-- case 3:
-- thr->pthreshold = v;
-- break;
--
- default:
- return -1;
- }
-@@ -120,7 +103,6 @@
- {
- { "xdelta", (void *)1, threshold_limit },
- { "ydelta", (void *)2, threshold_limit },
-- { "pthreshold", (void *)3, threshold_limit }
- };
-
- //#define NR_VARS (sizeof(threshold_vars) / sizeof(threshold_vars[0]))
-@@ -138,7 +120,6 @@
-
- thr->xdelta = 10;
- thr->ydelta = 10;
-- thr->pthreshold = 100;
-
- if (tslib_parse_vars(&thr->module, threshold_vars, NR_VARS, params)) {
- free(thr);
---- tslib/plugins/variance.c~multievent
-+++ tslib/plugins/variance.c
-@@ -9,25 +9,36 @@
- * $Id$
- *
- * Variance filter for touchscreen values
-+ *
-+ * Policy question (applies to all tslib modules that consume events):
-+ * 1) User requests a read of 5 events using nr.
-+ * 2) Lower layers return us 4 events.
-+ * 3) Perform variance calculation, we now only have _1_ event.
-+ * 4) Do we, a) duplicate this data across the user requested 4 events,
-+ * b) push up the single event
-+ * c) loop on the read from the lower layers to obtain
-+ * the user's requested number of events, unless we hit
-+ * a pen_up.
- */
-+
- #include <errno.h>
- #include <stdlib.h>
- #include <string.h>
- #include <limits.h>
--
- #include <stdio.h>
-
- #include "tslib.h"
- #include "tslib-filter.h"
-
-+#define NR_INIT -1
- #define NR_LAST 4
-
- struct tslib_variance {
- struct tslib_module_info module;
- int nr;
-- unsigned int pthreshold;
- unsigned int xlimit;
- unsigned int ylimit;
-+ unsigned int pthreshold;
- struct ts_sample last[NR_LAST];
- };
-
-@@ -37,8 +48,7 @@
- * least variance, and average them.
- */
- static int
--variance_calculate(struct tslib_variance *var, struct ts_sample *samp,
-- struct ts_sample *s)
-+variance_calculate(struct tslib_variance *var, struct ts_sample *dest, struct ts_sample *src)
- {
- int i, j;
- int diff_x, min_x, i_x, j_x;
-@@ -100,11 +110,11 @@
- }
- }
-
-- samp->x = (var->last[i_x].x + var->last[j_x].x) / 2;
-- samp->y = (var->last[i_y].y + var->last[j_y].y) / 2;
-- samp->pressure = (var->last[i_p].pressure + var->last[j_p].pressure) / 2;
-- samp->tv.tv_sec = s->tv.tv_sec;
-- samp->tv.tv_usec = s->tv.tv_usec;
-+ dest->x = (var->last[i_x].x + var->last[j_x].x) / 2;
-+ dest->y = (var->last[i_y].y + var->last[j_y].y) / 2;
-+ dest->pressure = (var->last[i_p].pressure + var->last[j_p].pressure) / 2;
-+ dest->tv.tv_sec = src->tv.tv_sec;
-+ dest->tv.tv_usec = src->tv.tv_usec;
-
- return 1;
- }
-@@ -112,55 +122,57 @@
- static int variance_read(struct tslib_module_info *info, struct ts_sample *samp, int nr)
- {
- struct tslib_variance *var = (struct tslib_variance *)info;
-- struct ts_sample *s;
-- int ret;
--
-- ret = info->next->ops->read(info->next, samp, nr);
-- if (ret >= 0) {
-- int nr = 0;
--
-- for (s = samp; s < samp + ret; s++) {
-- if (s->pressure < var->pthreshold) {
-- /*
-- * Pen was released. Reset our state and
-- * pass up the release information.
-- */
--// samp[nr].x = 0;
--// samp[nr].y = 0;
-- samp[nr].pressure = s->pressure;
-- samp[nr].tv.tv_sec = s->tv.tv_sec;
-- samp[nr].tv.tv_usec = s->tv.tv_usec;
--
-- nr++;
--
-- var->nr = 0;
-- continue;
-- } else if (var->nr == -1) {
-- /*
-- * Pen was pressed. Inform upper layers
-- * immediately.
-- */
-- samp[nr] = *s;
-- nr++;
-- }
--
-- if (var->nr >= 0) {
-- var->last[var->nr].x = s->x;
-- var->last[var->nr].y = s->y;
-- var->last[var->nr].pressure = s->pressure;
-- }
--
-- var->nr++;
-+ struct ts_sample *src = samp, *dest = samp;
-+ int ret, i = 0;
-
-- if (var->nr == NR_LAST) {
-- if (variance_calculate(var, samp + nr, s))
-- nr++;
-- var->nr = 0;
-+ /*
-+ * NOTES:
-+ *
-+ * Loop on read, collecting events until we hit nr, unless
-+ * we hit a pen up or encounter a failure.
-+ */
-+ while ((i < nr) && (ret != -1)) {
-+ ret = info->next->ops->read(info->next, dest + i, nr - i);
-+ if (ret >= 0) {
-+ for (src = dest + i; src < dest + ret; src++) {
-+ if (src->pressure < var->pthreshold) {
-+ /* pen released, reset var->nr,
-+ * do a calc based on what we have so
-+ * far, and let this event flow up */
-+ if (variance_calculate(var, dest + i, src))
-+ i++;
-+ var->nr = NR_INIT;
-+ ret = -1; /* break outer loop, push up event */
-+ break;
-+ } else if (var->nr == NR_INIT) {
-+ /*
-+ * First pen down event. Inform upper layers
-+ * immediately for responsiveness.
-+ */
-+ var->nr = 0;
-+ i++;
-+ ret = -1; /* break outer loop */
-+ break;
-+ }
-+
-+ if (var->nr >= 0) {
-+ var->last[var->nr].x = src->x;
-+ var->last[var->nr].y = src->y;
-+ var->last[var->nr].pressure = src->pressure;
-+ }
-+
-+ var->nr++;
-+
-+ if (var->nr == NR_LAST) {
-+ if (variance_calculate(var, dest + i, src))
-+ i++;
-+ var->nr = 0;
-+ }
- }
- }
--
-- ret = nr;
- }
-+ /* if we've collected at least one event, send it up */
-+ if (i != 0) ret = i;
- return ret;
- }
-
-@@ -196,10 +208,6 @@
- var->ylimit = v;
- break;
-
-- case 3:
-- var->pthreshold = v;
-- break;
--
- default:
- return -1;
- }
-@@ -210,7 +218,6 @@
- {
- { "xlimit", (void *)1, variance_limit },
- { "ylimit", (void *)2, variance_limit },
-- { "pthreshold", (void *)3, variance_limit }
- };
-
- #define NR_VARS (sizeof(variance_vars) / sizeof(variance_vars[0]))
-@@ -218,6 +225,7 @@
- struct tslib_module_info *mod_init(struct tsdev *dev, const char *params)
- {
- struct tslib_variance *var;
-+ char *pthresvar;
-
- var = malloc(sizeof(struct tslib_variance));
- if (var == NULL)
-@@ -225,10 +233,15 @@
-
- var->module.ops = &variance_ops;
-
-- var->nr = -1;
-+ var->nr = NR_INIT;
- var->xlimit = 160;
- var->ylimit = 160;
- var->pthreshold = 100;
-+ pthresvar = getenv("TSLIB_PTHRES");
-+ if (pthresvar != NULL) {
-+ int p = strtol(pthresvar, (char **)NULL, 10);
-+ if (p != -1) var->pthreshold = p;
-+ }
-
- if (tslib_parse_vars(&var->module, variance_vars, NR_VARS, params)) {
- free(var);
---- tslib/README~multievent
-+++ tslib/README
-@@ -36,6 +36,19 @@
- usages. They are by no means exhaustive, nor probably even good examples.
- They are basically the programs I used to test this library.
-
-+Module Creation Notes
-+=====================
-+
-+For those creating tslib modules, it is important to note a couple things with
-+regard to handling of the ability for a user to request more than one ts event
-+at a time. The first thing to note is that the lower layers may send up less
-+events than the user requested, but only if that was a result of a pen release.
-+Next, your module should send up just as many events as the user requested in
-+nr. If your module is one that consumes events, such as variance, then you
-+loop on the read from the lower layers, and only send the events up when
-+1) you have the number of events requested by the user, or 2) one of the events
-+from the lower layers was a pen release.
-+
-
- Module Parameters
- =================
---- tslib/src/ts_read_raw.c~multievent
-+++ tslib/src/ts_read_raw.c
-@@ -14,10 +14,10 @@
- *
- * Read raw pressure, x, y, and timestamp from a touchscreen device.
- */
-+
- #include "config.h"
-
- #include <stdio.h>
--
- #include <stdlib.h>
- #ifdef HAVE_UNISTD_H
- #include <unistd.h>
-@@ -25,79 +25,27 @@
- #include <sys/time.h>
- #include <sys/types.h>
-
--#ifdef USE_INPUT_API
--#include <linux/input.h>
--#else
--struct ts_event { /* Used in UCB1x00 style touchscreens (the default) */
-- unsigned short pressure;
-- unsigned short x;
-- unsigned short y;
-- unsigned short pad;
-- struct timeval stamp;
--};
--struct h3600_ts_event { /* Used in the Compaq IPAQ */
-- unsigned short pressure;
-- unsigned short x;
-- unsigned short y;
-- unsigned short pad;
--};
--struct mk712_ts_event { /* Used in the Hitachi Webpad */
-- unsigned int header;
-- unsigned int x;
-- unsigned int y;
-- unsigned int reserved;
--};
--struct arctic2_ts_event { /* Used in the IBM Arctic II */
-- signed short pressure;
-- signed int x;