r1908 - in trunk

dslinux_amadeus at dslinux.in-berlin.de dslinux_amadeus at dslinux.in-berlin.de
Fri Sep 21 12:16:36 CEST 2007


Author: amadeus
Date: 2007-09-21 12:16:30 +0200 (Fri, 21 Sep 2007)
New Revision: 1908

Log:
Add touchscreen driver for nano-X / Pixil

Modified: trunk/config/config.in
===================================================================
--- trunk/config/config.in	2007-09-19 16:11:03 UTC (rev 1907)
+++ trunk/config/config.in	2007-09-21 10:16:30 UTC (rev 1908)
@@ -1631,6 +1631,7 @@
     bool 'DragonEngine TS' CONFIG_USER_MICROWIN_DE2TSMOUSE
     bool 'Cleopatra Mouse' CONFIG_USER_MICROWIN_CLEOMOUSE
     bool 'No Mouse'        CONFIG_USER_MICROWIN_NOMOUSE
+    bool 'NDS Mouse'       CONFIG_USER_MICROWIN_NDSMOUSE
 	comment 'Keyboard'
 	bool 'TTY Keyboard'    CONFIG_USER_MICROWIN_TTYKBD
 	bool 'Scan Keyboard'   CONFIG_USER_MICROWIN_SCANKBD

Modified: trunk/user/microwin/src/Configs/config.pixil
===================================================================
--- trunk/user/microwin/src/Configs/config.pixil	2007-09-19 16:11:03 UTC (rev 1907)
+++ trunk/user/microwin/src/Configs/config.pixil	2007-09-21 10:16:30 UTC (rev 1908)
@@ -309,8 +309,9 @@
 # PSIONMOUSE	Psion 5 (/dev/touch_psion)
 # YOPYMOUSE	Yopy (/dev/yopy-ts)
 # HARRIERMOUSE	NEC Harrier (/dev/tpanel)
+# NDSMOUSE	Nintendo DS (/dev/touch)
 ####################################################################
-GPMMOUSE                 = Y
+GPMMOUSE                 = N
 SERMOUSE                 = N
 SUNMOUSE                 = N
 NOMOUSE                  = N
@@ -325,6 +326,7 @@
 PSIONMOUSE               = N
 YOPYMOUSE                = N
 HARRIERMOUSE             = N
+NDSMOUSE		 = Y
 
 # keyboard or null kbd driver
 TTYKBD                   = N

Modified: trunk/user/microwin/src/config
===================================================================
--- trunk/user/microwin/src/config	2007-09-19 16:11:03 UTC (rev 1907)
+++ trunk/user/microwin/src/config	2007-09-21 10:16:30 UTC (rev 1908)
@@ -402,10 +402,11 @@
 # PSIONMOUSE	Psion 5 (/dev/touch_psion)
 # YOPYMOUSE	Yopy (/dev/yopy-ts)
 # HARRIERMOUSE	NEC Harrier (/dev/tpanel)
+# NDSMOUSE	Nintendo DS (/dev/touch)
 ####################################################################
 
 ifdef NO_DEFINED_EVER
-GPMMOUSE                 = Y
+GPMMOUSE                 = N
 SERMOUSE                 = N
 SUNMOUSE                 = N
 NOMOUSE                  = N
@@ -420,6 +421,7 @@
 PSIONMOUSE               = N
 YOPYMOUSE                = N
 HARRIERMOUSE             = N
+NDSMOUSE		 = Y
 else
 GPMMOUSE                 = $(subst y,Y,$(CONFIG_USER_MICROWIN_GPMMOUSE))
 SERMOUSE                 = $(subst y,Y,$(CONFIG_USER_MICROWIN_SERMOUSE))
@@ -438,6 +440,7 @@
 UCTSMOUSE                = $(subst y,Y,$(CONFIG_USER_MICROWIN_UCTSMOUSE))
 DE2TSMOUSE               = $(subst y,Y,$(CONFIG_USER_MICROWIN_DE2TSMOUSE))
 CLEOMOUSE                = $(subst y,Y,$(CONFIG_USER_MICROWIN_CLEOMOUSE))
+NDSMOUSE		 = $(subst y,Y,$(CONFIG_USER_MICROWIN_NDSMOUSE))
 endif
 
 # keyboard or null kbd driver

Modified: trunk/user/microwin/src/drivers/Makefile
===================================================================
--- trunk/user/microwin/src/drivers/Makefile	2007-09-19 16:11:03 UTC (rev 1907)
+++ trunk/user/microwin/src/drivers/Makefile	2007-09-21 10:16:30 UTC (rev 1908)
@@ -159,6 +159,12 @@
 OBJS += mou_vrlinux.o
 endif
 
+### Nindento DS touchscreen
+ifeq ($(NDSMOUSE), Y)
+CFLAGS += -DTOUCHSCREEN_NDS=1
+OBJS += mou_touchscreen.o
+endif
+
 #### Yopy touchscreen
 ifeq ($(YOPYMOUSE), Y)
 OBJS += mou_yopy.o

Modified: trunk/user/microwin/src/drivers/mou_touchscreen.c
===================================================================
--- trunk/user/microwin/src/drivers/mou_touchscreen.c	2007-09-19 16:11:03 UTC (rev 1907)
+++ trunk/user/microwin/src/drivers/mou_touchscreen.c	2007-09-21 10:16:30 UTC (rev 1908)
@@ -11,6 +11,7 @@
    TOUCHSCREEN_TUXSCREEN - Shannon IS2630
    TOUCHSCREEN_ADS - Applied Data Systems Graphics Client+ devices
    TOUCHSCREEN_ADS7846 - TI ADS6847 (PSI OMAP Innovator)
+   TOUCHSCREEN_NDS - Nintendo DS
 */
 
 /* To add a new device, add a new item to the config file
@@ -46,6 +47,11 @@
 #include "touchscreen_ucb1x00.h"
 #endif
 
+#ifdef TOUCHSCREEN_NDS
+#include <linux/input.h>
+#include "touchscreen_nds.h"
+#endif
+
 #ifndef TS_DEVICE
 #error "You didn't define a device for the generic touchscreen driver!"
 #endif
@@ -61,6 +67,12 @@
 		return -1;
 	}
 
+#ifdef TOUCHSCREEN_NDS
+	// grab all input events
+	if (ioctl(pd_fd, EVIOCGRAB, 1) < 0)
+		EPRINTF("Can't get exclusive access to %s\n", TS_DEVICE_FILE);
+#endif
+
 	GdHideCursor(&scrdev);  
 	return pd_fd;
 }
@@ -71,6 +83,9 @@
  
 	if(pd_fd < 0) return;
  
+#ifdef TOUCHSCREEN_NDS
+	ioctl(pd_fd, EVIOCGRAB, 0);
+#endif
 	close(pd_fd);
 	pd_fd = -1;
 }
@@ -91,6 +106,11 @@
 {
 	struct ts_event event;
 	int bytes_read;
+#ifdef TOUCHSCREEN_NDS
+	static int pressed;
+	static int xcoord;
+	static int ycoord;
+#endif
   
 	/* read a data point */
 	bytes_read = read(pd_fd, &event, sizeof(event));
@@ -107,6 +127,28 @@
 		return 0;
 	}
 
+#ifdef TOUCHSCREEN_NDS
+	switch (event.type) {
+	case EV_SYN:
+		*px = xcoord;
+		*py = ycoord;
+		*pz = pressed ? 50 : 0;
+		*pb = pressed ? MWBUTTON_L : 0;
+		return pressed ? 2 : 3;
+	case EV_KEY:
+		if (event.code == BTN_TOUCH) 
+			pressed = event.value;
+		break;
+	case EV_ABS:
+		if (event.code == ABS_X) {
+			xcoord = event.value;
+		} else if (event.code == ABS_Y) {
+			ycoord = event.value;
+		}
+		break;
+	}
+	return 0;
+#else
 	*px = event.x;
 	*py = event.y;
 
@@ -121,6 +163,7 @@
 	if(!*pb)
 		return 3;
 	return 2;
+#endif
 }
 
 MOUSEDEVICE mousedev = {

Modified: trunk/vendors/Nintendo/DLDI/Makefile
===================================================================
--- trunk/vendors/Nintendo/DLDI/Makefile	2007-09-19 16:11:03 UTC (rev 1907)
+++ trunk/vendors/Nintendo/DLDI/Makefile	2007-09-21 10:16:30 UTC (rev 1908)
@@ -33,7 +33,7 @@
 	fb0,c,29,0\
 	fb1,c,29,1\
 	\
-	psaux,c,10,1   mouse0,c,13,32\
+	psaux,c,10,1   mouse0,c,13,32	  touch,c,13,65\
 	\
 	rom0,b,31,0    rom1,b,31,1        rom2,b,31,2      rom3,b,31,3 \
 	rom4,b,31,4    rom5,b,31,5        rom6,b,31,6      rom7,b,31,7 \

Modified: trunk/vendors/Nintendo/DLDI/config.vendor
===================================================================
--- trunk/vendors/Nintendo/DLDI/config.vendor	2007-09-19 16:11:03 UTC (rev 1907)
+++ trunk/vendors/Nintendo/DLDI/config.vendor	2007-09-21 10:16:30 UTC (rev 1908)
@@ -928,7 +928,7 @@
 # Mouse/Touch Screen
 #
 # CONFIG_USER_MICROWIN_GPMMOUSE is not set
-CONFIG_USER_MICROWIN_SERMOUSE=y
+# CONFIG_USER_MICROWIN_SERMOUSE is not set
 # CONFIG_USER_MICROWIN_TPMOUSE is not set
 # CONFIG_USER_MICROWIN_TPHELIO is not set
 # CONFIG_USER_MICROWIN_ADSMOUSE is not set
@@ -939,6 +939,7 @@
 # CONFIG_USER_MICROWIN_DE2TSMOUSE is not set
 # CONFIG_USER_MICROWIN_CLEOMOUSE is not set
 # CONFIG_USER_MICROWIN_NOMOUSE is not set
+CONFIG_USER_MICROWIN_NDSMOUSE=y
 
 #
 # Keyboard




More information about the dslinux-commit mailing list