I've completed testing on the attached patch to 1.3.0 that adds a
touchscreen input driver to support the Cowon O2PMP. I didn't think
that this would be useful to a large audience, so I disabled a build for
the driver unless specified explicitly (--with_inputdrivers=o2pmp).
I wasn't sure what the best way to circumvent a bug in the Cowon's linux
framebuffer driver, so incorporated an ugly #ifdef test down in
systems/fbdev/fbdev.c - with copious notes. Since I have yet to get
anyone at Cowon to communicate, I doubt that there will be any repairs
to their driver for this model of device. I do believe that this driver
should be pretty close for any future Linux-based PMP's they release in
the future.
I am just migrating to 1.3.1 and have manually added this patch with a
successful compile. However, until I have a chance to test, I won't
send the patch file.
Hopefully this will be useful to someone else out there...
Regards,
Fred
diff -Naur DirectFB-1.3.0/config.h.in DirectFB-1.3.0-new/config.h.in
--- DirectFB-1.3.0/config.h.in 2008-09-29 05:10:20.000000000 -0600
+++ DirectFB-1.3.0-new/config.h.in 2009-04-26 22:25:55.243837211 -0600
@@ -93,6 +93,9 @@
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
#undef NO_MINUS_C_MINUS_O
+/* Define to 1 if you are compiling drivers for the Cowon O2PMP. */
+#undef O2PMP
+
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
diff -Naur DirectFB-1.3.0/configure.in DirectFB-1.3.0-new/configure.in
--- DirectFB-1.3.0/configure.in 2008-09-29 04:48:09.000000000 -0600
+++ DirectFB-1.3.0-new/configure.in 2009-04-26 23:24:11.756963081 -0600
@@ -1088,6 +1088,7 @@
checkfor_linux_input=no
checkfor_lirc=no
checkfor_mutouch=no
+checkfor_o2pmp=no
checkfor_penmount=no
checkfor_ps2mouse=no
checkfor_serialmouse=no
@@ -1103,8 +1104,8 @@
[ 'all' builds all drivers (default), 'none' builds none ]
[ Possible inputdrivers are: ]
[ dbox2remote, dreamboxremote, dynapro, elo-input, gunze, h3600_ts, ]
-[ joystick, keyboard, linuxinput, lirc, mutouch, penmount, ps2mouse, ]
-[ serialmouse, sonypijogdial, tslib, ucb1x00, wm97xx], inputdrivers="$withval",[inputdrivers="all"])
+[ joystick, keyboard, linuxinput, lirc, mutouch, o2pmp, penmount, ]
+[ ps2mouse, serialmouse, sonypijogdial, tslib, ucb1x00, wm97xx], inputdrivers="$withval",[inputdrivers="all"])
if test "$inputdrivers" = "all"; then
checkfor_dbox2remote=yes
@@ -1118,6 +1119,7 @@
checkfor_linux_input=yes
checkfor_lirc=yes
checkfor_mutouch=yes
+ checkfor_o2pmp=no
checkfor_penmount=yes
checkfor_ps2mouse=yes
checkfor_serialmouse=yes
@@ -1165,6 +1167,9 @@
mutouch)
checkfor_mutouch=yes
;;
+ o2pmp)
+ checkfor_o2pmp=yes
+ ;;
penmount)
checkfor_penmount=yes
;;
@@ -1276,6 +1281,13 @@
enable_mutouch=yes
fi
+enable_o2pmp=no
+if test "$checkfor_o2pmp" = "yes"; then
+ dnl Test for Cowon O2PMP Touchscreen support
+ enable_o2pmp=yes
+ AC_DEFINE(O2PMP,1,[Define to 1 if you are compiling drivers for the Cowon O2PMP.])
+fi
+
enable_penmount=no
if test "$checkfor_penmount" = "yes"; then
enable_penmount=yes
@@ -1421,6 +1433,7 @@
AM_CONDITIONAL(LINUX_INPUT, test "$enable_linux_input" = "yes")
AM_CONDITIONAL(LIRC_INPUT, test "$enable_lirc" = "yes")
AM_CONDITIONAL(MUTOUCH_TS, test "$enable_mutouch" = "yes")
+AM_CONDITIONAL(O2PMP, test "$enable_o2pmp" = "yes")
AM_CONDITIONAL(PENMOUNT_TS, test "$enable_penmount" = "yes" )
AM_CONDITIONAL(PS2MOUSE_INPUT, test "$enable_ps2mouse" = "yes")
AM_CONDITIONAL(SERIAL_MOUSE_INPUT, test "$enable_serial_mouse" = "yes")
@@ -1587,6 +1600,7 @@
inputdrivers/linux_input/Makefile
inputdrivers/lirc/Makefile
inputdrivers/mutouch/Makefile
+inputdrivers/o2pmp/Makefile
inputdrivers/penmount/Makefile
inputdrivers/ps2mouse/Makefile
inputdrivers/serialmouse/Makefile
@@ -1715,6 +1729,7 @@
Linux Input $enable_linux_input
LiRC $enable_lirc
MuTouch touchscreen $enable_mutouch
+ Cowon O2PMP Touchscreen $enable_o2pmp
PS/2 Mouse $enable_ps2mouse
Serial Mouse $enable_serial_mouse
SonyPI Jogdial $enable_sonypi_jogdial
diff -Naur DirectFB-1.3.0/inputdrivers/Makefile.am DirectFB-1.3.0-new/inputdrivers/Makefile.am
--- DirectFB-1.3.0/inputdrivers/Makefile.am 2008-09-26 17:32:25.000000000 -0600
+++ DirectFB-1.3.0-new/inputdrivers/Makefile.am 2009-04-26 22:22:29.788587397 -0600
@@ -44,6 +44,10 @@
MUTOUCH_TS_DIR = mutouch
endif
+if O2PMP
+O2PMP_DIR = o2pmp
+endif
+
if PENMOUNT_TS
PENMOUNT_TS_DIR = penmount
endif
@@ -84,6 +88,7 @@
$(LINUX_INPUT_DIR) \
$(LIRC_INPUT_DIR) \
$(MUTOUCH_TS_DIR) \
+ $(O2PMP_DIR) \
$(PENMOUNT_TS_DIR) \
$(PS2MOUSE_INPUT_DIR) \
$(SERIALMOUSE_INPUT_DIR) \
diff -Naur DirectFB-1.3.0/inputdrivers/Makefile.in DirectFB-1.3.0-new/inputdrivers/Makefile.in
--- DirectFB-1.3.0/inputdrivers/Makefile.in 2009-04-27 00:02:03.559836708 -0600
+++ DirectFB-1.3.0-new/inputdrivers/Makefile.in 2009-04-27 00:02:48.171838751 -0600
@@ -56,8 +56,8 @@
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = dbox2remote dreamboxremote dynapro elo gunze h3600_ts \
- joystick keyboard linux_input lirc mutouch penmount ps2mouse \
- serialmouse sonypi tslib ucb1x00_ts wm97xx_ts
+ joystick keyboard linux_input lirc mutouch o2pmp penmount \
+ ps2mouse serialmouse sonypi tslib ucb1x00_ts wm97xx_ts
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@@ -249,6 +249,7 @@
@linux_input_t...@linux_input_dir = linux_input
@lirc_input_t...@lirc_input_dir = lirc
@mutouch_ts_t...@mutouch_ts_dir = mutouch
+...@o2pmp_true@O2PMP_DIR = o2pmp
@penmount_ts_t...@penmount_ts_dir = penmount
@ps2mouse_input_t...@ps2mouse_input_dir = ps2mouse
@serial_mouse_input_t...@serialmouse_input_dir = serialmouse
@@ -268,6 +269,7 @@
$(LINUX_INPUT_DIR) \
$(LIRC_INPUT_DIR) \
$(MUTOUCH_TS_DIR) \
+ $(O2PMP_DIR) \
$(PENMOUNT_TS_DIR) \
$(PS2MOUSE_INPUT_DIR) \
$(SERIALMOUSE_INPUT_DIR) \
diff -Naur DirectFB-1.3.0/inputdrivers/o2pmp/Makefile.am DirectFB-1.3.0-new/inputdrivers/o2pmp/Makefile.am
--- DirectFB-1.3.0/inputdrivers/o2pmp/Makefile.am 1969-12-31 17:00:00.000000000 -0700
+++ DirectFB-1.3.0-new/inputdrivers/o2pmp/Makefile.am 2009-04-26 22:19:52.913587621 -0600
@@ -0,0 +1,27 @@
+## Makefile.am for DirectFB/inputdrivers/o2pmp
+
+INCLUDES = \
+ -I$(top_srcdir)/include \
+ -I$(top_builddir)/lib \
+ -I$(top_srcdir)/lib \
+ -I$(top_srcdir)/src
+
+input_LTLIBRARIES = libdirectfb_o2pmp.la
+
+if BUILD_STATIC
+input_DATA = $(input_LTLIBRARIES:.la=.o)
+endif
+
+inputdir = $(MODULEDIR)/inputdrivers
+
+libdirectfb_o2pmp_la_SOURCES = \
+ o2pmp.c
+
+libdirectfb_o2pmp_la_LDFLAGS = \
+ -export-dynamic \
+ -avoid-version \
+ $(DFB_LDFLAGS)
+
+
+include $(top_srcdir)/rules/libobject.make
+
diff -Naur DirectFB-1.3.0/inputdrivers/o2pmp/Makefile.in DirectFB-1.3.0-new/inputdrivers/o2pmp/Makefile.in
--- DirectFB-1.3.0/inputdrivers/o2pmp/Makefile.in 1969-12-31 17:00:00.000000000 -0700
+++ DirectFB-1.3.0-new/inputdrivers/o2pmp/Makefile.in 2009-04-27 00:02:49.528836325 -0600
@@ -0,0 +1,585 @@
+# Makefile.in generated by automake 1.10 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+...@set_make@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(top_srcdir)/rules/libobject.make
+subdir = inputdrivers/o2pmp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(inputdir)" "$(DESTDIR)$(inputdir)"
+inputLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(input_LTLIBRARIES)
+libdirectfb_o2pmp_la_LIBADD =
+am_libdirectfb_o2pmp_la_OBJECTS = o2pmp.lo
+libdirectfb_o2pmp_la_OBJECTS = $(am_libdirectfb_o2pmp_la_OBJECTS)
+libdirectfb_o2pmp_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(libdirectfb_o2pmp_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(libdirectfb_o2pmp_la_SOURCES)
+DIST_SOURCES = $(libdirectfb_o2pmp_la_SOURCES)
+inputDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(input_DATA)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AS = @AS@
+ASFLAGS = @ASFLAGS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATADIR = @DATADIR@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@
+DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@
+DFB_LDFLAGS = @DFB_LDFLAGS@
+DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@
+DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@
+DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@
+DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@
+DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@
+DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@
+DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@
+DIRECTFB_VERSION = @DIRECTFB_VERSION@
+DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@
+DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@
+DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@
+DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@
+DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@
+DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@
+DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@
+DYNLIB = @DYNLIB@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
+FREETYPE_LIBS = @FREETYPE_LIBS@
+FREETYPE_PROVIDER = @FREETYPE_PROVIDER@
+FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@
+FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@
+FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@
+GIF_PROVIDER = @GIF_PROVIDER@
+GREP = @GREP@
+HAVE_LINUX = @HAVE_LINUX@
+INCLUDEDIR = @INCLUDEDIR@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@
+JPEG_PROVIDER = @JPEG_PROVIDER@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBJPEG = @LIBJPEG@
+LIBOBJS = @LIBOBJS@
+LIBPNG = @LIBPNG@
+LIBPNG_CONFIG = @LIBPNG_CONFIG@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_AGE = @LT_AGE@
+LT_BINARY = @LT_BINARY@
+LT_CURRENT = @LT_CURRENT@
+LT_RELEASE = @LT_RELEASE@
+LT_REVISION = @LT_REVISION@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MAN2HTML = @MAN2HTML@
+MKDIR_P = @MKDIR_P@
+MODULEDIR = @MODULEDIR@
+MODULEDIRNAME = @MODULEDIRNAME@
+OBJEXT = @OBJEXT@
+OSX_LIBS = @OSX_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+PKG_CONFIG = @PKG_CONFIG@
+PNG_PROVIDER = @PNG_PROVIDER@
+RANLIB = @RANLIB@
+RUNTIME_SYSROOT = @RUNTIME_SYSROOT@
+SDL_CFLAGS = @SDL_CFLAGS@
+SDL_LIBS = @SDL_LIBS@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SOPATH = @SOPATH@
+STRIP = @STRIP@
+SYSCONFDIR = @SYSCONFDIR@
+SYSFS_LIBS = @SYSFS_LIBS@
+THREADFLAGS = @THREADFLAGS@
+THREADLIB = @THREADLIB@
+TSLIB_CFLAGS = @TSLIB_CFLAGS@
+TSLIB_LIBS = @TSLIB_LIBS@
+VERSION = @VERSION@
+VNC_CFLAGS = @VNC_CFLAGS@
+VNC_CONFIG = @VNC_CONFIG@
+VNC_LIBS = @VNC_LIBS@
+X11_CFLAGS = @X11_CFLAGS@
+X11_LIBS = @X11_LIBS@
+ZLIB_LIBS = @ZLIB_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+INCLUDES = \
+ -I$(top_srcdir)/include \
+ -I$(top_builddir)/lib \
+ -I$(top_srcdir)/lib \
+ -I$(top_srcdir)/src
+
+input_LTLIBRARIES = libdirectfb_o2pmp.la
+...@build_static_true@input_DATA = $(input_LTLIBRARIES:.la=.o)
+inputdir = $(MODULEDIR)/inputdrivers
+libdirectfb_o2pmp_la_SOURCES = \
+ o2pmp.c
+
+libdirectfb_o2pmp_la_LDFLAGS = \
+ -export-dynamic \
+ -avoid-version \
+ $(DFB_LDFLAGS)
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu inputdrivers/o2pmp/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu inputdrivers/o2pmp/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-inputLTLIBRARIES: $(input_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ test -z "$(inputdir)" || $(MKDIR_P) "$(DESTDIR)$(inputdir)"
+ @list='$(input_LTLIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+ f=$(am__strip_dir) \
+ echo " $(LIBTOOL) --mode=install $(inputLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(inputdir)/$$f'"; \
+ $(LIBTOOL) --mode=install $(inputLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(inputdir)/$$f"; \
+ else :; fi; \
+ done
+
+uninstall-inputLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @list='$(input_LTLIBRARIES)'; for p in $$list; do \
+ p=$(am__strip_dir) \
+ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(inputdir)/$$p'"; \
+ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(inputdir)/$$p"; \
+ done
+
+clean-inputLTLIBRARIES:
+ -test -z "$(input_LTLIBRARIES)" || rm -f $(input_LTLIBRARIES)
+ @list='$(input_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libdirectfb_o2pmp.la: $(libdirectfb_o2pmp_la_OBJECTS) $(libdirectfb_o2pmp_la_DEPENDENCIES)
+ $(libdirectfb_o2pmp_la_LINK) -rpath $(inputdir) $(libdirectfb_o2pmp_la_OBJECTS) $(libdirectfb_o2pmp_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+...@amdep_true@@am__include@ @am__qu...@./$(DEPDIR)/o2pmp....@am__quote@
+
+.c.o:
+...@am__fastdepcc_true@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+...@am__fastdepcc_true@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+...@amdep_true@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+...@amdep_true@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+...@am__fastdepcc_false@ $(COMPILE) -c $<
+
+.c.obj:
+...@am__fastdepcc_true@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+...@am__fastdepcc_true@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+...@amdep_true@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+...@amdep_true@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+...@am__fastdepcc_false@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+...@am__fastdepcc_true@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+...@am__fastdepcc_true@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+...@amdep_true@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+...@amdep_true@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+...@am__fastdepcc_false@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-inputDATA: $(input_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(inputdir)" || $(MKDIR_P) "$(DESTDIR)$(inputdir)"
+ @list='$(input_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(inputDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(inputdir)/$$f'"; \
+ $(inputDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(inputdir)/$$f"; \
+ done
+
+uninstall-inputDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(input_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(inputdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(inputdir)/$$f"; \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(inputdir)" "$(DESTDIR)$(inputdir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-inputLTLIBRARIES clean-libtool \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-inputDATA install-inputLTLIBRARIES
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-inputDATA uninstall-inputLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-inputLTLIBRARIES clean-libtool ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-inputDATA \
+ install-inputLTLIBRARIES install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-inputDATA \
+ uninstall-inputLTLIBRARIES
+
+%.o: .libs/%.a %.la
+ rm -f $<.tmp/*.o
+ if test -d $<.tmp; then rmdir $<.tmp; fi
+ mkdir $<.tmp
+ (cd $<.tmp && $(AR) x ../../$<)
+ $(LD) -o $@ -r $<.tmp/*.o
+ rm -f $<.tmp/*.o && rmdir $<.tmp
+
+.PHONY: $(LTLIBRARIES:%.la=.libs/%.a)
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff -Naur DirectFB-1.3.0/inputdrivers/o2pmp/o2pmp.c DirectFB-1.3.0-new/inputdrivers/o2pmp/o2pmp.c
--- DirectFB-1.3.0/inputdrivers/o2pmp/o2pmp.c 1969-12-31 17:00:00.000000000 -0700
+++ DirectFB-1.3.0-new/inputdrivers/o2pmp/o2pmp.c 2009-04-27 01:34:39.945587293 -0600
@@ -0,0 +1,417 @@
+/*
+ Written by Fred Beck <bec...@comcast.net>
+
+ 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 the dynalib DirectFB
+ driver by Pär Degerman <pa...@ikp.liu.se>, and the cwn_driver.c
+ code provided by the COWON_SDKV1.3 (http://www.cowon.com).
+
+*/
+
+#include <config.h>
+
+#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/file.h>
+#include <linux/fb.h>
+
+#include <directfb.h>
+
+#include <core/coredefs.h>
+#include <core/coretypes.h>
+#include <core/input.h>
+
+#include <misc/conf.h>
+
+#include <direct/mem.h>
+#include <direct/messages.h>
+#include <direct/thread.h>
+
+#include <unistd.h>
+
+#include <core/input_driver.h>
+
+/* COWON O2PMP Specific values */
+#define O2PMP_NAME "o2pmp"
+#define O2PMP_VENDOR "COWON"
+#define O2PMP_THREAD_NAME "Cowon_O2 TS Input"
+#define O2PMP_DEVICE "/dev/cwo2"
+#define O2PMP_FB "/dev/fb"
+#define O2PMP_VERSION_MAJOR (0)
+#define O2PMP_VERSION_MINOR (1)
+
+#define O2PMP_FB_WIDTH (480)
+#define O2PMP_FB_HEIGHT (272)
+#define O2PMP_MINX (O2PMP_FB_WIDTH)
+#define O2PMP_MINY (O2PMP_FB_HEIGHT)
+#define O2PMP_MAXX (0)
+#define O2PMP_MAXY (0)
+#define O2PMP_BITS_PER_PIXEL (16)
+
+/* ioctl commands for power control */
+#define O2PMP_CMD_PWR (34)
+#define O2PMP_PWR_REBOOT (47)
+#define O2PMP_PWR_OFF (9)
+#define O2PMP_PWR_WDT_RESET (15) // Reset Watchdog Timer
+#define O2PMP_PWR_WDT_DISABLE (14) // Disable Watchdog Timer
+
+/* ioctl commands for touch control */
+#define O2PMP_CMD_SEND_PID (45) // Register task ID
+#define O2PMP_CMD_TOUCH_READ (44) // Get touch offset x, y
+#define O2PMP_CMD_SEND_SIGNO (46) // Register signal number
+#define O2PMP_CMD_GET_DRV_DATA (48) // Detect power off and usb connection
+#define O2PMP_TOUCH_VALID_CHECK_CNT (4)
+#define O2PMP_PACKET_SIZE (2 * O2PMP_TOUCH_VALID_CHECK_CNT)
+#define O2PMP_VAL_READ_TOUCH_RESET (3) // Value to clear the next touch event
+#define O2PMP_VAL_READ_TOUCH_RESET (3) // Value to clear the next touch event
+#define O2PMP_CMD_UNTOUCH (0) // A "touch up" event
+#define O2PMP_CMD_TOUCH (1) // A "touch down" event
+
+/* ioctl commands for touch revision */
+#define O2PMP_CMD_GET_XY_BY_REV (50)
+#define O2PMP_CMD_GET_XY_BY_CAL (51)
+
+
+/* Register the driver name */
+DFB_INPUT_DRIVER( o2pmp )
+
+/* Declaration for the private driver data */
+typedef struct {
+ CoreInputDevice *device;
+ DirectThread *thread;
+ int fd;
+ unsigned short x;
+ unsigned short y;
+ unsigned char action;
+} o2pmpData;
+
+/* Internal structure used by ioctl() reading O2PMP_DEVICE */
+typedef struct {
+ long x_pos; // Offset x
+ long y_pos; // Offset y
+ long reserved1; // Reserved
+ long reserved2; // Reserved
+ long pen_status; // 0: up / 1: down
+} touch_event_data;
+
+
+#define RANGE_LIMIT( val, low, high )\
+ (((val) > (high)) ? (high) : (((val) < (low)) ? (low) : (val)))
+#define O2PMP_DEV\
+ (dfb_config->o2pmp_device ? dfb_config->o2pmp_device : O2PMP_DEVICE)
+
+/* Prototypes */
+static int o2pmpOpenDevice( const char * );
+static int o2pmpGetEvent( o2pmpData * );
+static void * o2pmpTouchEventThread( DirectThread *, void * );
+
+static int driver_get_available( void );
+static void driver_get_info( InputDriverInfo * );
+static DFBResult driver_open_device( CoreInputDevice *, unsigned int, InputDeviceInfo *, void ** );
+static DFBResult driver_get_keymap_entry( CoreInputDevice *, void *, DFBInputDeviceKeymapEntry * );
+static void driver_close_device( void * );
+
+void inline __o2pmp_touch_buf_reset( int );
+int inline __o2pmp_getted( int, touch_event_data * );
+int __o2pmp_get_pwr_event( int );
+
+
+/* Open file descriptor to touch device */
+static int o2pmpOpenDevice( const char *device )
+{
+ int fd;
+
+ /* Open the o2pmp device driver */
+ if( (fd = open( device, O_RDWR )) == -1 )
+ {
+ D_PERROR( "DirectFB/o2pmp: Error opening '%s'!\n", device );
+ return -1;
+ }
+
+ /* Disable the watchdog timer for the device */
+ if ( ioctl( fd, O2PMP_CMD_PWR, O2PMP_PWR_WDT_DISABLE ) < 0 )
+ {
+ D_PERROR( "DirectFB/o2pmp: Warning, could not disable watchdog timer for '%s'!\n", device );
+ }
+
+ /* Register the main task ID */
+ if ( ioctl( fd, O2PMP_CMD_SEND_PID, getpid() ) < 0 )
+ {
+ D_PERROR( "DirectFB/o2pmp: Error registering task id to '%s'!\n", device );
+ close( fd );
+ return -1;
+ }
+
+ /* Clear the touch input buffer */
+ __o2pmp_touch_buf_reset( fd );
+
+ return fd;
+}
+
+static int o2pmpGetEvent( o2pmpData *event )
+{
+ touch_event_data ted, *p_ted = &ted;
+ int retval;
+
+ /* fetch touch event data */
+ retval = __o2pmp_getted( event->fd, p_ted );
+ if( retval < 0 )
+ return -1;
+
+ /* Get command (touch/untouch) and coordinates */
+ event->action = p_ted->pen_status;
+ event->x = p_ted->x_pos;
+ event->y = p_ted->y_pos;
+
+ return 0;
+}
+
+
+/* The main routine for o2pmp */
+static void *o2pmpTouchEventThread( DirectThread *thread, void *driver_data )
+{
+ o2pmpData *data = (o2pmpData *) driver_data;
+ int retval = 0;
+ int old_x = -1;
+ int old_y = -1;
+ int old_action = -1;
+
+ /* Read data */
+ while (1)
+ {
+ DFBInputEvent evt;
+
+ direct_thread_testcancel( thread ); // Make sure we aren't supposed to cancel
+
+ retval = o2pmpGetEvent( data ); // Get the event data
+ if ( retval < 0 )
+ continue;
+
+ /* Make sure it is a new event before dispatching! */
+
+ /* Dispatch x-axis */
+ if ( data->x != old_x )
+ {
+ evt.type = DIET_AXISMOTION;
+ evt.flags = DIEF_AXISABS;
+ evt.axis = DIAI_X;
+ evt.axisabs = data->x;
+ old_x = data->x;
+
+ dfb_input_dispatch( data->device, &evt );
+ }
+
+ /* Dispatch y-axis */
+ if ( data->y != old_y )
+ {
+ evt.type = DIET_AXISMOTION;
+ evt.flags = DIEF_AXISABS;
+ evt.axis = DIAI_Y;
+ evt.axisabs = data->y;
+ old_y = data->y;
+
+ dfb_input_dispatch( data->device, &evt );
+ }
+
+ /* Dispatch touch event type */
+ if ( data->action != old_action )
+ {
+ /* Dispatch touch event */
+ evt.type = data->action ? DIET_BUTTONPRESS : DIET_BUTTONRELEASE;
+ evt.flags = DIEF_NONE;
+ evt.button = DIBI_LEFT;
+ old_action = data->action;
+
+ dfb_input_dispatch( data->device, &evt );
+
+ }
+ }
+
+ return NULL;
+}
+
+
+
+/* exported symbols */
+
+/* Return the number of available devices.
+ * Called once during initialization of DirectFB.
+ */
+static int driver_get_available( void )
+{
+ int fd;
+
+ fd = o2pmpOpenDevice( O2PMP_DEV );
+ if ( fd < 0 )
+ return 0;
+ close( fd );
+
+ return 1;
+}
+
+
+/* Fill out general information about this driver.
+ * Called once during initialization of DirectFB.
+ */
+static void driver_get_info( InputDriverInfo *info )
+{
+ snprintf( info->name, DFB_INPUT_DRIVER_INFO_NAME_LENGTH, O2PMP_NAME );
+ snprintf( info->vendor, DFB_INPUT_DRIVER_INFO_VENDOR_LENGTH, O2PMP_VENDOR );
+
+ info->version.major = O2PMP_VERSION_MAJOR;
+ info->version.minor = O2PMP_VERSION_MINOR;
+}
+
+
+/* Open the device, fill out information about it,
+ * allocate and fill private data, start input thread.
+ * Called during initialization, resuming or taking over mastership.
+ */
+static DFBResult driver_open_device( CoreInputDevice *device,
+ unsigned int number,
+ InputDeviceInfo *info,
+ void **driver_data )
+{
+ int fd;
+ o2pmpData *data;
+
+ /* open device */
+ fd = o2pmpOpenDevice( O2PMP_DEV );
+ if( fd < 0 )
+ {
+ D_PERROR( "DirectFB/o2pmp: Error opening '%s'!\n", O2PMP_DEV );
+ return DFB_INIT;
+ }
+
+ /* fill device info structure */
+ snprintf( info->desc.name, DFB_INPUT_DEVICE_DESC_NAME_LENGTH, O2PMP_NAME );
+ snprintf( info->desc.vendor, DFB_INPUT_DEVICE_DESC_VENDOR_LENGTH, O2PMP_VENDOR );
+
+ /* set one of the primary input device IDs */
+ info->prefered_id = DIDID_MOUSE;
+
+ /* set type flags */
+ info->desc.type = DIDTF_MOUSE;
+
+ /* set capabilities */
+ info->desc.caps = DICAPS_AXES | DICAPS_BUTTONS;
+ info->desc.max_axis = DIAI_Y;
+ info->desc.max_button = DIBI_LEFT;
+
+ /* allocate and fill private data */
+ data = D_CALLOC( 1, sizeof(o2pmpData) );
+
+ data->fd = fd;
+ data->device = device;
+
+ /* start input thread */
+ data->thread = direct_thread_create( DTT_INPUT,
+ o2pmpTouchEventThread,
+ data,
+ O2PMP_THREAD_NAME );
+
+ /* 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;
+}
+
+
+/* close the device */
+static void driver_close_device( void *driver_data )
+{
+ o2pmpData *data = (o2pmpData *)driver_data;
+
+ /* stop input thread */
+ direct_thread_cancel( data->thread );
+ direct_thread_join( data->thread );
+ direct_thread_destroy( data->thread );
+
+ /* close device */
+ close( data->fd );
+
+ /* free private data */
+ D_FREE( data );
+}
+
+
+/* read the input buffer to clear/reset it */
+void inline __o2pmp_touch_buf_reset( int fd )
+{
+ char touch_buf[17];
+ read( fd, &touch_buf, O2PMP_VAL_READ_TOUCH_RESET );
+}
+
+
+/* read a packet from touchcontroller */
+int inline __o2pmp_getted( int fd, touch_event_data *p_ted )
+{
+ int buf[O2PMP_PACKET_SIZE];
+ static int offset = O2PMP_TOUCH_VALID_CHECK_CNT;
+ int i;
+ int retval;
+
+ for ( i = 0; i < offset; i++ )
+ {
+ /* Read the x,y buffer */
+ retval = ioctl( fd, O2PMP_CMD_TOUCH_READ, p_ted );
+
+ buf[i] = p_ted->x_pos;
+ buf[i+offset] = p_ted->y_pos;
+
+ }
+
+ /* Update the positions */
+ retval = ioctl( fd, O2PMP_CMD_GET_XY_BY_REV, buf );
+
+ p_ted->x_pos = buf[0];
+ p_ted->y_pos = buf[offset];
+
+ /* Calibrate the touch event */
+ retval = ioctl( fd, O2PMP_CMD_GET_XY_BY_CAL, p_ted );
+
+ /* limit the range on the returned coordinates */
+ RANGE_LIMIT( p_ted->x_pos, 0, (O2PMP_FB_WIDTH-1) );
+ RANGE_LIMIT( p_ted->y_pos, 0, (O2PMP_FB_HEIGHT-1) );
+
+ return retval;
+}
+
+
+/* check for power events */
+int __o2pmp_get_pwr_event( int fd )
+{
+ // return values
+ // 0: no power off, and no usb connection
+ // 1: usb connection
+ // 2: power off
+
+ return ioctl( fd, O2PMP_CMD_GET_DRV_DATA, NULL );
+}
diff -Naur DirectFB-1.3.0/src/misc/conf.c DirectFB-1.3.0-new/src/misc/conf.c
--- DirectFB-1.3.0/src/misc/conf.c 2008-09-29 07:11:27.000000000 -0600
+++ DirectFB-1.3.0-new/src/misc/conf.c 2009-04-26 23:50:47.736587477 -0600
@@ -148,6 +148,7 @@
" Matrox cable type (default=composite)\n"
" h3600-device=<device> Use this device for the H3600 TS driver\n"
" mut-device=<device> Use this device for the MuTouch driver\n"
+ " o2pmp-device=<device> Use this device for the Cowon O2PMP TS driver\n"
" penmount-device=<device> Use this device for the PenMount driver\n"
" linux-input-devices=<device>[[,<device>]...]\n"
" Use these devices for the Linux Input driver\n"
@@ -1498,6 +1499,18 @@
return DFB_INVARG;
}
} else
+ if (strcmp (name, "o2pmp-device" ) == 0) {
+ if (value) {
+ if (dfb_config->o2pmp_device)
+ D_FREE( dfb_config->o2pmp_device );
+
+ dfb_config->o2pmp_device = D_STRDUP( value );
+ }
+ else {
+ D_ERROR( "DirectFB/Config: No Cowon O2PMP TS device specified!\n" );
+ return DFB_INVARG;
+ }
+ } else
if (strcmp (name, "penmount-device" ) == 0) {
if (value) {
if (dfb_config->penmount_device)
diff -Naur DirectFB-1.3.0/src/misc/conf.h DirectFB-1.3.0-new/src/misc/conf.h
--- DirectFB-1.3.0/src/misc/conf.h 2008-09-26 17:32:25.000000000 -0600
+++ DirectFB-1.3.0-new/src/misc/conf.h 2009-04-26 23:51:13.451713710 -0600
@@ -178,6 +178,8 @@
char *mut_device; /* MuTouch Device */
+ char *o2pmp_device; /* Cowon O2PMP Touchscreen Device */
+
char *penmount_device; /* PenMount Device */
int unichrome_revision; /* Unichrome hardware
diff -Naur DirectFB-1.3.0/systems/fbdev/fbdev.c DirectFB-1.3.0-new/systems/fbdev/fbdev.c
--- DirectFB-1.3.0/systems/fbdev/fbdev.c 2008-09-26 17:32:25.000000000 -0600
+++ DirectFB-1.3.0-new/systems/fbdev/fbdev.c 2009-04-26 23:13:22.634587577 -0600
@@ -466,6 +466,23 @@
goto error;
}
+#ifdef O2PMP
+ /* Fix a "feature" in the framebuffer driver on the COWON O2PMP. It reports
+ * a value for smem_len as 960,000. Using this value causes the mmap() below
+ * to fail. To fix, we replace it with a value that is a multiple of the screen size.
+ * We calculate the screensize and then allow for X buffers of this size
+ * to be used.
+ *
+ * A better implementation of this code would be to look at what input driver
+ * is being used and make this fix only if it is the cowon_o2. But I don't
+ * know the internals of DirectFB well enough to do that...
+ * Fred Beck 3/28/09.
+ */
+
+ /* Screensize = XSIZE*YSIZE*BYTES_PER_PIXEL = 480*272*(16/8) */
+ shared->fix.smem_len = 480*272*(16/8) * 2;
+#endif
+
/* Map the framebuffer */
dfb_fbdev->framebuffer_base = mmap( NULL, shared->fix.smem_len,
PROT_READ | PROT_WRITE, MAP_SHARED,
_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev