diff options
Diffstat (limited to 'patches/DirectFB-1.3.0/old-patches-for-reference/tslib_linux_input_tsdevice.patch')
-rw-r--r-- | patches/DirectFB-1.3.0/old-patches-for-reference/tslib_linux_input_tsdevice.patch | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/patches/DirectFB-1.3.0/old-patches-for-reference/tslib_linux_input_tsdevice.patch b/patches/DirectFB-1.3.0/old-patches-for-reference/tslib_linux_input_tsdevice.patch new file mode 100644 index 000000000..1014e5a31 --- /dev/null +++ b/patches/DirectFB-1.3.0/old-patches-for-reference/tslib_linux_input_tsdevice.patch @@ -0,0 +1,82 @@ +diff -pur DirectFB-1.0.1/inputdrivers/linux_input/linux_input.c DirectFB-1.0.1-hacked/inputdrivers/linux_input/linux_input.c +--- DirectFB-1.0.1/inputdrivers/linux_input/linux_input.c 2007-08-19 23:52:06.000000000 +0200 ++++ DirectFB-1.0.1-hacked/inputdrivers/linux_input/linux_input.c 2007-12-02 06:25:32.000000000 +0100 +@@ -1038,19 +1038,25 @@ get_device_info( int fd, + static int + driver_get_available() + { +- int i; ++ int i; ++ char *tsdev; + + #ifdef LINUX_INPUT_USE_FBDEV + if (dfb_system_type() != CORE_FBDEV) + return 0; + #endif + ++ tsdev = getenv( "TSLIB_TSDEVICE" ); ++ + for (i=0; i<MAX_LINUX_INPUT_DEVICES; i++) { + int fd; + char buf[32]; + + snprintf( buf, 32, "/dev/input/event%d", i ); + ++ if (tsdev && !strcmp( tsdev, buf )) ++ continue; ++ + /* Check if we are able to open the device */ + fd = open( buf, O_RDWR ); + if (fd < 0) { +diff -pur DirectFB-1.0.1/inputdrivers/tslib/tslib.c DirectFB-1.0.1-hacked/inputdrivers/tslib/tslib.c +--- DirectFB-1.0.1/inputdrivers/tslib/tslib.c 2007-08-07 21:43:00.000000000 +0200 ++++ DirectFB-1.0.1-hacked/inputdrivers/tslib/tslib.c 2007-12-02 06:35:01.000000000 +0100 +@@ -125,14 +125,28 @@ tslibEventThread( DirectThread *thread, + static int + driver_get_available(void) + { +- int i; ++ int i; ++ char *tsdev; ++ struct tsdev *ts; ++ ++ tsdev = getenv( "TSLIB_TSDEVICE" ); ++ if (tsdev) { ++ ts = ts_open( tsdev, 0 ); ++ if (ts && !ts_config( ts )) { ++ ts_close( ts ); ++ ++ device_nums[num_devices++] = -1; ++ } ++ } + + for (i = 0; i < MAX_TSLIB_DEVICES; i++) { +- struct tsdev *ts; + char buf[32]; + + snprintf( buf, 32, "/dev/input/tslib%d", i ); + ++ if (tsdev && !strcmp( tsdev, buf )) ++ continue; ++ + ts = ts_open( buf, 0 ); + if (!ts) + continue; +@@ -173,11 +187,14 @@ driver_open_device( CoreInputDevice *de + InputDeviceInfo *info, + void **driver_data ) + { +- char buf[32]; +- tslibData *data; ++ char buf[64]; ++ tslibData *data; + struct tsdev *ts; + +- snprintf( buf, 32, "/dev/input/tslib%d", device_nums[number] ); ++ if (device_nums[number] == -1) ++ direct_snputs( buf, getenv( "TSLIB_TSDEVICE" ), sizeof(buf) ); ++ else ++ snprintf( buf, sizeof(buf), "/dev/input/tslib%d", device_nums[number] ); + + /* open device */ + ts = ts_open( buf, 0 ); |