diff options
author | Denys Dmytriyenko <denis@denix.org> | 2009-03-17 14:32:59 -0400 |
---|---|---|
committer | Denys Dmytriyenko <denis@denix.org> | 2009-03-17 14:32:59 -0400 |
commit | 709c4d66e0b107ca606941b988bad717c0b45d9b (patch) | |
tree | 37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/xorg-xserver/xserver-kdrive-xomap/calibrateext.patch | |
parent | fa6cd5a3b993f16c27de4ff82b42684516d433ba (diff) |
rename packages/ to recipes/ per earlier agreement
See links below for more details:
http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326
http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816
Signed-off-by: Denys Dmytriyenko <denis@denix.org>
Acked-by: Mike Westerhof <mwester@dls.net>
Acked-by: Philip Balister <philip@balister.org>
Acked-by: Khem Raj <raj.khem@gmail.com>
Acked-by: Marcin Juszkiewicz <hrw@openembedded.org>
Acked-by: Koen Kooi <koen@openembedded.org>
Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/xorg-xserver/xserver-kdrive-xomap/calibrateext.patch')
-rw-r--r-- | recipes/xorg-xserver/xserver-kdrive-xomap/calibrateext.patch | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/recipes/xorg-xserver/xserver-kdrive-xomap/calibrateext.patch b/recipes/xorg-xserver/xserver-kdrive-xomap/calibrateext.patch new file mode 100644 index 0000000000..c5997c2ffa --- /dev/null +++ b/recipes/xorg-xserver/xserver-kdrive-xomap/calibrateext.patch @@ -0,0 +1,124 @@ +--- + configure |38107 ----------------------------------------------------------- + configure.ac | 2 - + hw/kdrive/linux/tslib.c | 68 ++++++++++++++++++++++++++---------------------- + 2 files changed, 39 insertions(+), 31 deletions(-) + + +Index: xorg-server-1.1.99.3/hw/kdrive/linux/tslib.c +=================================================================== +--- xorg-server-1.1.99.3.orig/hw/kdrive/linux/tslib.c 2007-01-30 00:44:13.000000000 +0000 ++++ xorg-server-1.1.99.3/hw/kdrive/linux/tslib.c 2007-01-30 21:55:52.000000000 +0000 +@@ -47,6 +47,10 @@ + + #define TSLIB_QUEUE_SIZE 3 + ++/* For XCalibrate extension */ ++void (*tslib_raw_event_hook)(int x, int y, int pressure, void *closure); ++void *tslib_raw_event_closure; ++ + struct TslibPrivate { + int fd; + int lastx, lasty; +@@ -76,6 +80,19 @@ TsRead (int fd, void *closure) + unsigned long flags = 0; + int discard = 0; + ++ if (tslib_raw_event_hook) ++ { ++ /* XCalibrate Ext */ ++ if (ts_read_raw(private->tsDev, &event, 1) == 1) ++ { ++ tslib_raw_event_hook (event.x, ++ event.y, ++ event.pressure, ++ tslib_raw_event_closure); ++ } ++ return; ++ } ++ + if (!private->tsDev) { + DebugF("[tslib] EXTREME BADNESS: TsRead called while tsDev is null!\n"); + return; +@@ -322,14 +339,14 @@ TsRead (int fd, void *closure) + } + } + +-/* must always be NULL-terminated. */ +-char *valid_ts_names[] = { +- "ADS784x Touchscreen", +- "omap-ts", +- "TSC2301 touchscreen", +- NULL ++static char *TsNames[] = { ++ NULL, /* set via TSLIB_TSDEVICE */ ++ "/dev/ts", ++ "/dev/touchscreen/0", + }; + ++#define NUM_TS_NAMES (sizeof (TsNames) / sizeof (TsNames[0])) ++ + #define TS_NAME_SIZE 32 + + static Status +@@ -383,11 +400,10 @@ TslibDisable (KdPointerInfo *pi) + private->tsDev = NULL; + } + +- + static Status + TslibInit (KdPointerInfo *pi) + { +- int fd = 0, i = 0; ++ int fd = 0, i = 0, j = 0; + char devpath[PATH_MAX], devname[TS_NAME_SIZE]; + DIR *inputdir = NULL; + struct dirent *inputent = NULL; +@@ -397,33 +413,25 @@ TslibInit (KdPointerInfo *pi) + return !Success; + + if (!pi->path || strcmp(pi->path, "auto") == 0) { +- if (!(inputdir = opendir("/dev/input"))) { +- ErrorF("[tslib/TslibInit]: couldn't open /dev/input!\n"); +- return BadMatch; +- } + +- while ((inputent = readdir(inputdir))) { +- if (strncmp(inputent->d_name, "event", 5) != 0) +- continue; ++ if ((TsNames[0] = getenv("TSLIB_TSDEVICE")) == NULL) ++ j++; ++ ++ for (i = j; i < NUM_TS_NAMES; i++) ++ { ++ struct tsdev *tsDev; + +- snprintf(devpath, PATH_MAX, "/dev/input/%s", inputent->d_name); +- fd = open(devpath, O_RDWR); ++ if(!(tsDev = ts_open(TsNames[i], 0))) ++ continue; + +- if (!ioctl(fd, EVIOCGNAME(sizeof(devname)), devname)) { +- close(fd); ++ if (ts_config(tsDev)) + continue; +- } +- close(fd); + +- for (i = 0; valid_ts_names[i]; i++) { +- if (strcmp(devname, valid_ts_names[i]) == 0) { +- pi->path = KdSaveString(devpath); +- break; +- } +- } +- } +- +- closedir(inputdir); ++ ts_close(tsDev); ++ ++ pi->path = KdSaveString(TsNames[i]); ++ break; ++ } + } + + if (!pi->path || strcmp(pi->path, "auto") == 0) { |