Keyboard driver


Index: linux-2.6.26-source/drivers/input/keyboard/Kconfig
===================================================================
--- linux-2.6.26-source.orig/drivers/input/keyboard/Kconfig
+++ linux-2.6.26-source/drivers/input/keyboard/Kconfig
@@ -17,7 +17,7 @@
 	default y
 	select SERIO
 	select SERIO_LIBPS2
-	select SERIO_I8042 if X86_PC
+	select SERIO_I8042 if X86_PC && !COOPERATIVE
 	select SERIO_GSCPS2 if GSC
 	help
 	  Say Y here if you want to use a standard AT or PS/2 keyboard. Usually
Index: linux-2.6.26-source/drivers/input/keyboard/atkbd.c
===================================================================
--- linux-2.6.26-source.orig/drivers/input/keyboard/atkbd.c
+++ linux-2.6.26-source/drivers/input/keyboard/atkbd.c
@@ -28,6 +28,7 @@
 #include <linux/libps2.h>
 #include <linux/mutex.h>
 #include <linux/dmi.h>
+#include <linux/cooperative_internal.h>
 
 #define DRIVER_DESC	"AT and PS/2 keyboard driver"
 
@@ -657,6 +658,9 @@
 	struct ps2dev *ps2dev = &atkbd->ps2dev;
 	unsigned char param[2];
 
+	if (cooperative_mode_enabled())
+		return 0;
+
 /*
  * Some systems, where the bit-twiddling when testing the io-lines of the
  * controller may confuse the keyboard need a full reset of the keyboard. On
Index: linux-2.6.26-source/drivers/input/serio/Kconfig
===================================================================
--- linux-2.6.26-source.orig/drivers/input/serio/Kconfig
+++ linux-2.6.26-source/drivers/input/serio/Kconfig
@@ -21,7 +21,7 @@
 config SERIO_I8042
 	tristate "i8042 PC Keyboard controller" if EMBEDDED || !X86
 	default y
-	depends on !PARISC && (!ARM || ARCH_SHARK || FOOTBRIDGE_HOST) && !M68K && !BLACKFIN
+	depends on !PARISC && (!ARM || ARCH_SHARK || FOOTBRIDGE_HOST) && !M68K && !BLACKFIN && !COOPERATIVE
 	---help---
 	  i8042 is the chip over which the standard AT keyboard and PS/2
 	  mouse are connected to the computer. If you use these devices,
@@ -168,6 +168,7 @@
 
 config SERIO_LIBPS2
 	tristate "PS/2 driver library" if EMBEDDED
+	depends on !COOPERATIVE
 	help
 	  Say Y here if you are using a driver for device connected
 	  to a PS/2 port, such as PS/2 mouse or standard AT keyboard.
@@ -190,4 +191,9 @@
 	  To compile this driver as a module, choose M here: the
 	  module will be called serio_raw.
 
+config SERIO_COKBD
+ 	tristate "Cooperative Linux virtual keyboard controller driver"
+ 	depends on COOPERATIVE
+ 	default y
+
 endif
Index: linux-2.6.26-source/drivers/input/serio/Makefile
===================================================================
--- linux-2.6.26-source.orig/drivers/input/serio/Makefile
+++ linux-2.6.26-source/drivers/input/serio/Makefile
@@ -21,3 +21,4 @@
 obj-$(CONFIG_SERIO_MACEPS2)	+= maceps2.o
 obj-$(CONFIG_SERIO_LIBPS2)	+= libps2.o
 obj-$(CONFIG_SERIO_RAW)		+= serio_raw.o
+obj-$(CONFIG_SERIO_COKBD)	+= cokbd.o
Index: linux-2.6.26-source/drivers/char/keyboard.c
===================================================================
--- linux-2.6.26-source.orig/drivers/char/keyboard.c
+++ linux-2.6.26-source/drivers/char/keyboard.c
@@ -360,6 +360,14 @@
 	}
 }
 
+#ifdef CONFIG_COOPERATIVE
+void keyboard_inject_utf8(uint c)
+{
+	to_utf8(vc_cons[fg_console].d, c);
+}
+EXPORT_SYMBOL_GPL(keyboard_inject_utf8);
+#endif
+
 /*
  * Called after returning from RAW mode or when changing consoles - recompute
  * shift_down[] and shift_state from key_down[] maybe called when keymap is
Index: linux-2.6.26-source/include/linux/kbd_kern.h
===================================================================
--- linux-2.6.26-source.orig/include/linux/kbd_kern.h
+++ linux-2.6.26-source/include/linux/kbd_kern.h
@@ -1,3 +1,4 @@
+
 #ifndef _KBD_KERN_H
 #define _KBD_KERN_H
 
@@ -66,6 +67,7 @@
 
 extern struct kbd_struct kbd_table[];
 
+extern void keyboard_inject_utf8(uint c);
 extern int kbd_init(void);
 
 extern unsigned char getledstate(void);
