diff U3b /uClinux-dist-test/linux-2.6.x/drivers/char/scan_keyb.c /wipe/linux-2.6.x/drivers/char/scan_keyb.c
--- /uClinux-dist-test/linux-2.6.x/drivers/char/scan_keyb.c	Thu Feb 28 00:02:22 2002
+++ /wipe/linux-2.6.x/drivers/char/scan_keyb.c	Wed Jul 05 15:23:06 2006
@@ -4,22 +4,13 @@
  *	Generic scan keyboard driver
  */
 
-#include <linux/spinlock.h>
-#include <linux/sched.h>
-#include <linux/interrupt.h>
-#include <linux/tty.h>
-#include <linux/mm.h>
-#include <linux/signal.h>
+#include <linux/module.h>
 #include <linux/init.h>
-#include <linux/kbd_ll.h>
 #include <linux/delay.h>
-#include <linux/random.h>
-#include <linux/poll.h>
-#include <linux/miscdevice.h>
-#include <linux/slab.h>
-#include <linux/kbd_kern.h>
+#include <linux/input.h>
 #include <linux/timer.h>
 
+
 #define SCANHZ	(HZ/20)
 
 struct scan_keyboard {
@@ -32,13 +23,15 @@
 
 static int scan_jiffies=0;
 static struct scan_keyboard *keyboards=NULL;
-struct timer_list scan_timer;
+static struct timer_list scan_timer;
+
+static struct input_dev *scankbd_dev;
 
 static void check_kbd(const unsigned char *table,
 		      unsigned char *new, unsigned char *old, int length)
 {
-	int need_tasklet_schedule=0;
 	unsigned int xor, bit;
+	int need_tasklet_schedule=0;
 	
 	while(length-->0) {
 		if((xor=*new^*old)==0) {
@@ -47,8 +40,8 @@
 		else {
 			for(bit=0x01; bit<0x100; bit<<=1) {
 				if(xor&bit) {
-					handle_scancode(*table, !(*new&bit));
-					need_tasklet_schedule=1;
+					input_report_key(scankbd_dev, *table, !(*new&bit));
+					need_tasklet_schedule = 1;
 #if 0
 					printk("0x%x %s\n", *table, (*new&bit)?"released":"pressed");
 #endif
@@ -58,9 +51,8 @@
 		}
 		new++; old++;
 	}
-
 	if(need_tasklet_schedule)
-		tasklet_schedule(&keyboard_tasklet);
+		input_sync(scankbd_dev);
 }
 
 
@@ -87,20 +79,16 @@
 		}
 		
 	}
-
-	init_timer(&scan_timer);
-	scan_timer.expires = jiffies + SCANHZ;
-	scan_timer.data = 0;
-	scan_timer.function = scan_kbd;
-	add_timer(&scan_timer);
+	mod_timer(&scan_timer, jiffies + SCANHZ);
 }
 
 
-int register_scan_keyboard(int (*scan)(unsigned char *buffer),
+int __init register_scan_keyboard(int (*scan)(unsigned char *buffer),
 			   const unsigned char *table,
 			   int length)
 {
 	struct scan_keyboard *kbd;
+	int i;
 
 	kbd = kmalloc(sizeof(struct scan_keyboard), GFP_KERNEL);
 	if (kbd == NULL)
@@ -118,27 +106,32 @@
 	if (kbd->s1 == NULL)
 		goto error_free_s0;
 
+
 	memset(kbd->s0, -1, kbd->length);
 	memset(kbd->s1, -1, kbd->length);
 	
 	kbd->next=keyboards;
 	keyboards=kbd;
 
-	return 0;
-
- error_free_s0:
-	kfree(kbd->s0);
+	scankbd_dev = input_allocate_device();
+	if(scankbd_dev != NULL)
+	{
+		scankbd_dev->evbit[0] = BIT(EV_KEY);
+		scankbd_dev->keycode = table;
+		scankbd_dev->keycodesize = sizeof(unsigned char);
+		scankbd_dev->keycodemax = length * 8;
+	
+		for(i = 0; i < length * 8; i++)
+			if(table[i])
+				set_bit(table[i], scankbd_dev->keybit);
 
- error_free_kbd:
-	kfree(kbd);
-
- error_out:
-	return -ENOMEM;
-}
+		scankbd_dev->name = "Generic scan keyboard";
+		scankbd_dev->phys = "kbd/input0";
 			      
+		input_register_device(scankbd_dev);
 			      
-void __init scan_kbd_init(void)
-{
+		if(kbd->next == NULL)
+		{
 	init_timer(&scan_timer);
 	scan_timer.expires = jiffies + SCANHZ;
 	scan_timer.data = 0;
@@ -146,4 +139,20 @@
 	add_timer(&scan_timer);
 
 	printk(KERN_INFO "Generic scan keyboard driver initialized\n");
+		}
+
+		return 0;
+	}
+	else
+		kfree(kbd->s1);
+
+
+ error_free_s0:
+	kfree(kbd->s0);
+
+ error_free_kbd:
+	kfree(kbd);
+
+ error_out:
+	return -ENOMEM;
 }
diff U3b /Clinux-dist-test/linux-2.6.x/drivers/char/scan_keyb.h /wipe/linux-2.6.x/drivers/char/scan_keyb.h
--- /uClinux-dist-test/linux-2.6.x/drivers/char/scan_keyb.h	Thu Feb 28 00:02:22 2002
+++ /wipe/linux-2.6.x/drivers/char/scan_keyb.h	Wed Jul 05 15:24:33 2006
@@ -10,6 +10,4 @@
 			   const unsigned char *table,
 			   int length);
 
-void __init scan_kbd_init(void);
-
 #endif
