patch-2.4.0-test12 linux/drivers/char/amikeyb.c

Next file: linux/drivers/char/applicom.c
Previous file: linux/drivers/char/amigamouse.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test11/linux/drivers/char/amikeyb.c linux/drivers/char/amikeyb.c
@@ -12,6 +12,7 @@
  * Amiga support by Hamish Macdonald
  */
 
+#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/sched.h>
 #include <linux/interrupt.h>
@@ -23,6 +24,7 @@
 #include <linux/timer.h>
 #include <linux/random.h>
 #include <linux/kernel.h>
+#include <linux/ioport.h>
 #include <linux/init.h>
 #include <linux/kbd_kern.h>
 
@@ -186,7 +188,6 @@
 
     kbd_pt_regs = NULL;
 
-    init_timer(&amikeyb_rep_timer);
     amikeyb_rep_timer.expires = jiffies + key_repeat_rate;
     add_timer(&amikeyb_rep_timer);
     handle_scancode(rep_scancode, 1);
@@ -254,7 +255,6 @@
 	} else {
 	    del_timer(&amikeyb_rep_timer);
 	    rep_scancode = keycode;
-	    init_timer(&amikeyb_rep_timer);
 	    amikeyb_rep_timer.expires = jiffies + key_repeat_delay;
 	    add_timer(&amikeyb_rep_timer);
 	}
@@ -300,6 +300,8 @@
 {
     if (!AMIGAHW_PRESENT(AMI_KEYBOARD))
         return -EIO;
+    if (!request_mem_region(CIAA_PHYSADDR-1+0xb00, 0x100, "amikeyb"))
+	return -EBUSY;
 
     /* setup key map */
     memcpy(key_maps[0], amiplain_map, sizeof(plain_map));
@@ -342,3 +344,16 @@
     
     return( 0 );
 }
+
+int amiga_kbd_translate(unsigned char keycode, unsigned char *keycodep, char raw_mode)
+{
+#ifdef CONFIG_MAGIC_SYSRQ
+        /* SHIFT+ALTGR+HELP pressed? */
+        if ((keycode == 0x5f) && ((shift_state & 0xff) == 3))
+                *keycodep = 0xff;
+        else
+#endif
+                *keycodep = keycode;
+        return 1;
+}
+

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)