diff -Nur -x CVS -x '.*' pristine/configure.in dynapropatch/configure.in
--- pristine/configure.in	2005-05-05 12:09:29.000000000 +0200
+++ dynapropatch/configure.in	2005-05-26 16:24:34.795539104 +0200
@@ -1039,6 +1039,7 @@
 
 checkfor_dbox2remote=no
 checkfor_dreamboxremote=no
+checkfor_dynapro=no
 checkfor_elo=no
 checkfor_h3600ts=no
 checkfor_joystick=no
@@ -1057,13 +1058,14 @@
 [                             inputdrivers may be comma separated ]
 [                             'all' builds all drivers (default), 'none' builds none ]
 [                             Possible inputdrivers are: ]
-[                             dbox2remote, elo-input, h3600_ts, joystick, keyboard, ]
+[                             dbox2remote, dynapro, elo-input, h3600_ts, joystick, keyboard, ]
 [                             dreamboxremote, linuxinput, lirc, mutouch, ps2mouse, ]
 [                             serialmouse, sonypijogdial, wm97xx], inputdrivers="$withval",[inputdrivers="all"])
 
 if test "$inputdrivers" = "all"; then
   checkfor_dbox2remote=yes
   checkfor_dreamboxremote=yes
+  checkfor_dynapro=yes
   checkfor_elo=yes
   checkfor_h3600ts=yes
   checkfor_joystick=yes
@@ -1088,6 +1090,9 @@
           dreamboxremote)
                   checkfor_dreamboxremote=yes
                   ;;
+          dynapro)
+                  checkfor_dynapro=yes
+                  ;;
           elo-input)
                   checkfor_elo=yes
                   ;;
@@ -1145,6 +1150,12 @@
     AC_MSG_WARN([*** DreamBox Remote input driver will not be built.]))
 fi
 
+enable_dynapro_ts=no
+if test "$checkfor_dynapro" = "yes"; then
+  dnl Test for Dynapro Touchscreen support
+  enable_dynapro_ts=yes
+fi
+
 enable_elo_ts=no
 if test "$checkfor_elo" = "yes"; then
   dnl Test for ELO Touchscreen support
@@ -1257,6 +1268,7 @@
 
 AM_CONDITIONAL(DBOX2REMOTE, test "$enable_dbox2remote" = "yes")
 AM_CONDITIONAL(DREAMBOXREMOTE, test "$enable_dreamboxremote" = "yes")
+AM_CONDITIONAL(DYNAPRO_INPUT, test "$enable_dynapro_ts" = "yes")
 AM_CONDITIONAL(ELO_INPUT, test "$enable_elo_input" = "yes")
 AM_CONDITIONAL(H3600_TS, test "$enable_h3600_ts" = "yes")
 AM_CONDITIONAL(JOYSTICK_INPUT, test "$enable_joystick" = "yes")
@@ -1402,6 +1414,7 @@
 inputdrivers/Makefile
 inputdrivers/dbox2remote/Makefile
 inputdrivers/dreamboxremote/Makefile
+inputdrivers/dynapro/Makefile
 inputdrivers/elo/Makefile
 inputdrivers/h3600_ts/Makefile
 inputdrivers/joystick/Makefile
@@ -1504,6 +1517,7 @@
 Building Input Drivers:
   DBox2 Remote              $enable_dbox2remote
   DreamBox Remote           $enable_dreamboxremote
+  Dynapro Touchscreen       $enable_dynapro_ts
   ELO Touchscreen           $enable_elo_ts
   H3600 Touchscreen         $enable_h3600_ts
   Joystick                  $enable_joystick
diff -Nur -x CVS -x '.*' pristine/inputdrivers/Makefile.am dynapropatch/inputdrivers/Makefile.am
--- pristine/inputdrivers/Makefile.am	2005-02-10 17:39:31.000000000 +0100
+++ dynapropatch/inputdrivers/Makefile.am	2005-05-26 16:24:58.905967424 +0200
@@ -1,5 +1,9 @@
 ## Makefile.am for DirectFB/inputdrivers
 
+if DYNAPRO_INPUT
+DYNAPRO_INPUT_DIR = dynapro
+endif
+
 if ELO_INPUT
 ELO_INPUT_DIR = elo
 endif
@@ -57,6 +61,7 @@
 endif
 
 SUBDIRS = \
+	$(DYNAPRO_INPUT_DIR)	\
 	$(ELO_INPUT_DIR)	\
 	$(JOYSTICK_INPUT_DIR)	\
 	$(KEYBOARD_INPUT_DIR)	\
diff -Nur -x CVS -x '.*' pristine/inputdrivers/dynapro/Makefile.am dynapropatch/inputdrivers/dynapro/Makefile.am
--- pristine/inputdrivers/dynapro/Makefile.am	1970-01-01 01:00:00.000000000 +0100
+++ dynapropatch/inputdrivers/dynapro/Makefile.am	2005-05-26 16:23:15.581422448 +0200
@@ -0,0 +1,27 @@
+## Makefile.am for DirectFB/inputdrivers/dynapro
+
+INCLUDES = \
+	-I$(top_srcdir)/include	\
+	-I$(top_builddir)/lib	\
+	-I$(top_srcdir)/lib	\
+	-I$(top_srcdir)/src
+
+input_LTLIBRARIES = libdirectfb_dynapro.la
+
+if BUILD_STATIC
+input_DATA = $(input_LTLIBRARIES:.la=.o)
+endif
+
+inputdir = $(MODULEDIR)/inputdrivers
+
+libdirectfb_dynapro_la_SOURCES =	\
+	dynapro.c
+
+libdirectfb_dynapro_la_LDFLAGS = \
+	-export-dynamic		\
+	-avoid-version		\
+	$(DFB_LDFLAGS)
+
+
+include $(top_srcdir)/rules/libobject.make
+
diff -Nur -x CVS -x '.*' pristine/inputdrivers/dynapro/dynapro.c dynapropatch/inputdrivers/dynapro/dynapro.c
--- pristine/inputdrivers/dynapro/dynapro.c	1970-01-01 01:00:00.000000000 +0100
+++ dynapropatch/inputdrivers/dynapro/dynapro.c	2005-05-26 16:33:39.500057168 +0200
@@ -0,0 +1,346 @@
+/*
+   Written by Pär Degerman <parde@ikp.liu.se>
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, write to the
+   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.
+
+	
+	NOTES
+	=====
+	This driver is based heavily on code from two other DirectFB
+	drivers, namely mutouch.c by Simon Ueng and elo.c by Byron 
+	Stanoszek and Brandon Reynolds, so a lot of credit should go 
+	to those people and not me.
+
+	INSTRUCTIONS
+	============
+	You should change DYNAPRO_MIN_X and DYNAPRO_MIN_Y to match
+	the orientation of your touchscreen.
+
+*/
+
+#include <unistd.h>
+#include <termios.h>
+#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/file.h>
+#include <fcntl.h>
+
+#include <directfb.h>
+
+#include <core/coredefs.h>
+#include <core/coretypes.h>
+
+#include <core/input.h>
+#include <core/system.h>
+
+#include <misc/conf.h>
+
+#include <direct/debug.h>
+#include <direct/mem.h>
+#include <direct/messages.h>
+#include <direct/memcpy.h>
+#include <direct/thread.h>
+
+#include <core/input_driver.h>
+
+DFB_INPUT_DRIVER( dynapro )
+
+#define DYNAPRO_DEVICE "/dev/ttyS0"
+#define DYNAPRO_BAUD B9600
+#define DYNAPRO_PACKET_SIZE 5
+
+#define DYNAPRO_SCREENWIDTH 800
+#define DYNAPRO_SCREENHEIGHT 600
+#define DYNAPRO_MINX 800
+#define DYNAPRO_MINY 600
+
+#define DYNAPRO_CMD_TOUCH 0x81
+#define DYNAPRO_CMD_UNTOUCH 0x80
+
+typedef struct __dynaproData__ {
+  int fd;
+  DirectThread *thread;
+  CoreInputDevice *device;
+
+  unsigned short screen_width;
+  unsigned short screen_height;
+  unsigned short min_x;
+  unsigned short min_y;
+
+  unsigned short x;
+  unsigned short y;
+  unsigned char action;
+} dynaproData;
+
+/* Read a packet from touchcontroller */
+static inline unsigned char *dynapro_getpck(int fd)
+{
+  static unsigned char packet[DYNAPRO_PACKET_SIZE];
+  static unsigned int len = 0, start = 0;
+
+  while(1) {
+	 if (read(fd, &packet[len++], 1) < 1) {
+		break;
+	 }
+
+	 if (0 == start) {
+		if (packet[len-1] & 0x80) {
+			/* Packet start found */
+			start = 1;
+			continue;
+		} else {
+			/* Continue searching for packet start */
+			len = 0;
+			start = 0;
+			continue;
+		}
+	 } else if (len < DYNAPRO_PACKET_SIZE) {
+		/* Continue until we have a full packet */
+		start = 1;
+		continue;
+	 }
+
+	 /* A full packet received */
+	 len = 0;
+	 start = 0;
+	 return packet;
+  }
+}
+
+/* Remove all input translations over tty serial controller.
+ *
+ * set=1:  Saves current settings then turns rawmode on.
+ * set=0:  Restores controller to previous saved value.
+ */
+static void tty_rawmode(int fd, int set)
+{
+  static struct termios tbuf, termios_save;
+
+  if(set) {
+	 tcgetattr(fd, &termios_save);
+    tbuf = termios_save;
+
+    tbuf.c_iflag = 0; /* No input processing */
+    tbuf.c_oflag = 0; /* No output processing */
+    tbuf.c_lflag = 0; /* Disable erase/kill, signals, and echo */
+
+	 /* Set baud & 1-char read mode */
+    tbuf.c_cflag = DYNAPRO_BAUD | CS8 | CLOCAL | CREAD;
+
+    tcsetattr(fd, TCSANOW, &tbuf);
+  } else {
+    tcsetattr(fd, TCSANOW, &termios_save);
+  }
+}
+
+/* Open file descriptor to touch device */
+static int dynaproOpenDevice(unsigned char *device)
+{
+  int fd;
+
+  if((fd = open(device, O_RDWR|O_NOCTTY)) == -1) {
+    D_PERROR("DirectFB/dynbapro: Error opening '%s'!\n",device);
+    return -1;
+  }
+
+  if((flock(fd, LOCK_EX|LOCK_NB)) == -1) {
+    D_PERROR("DirectFB/dynbapro: Error locking '%s'!\n",device);
+    close(fd);
+    return -1;
+  }
+
+  tty_rawmode(fd,1);
+
+  return fd;
+}
+
+
+static int dynaproGetEvent(dynaproData *event)
+{
+  unsigned char *ptr;
+  unsigned int cmd, x, y;
+
+  /* read packet */
+  if(!(ptr = dynapro_getpck(event->fd))) {
+    return -1;
+  }
+
+  /* Get command (touch/untouch) and coordinates */
+  cmd = ptr[0];
+  x = (event->screen_width * ((ptr[3] << 8) + ptr[4])) / 0x0fff;
+  y = (event->screen_height* ((ptr[1] << 8) + ptr[2])) / 0x0fff;
+
+  if (event->min_x)
+	 x = event->min_x - x;
+  if (event->min_y)
+	 y = event->min_y - y;
+
+  event->action = cmd;
+  event->x = x;
+  event->y = y;
+
+  return 0;
+}
+
+
+/* The main routine for dynapro */
+static void *dynaproTouchEventThread(DirectThread *thread, void *driver_data)
+{
+  dynaproData *data = (dynaproData *) driver_data;
+
+  /* Read data */
+  while (1) {
+    DFBInputEvent evt;
+
+    if(dynaproGetEvent(data) == -1) {
+		continue;
+	 }
+    direct_thread_testcancel(thread);
+
+    /* Dispatch axis */
+    evt.type    = DIET_AXISMOTION;
+    evt.flags   = DIEF_AXISABS;
+    evt.axis    = DIAI_X;
+    evt.axisabs = data->x;
+    dfb_input_dispatch(data->device, &evt);
+
+    evt.type    = DIET_AXISMOTION;
+    evt.flags   = DIEF_AXISABS;
+    evt.axis    = DIAI_Y;
+    evt.axisabs = data->y;
+    dfb_input_dispatch(data->device, &evt);
+
+    /* Dispatch touch event */
+    if (DYNAPRO_CMD_UNTOUCH == data->action)
+      evt.type = DIET_BUTTONRELEASE;
+    else
+      evt.type = DIET_BUTTONPRESS;
+
+    evt.flags  = DIEF_NONE;
+    evt.button = DIBI_LEFT;
+
+    dfb_input_dispatch(data->device, &evt);
+    direct_thread_testcancel(thread);
+  }
+
+  return NULL;
+}
+
+
+/* exported symbols */
+static int driver_get_available( void )
+{
+  int fd;
+
+  fd = dynaproOpenDevice(DYNAPRO_DEVICE);
+  if (fd < 0) {
+    return 0;
+  }
+  close(fd);
+
+  return 1;
+}
+
+static void driver_get_info( InputDriverInfo *info )
+{
+  /* fill driver info structure */
+  snprintf(info->name, DFB_INPUT_DRIVER_INFO_NAME_LENGTH,
+           "dynapro" );
+  snprintf(info->vendor, DFB_INPUT_DRIVER_INFO_VENDOR_LENGTH,
+           "3M" );
+
+  info->version.major = 0;
+  info->version.minor = 1;
+}
+
+static DFBResult driver_open_device(CoreInputDevice *device,
+                                    unsigned int number,
+                                    InputDeviceInfo *info,
+                                    void **driver_data)
+{
+  int fd;
+  dynaproData *data;
+
+  /* open device */
+  fd = dynaproOpenDevice(DYNAPRO_DEVICE);
+  if(fd < 0) {
+    D_PERROR("DirectFB/dynapro: Error opening '"DYNAPRO_DEVICE"'!\n");
+    return DFB_INIT;
+  }
+
+  data = D_CALLOC(1, sizeof(dynaproData));
+  data->fd     = fd;
+  data->device = device;
+
+  /* FIXME! Use settings instead? */
+  data->screen_width  = DYNAPRO_SCREENWIDTH;
+  data->screen_height = DYNAPRO_SCREENHEIGHT;
+  data->min_x = DYNAPRO_MINX;
+  data->min_y = DYNAPRO_MINY;
+
+  /* fill device info structure */
+  snprintf(info->desc.name, DFB_INPUT_DEVICE_DESC_NAME_LENGTH,
+           "dynapro");
+  snprintf(info->desc.vendor, DFB_INPUT_DEVICE_DESC_VENDOR_LENGTH,
+           "3M");
+
+  info->prefered_id     = DIDID_MOUSE;
+  info->desc.type       = DIDTF_MOUSE;
+  info->desc.caps       = DICAPS_AXES | DICAPS_BUTTONS;
+  info->desc.max_axis   = DIAI_Y;
+  info->desc.max_button = DIBI_LEFT;
+
+  /* start input thread */
+  data->thread = direct_thread_create(DTT_INPUT, 
+												  dynaproTouchEventThread, 
+												  data, 
+												  "Dynapro Touch Input");
+
+  /* set private data pointer */
+  *driver_data = data;
+
+  return DFB_OK;
+}
+
+/*
+ * Fetch one entry from the device's keymap if supported.
+ */
+static DFBResult driver_get_keymap_entry(CoreInputDevice *device,
+                                         void        *driver_data,
+                                         DFBInputDeviceKeymapEntry *entry)
+{
+  return DFB_UNSUPPORTED;
+}
+
+static void driver_close_device(void *driver_data)
+{
+  dynaproData *data = (dynaproData *)driver_data;
+
+  /* stop input thread */
+  direct_thread_cancel(data->thread);
+  direct_thread_join(data->thread);
+  direct_thread_destroy(data->thread);
+
+  /* restore termnial settings for the port */
+  tty_rawmode(data->fd, 0);
+
+  /* close device */
+  close(data->fd);
+
+  /* free private data */
+  D_FREE(data);
+}
