From 97d950a8acca0ec0d26eacfeab9a96e8d2a6877c Mon Sep 17 00:00:00 2001 From: Francisco Alecrim Date: Fri, 13 Nov 2009 11:15:02 -0400 Subject: [PATCH 055/118] tslib: add ts_write_calibrate from Maemo Necessary to compile xserver-kdrive-xomap version 1.3.99.0 Signed-off-by: Francisco Alecrim --- recipes/tslib/tslib.inc | 3 +- ...clude-ts_write_calibrate-from-Maemo-tslib.patch | 77 ++++++++++++++++++++ 2 files changed, 79 insertions(+), 1 deletions(-) create mode 100644 recipes/tslib/tslib/0001-tslib-include-ts_write_calibrate-from-Maemo-tslib.patch diff --git a/recipes/tslib/tslib.inc b/recipes/tslib/tslib.inc index 81f2a4e..6f126c6 100644 --- a/recipes/tslib/tslib.inc +++ b/recipes/tslib/tslib.inc @@ -3,13 +3,14 @@ HOMEPAGE = "http://tslib.berlios.de/" AUTHOR = "Russell King w/ plugins by Chris Larson et. al." SECTION = "base" LICENSE = "LGPL" -INC_PR = "r23" +INC_PR = "r24" SRC_URI += "\ file://ts.conf \ file://ts.conf-collie-2.4 \ file://ts.conf-simpad-2.4 \ file://tslib.sh \ + file://0001-tslib-include-ts_write_calibrate-from-Maemo-tslib.patch;patch=1 \ " SRC_URI_append_mnci += "\ file://devfs.patch;patch=1 \ diff --git a/recipes/tslib/tslib/0001-tslib-include-ts_write_calibrate-from-Maemo-tslib.patch b/recipes/tslib/tslib/0001-tslib-include-ts_write_calibrate-from-Maemo-tslib.patch new file mode 100644 index 0000000..f984b3f --- /dev/null +++ b/recipes/tslib/tslib/0001-tslib-include-ts_write_calibrate-from-Maemo-tslib.patch @@ -0,0 +1,77 @@ +From 98ccabe81de63757621982ee96ebc16033637048 Mon Sep 17 00:00:00 2001 +From: Francisco Alecrim +Date: Fri, 13 Nov 2009 10:59:48 -0400 +Subject: [PATCH] tslib: include ts_write_calibrate from Maemo tslib + +Signed-off-by: Francisco Alecrim +Signed-off-by: Carsten V. Munk +--- + src/ts_config.c | 30 ++++++++++++++++++++++++++++++ + src/tslib.h | 6 ++++++ + 2 files changed, 36 insertions(+), 0 deletions(-) + +diff --git a/src/ts_config.c b/src/ts_config.c +index fa732d6..b1266e3 100644 +--- a/src/ts_config.c ++++ b/src/ts_config.c +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + + #include "tslib-private.h" + +@@ -98,3 +99,32 @@ int ts_config(struct tsdev *ts) + + return ret; + } ++ ++ ++int ts_write_calibration(int calconst1, ++ int calconst2, ++ int calconst3, ++ int calconst4, ++ int calconst5, ++ int calconst6, ++ int calconst7) ++{ ++ int pcal_fd; ++ ++ char *defaultcalfile = "/etc/pointercal"; ++ char *calfile; ++ char cal_buffer[200]; ++ ++ if ( (calfile = (char *)getenv("TSLIB_CALIBFILE")) == NULL) { ++ calfile = defaultcalfile; ++ } ++ if ((pcal_fd = open(calfile, O_RDWR|O_CREAT)) < 0) { ++ return -1; ++ } ++ sprintf(cal_buffer,"%d %d %d %d %d %d %d",calconst2,calconst3,calconst1,calconst5,calconst6,calconst4,calconst7); ++ write(pcal_fd,cal_buffer,strlen(cal_buffer)+1); ++ close(pcal_fd); ++ ++ return 0; ++} ++ +diff --git a/src/tslib.h b/src/tslib.h +index 99e494e..2d142dd 100644 +--- a/src/tslib.h ++++ b/src/tslib.h +@@ -87,6 +87,12 @@ TSAPI int ts_read(struct tsdev *, struct ts_sample *, int); + */ + TSAPI int ts_read_raw(struct tsdev *, struct ts_sample *, int); + ++/* ++ * Writes the TSLIB_CALIBFILE with new calibration constants. ++ * Returns 0 on success, -1 on failure. ++ */ ++TSAPI int ts_write_calibration(int, int, int, int, int, int, int); ++ + #ifdef __cplusplus + } + #endif /* __cplusplus */ +-- +1.6.3.3 + -- 1.6.3.3