[commit] r2344 - trunk/linux-2.6.x/arch/arm/mach-nds

dslinux_sonny_jim at dslinux.in-berlin.de dslinux_sonny_jim at dslinux.in-berlin.de
Mon Aug 11 16:15:15 CEST 2008


Author: dslinux_sonny_jim
Date: Mon Aug 11 16:15:14 2008
New Revision: 2344

Log:
Adding hinge support to kernel.  Need to write a userspace program to do stuff when the hinge is activated (cat /dev/input/event0).  With help from pepsiman :-)

Modified:
   trunk/linux-2.6.x/arch/arm/mach-nds/button.c

Modified: trunk/linux-2.6.x/arch/arm/mach-nds/button.c
==============================================================================
--- trunk/linux-2.6.x/arch/arm/mach-nds/button.c	(original)
+++ trunk/linux-2.6.x/arch/arm/mach-nds/button.c	Mon Aug 11 16:15:14 2008
@@ -62,7 +62,8 @@
 	{
 		input_report_key(&ndsbutton_dev, ndsbuttons2[i], !((state >> i) & 1));
 	}
-        input_sync(&ndsbutton_dev);
+       input_report_switch(&ndsbutton_dev, SW_0, ((state >> 7 )&1)); 
+       input_sync(&ndsbutton_dev);
 }
 
 static struct fifo_cb ndsbutton_fifocb = {
@@ -81,7 +82,8 @@
 
 	*(volatile u16*) 0x04000004 |= 1 << 3 ;
 
-        ndsbutton_dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REP) ;
+        ndsbutton_dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REP) | BIT(EV_SW);
+	ndsbutton_dev.swbit[0] = BIT(SW_0);
 	for ( i = 0 ; i < (sizeof(ndsbuttons)/sizeof(ndsbuttons[0])) ; i++ )
 		ndsbutton_dev.keybit[LONG(ndsbuttons[i])] |= BIT(ndsbuttons[i]);
 	for ( i = 0 ; i < (sizeof(ndsbuttons2)/sizeof(ndsbuttons2[0])) ; i++ )


More information about the dslinux-commit mailing list