Date: Mon, 16 Jun 1997 23:56:30 +0200 (MET DST)
From: Geert Uytterhoeven <Geert.Uytterhoeven@thomas.kotnet.org>
To: Linux/m68k <linux-m68k@phil.uni-sb.de>
Subject: L68K: amikeyb.c and Ctrl-Amiga-Amiga
Sender: owner-linux-m68k@phil.uni-sb.de
Reply-To: Geert Uytterhoeven <Geert.Uytterhoeven@cs.kuleuven.ac.be>


Since there are no useful things to do after a reset warning
(Ctrl-Amiga-Amiga), I commented out that piece of code. I also added a very
tiny optimization.

--- linux-2.1.42/arch/m68k/amiga/amikeyb.c.orig	Sat May 31 15:48:41 1997
+++ linux-2.1.42/arch/m68k/amiga/amikeyb.c	Sun Jun 15 20:00:24 1997
@@ -198,7 +198,7 @@
 
 static void keyboard_interrupt(int irq, void *dummy, struct pt_regs *fp)
 {
-    unsigned char scancode, break_flag;
+    unsigned char scancode, break_flag, keycode;
     static int reset_warning = 0;
 
     /* save frame for register dump */
@@ -210,6 +210,7 @@
     /* switch SP pin to output for handshake */
     ciaa.cra |= 0x40;
 
+#if 0 // No longer used
     /*
      *  On receipt of the second RESET_WARNING, we must not pull KDAT high
      *  again to delay the hard reset as long as possible.
@@ -225,6 +226,7 @@
 	} else
 	    /* Probably a mistake, cancel the alert */
 	    reset_warning = 0;
+#endif
 
     /* wait until 85 us have expired */
     udelay(85);
@@ -240,27 +242,27 @@
      * Check make/break first
      */
     break_flag = scancode & BREAK_MASK;
-    scancode &= (unsigned char )~BREAK_MASK;
+    keycode = scancode & (unsigned char)~BREAK_MASK;
 
-    if (scancode == AMIKEY_CAPS) {
+    if (keycode == AMIKEY_CAPS) {
 	/* if the key is CAPS, fake a press/release. */
 	handle_scancode(AMIKEY_CAPS);
 	handle_scancode(BREAK_MASK | AMIKEY_CAPS);
-    } else if (scancode < 0x78) {
+    } else if (keycode < 0x78) {
 	/* handle repeat */
 	if (break_flag) {
 	    del_timer(&amikeyb_rep_timer);
 	    rep_scancode = 0;
 	} else {
 	    del_timer(&amikeyb_rep_timer);
-	    rep_scancode = scancode;
+	    rep_scancode = keycode;
 	    amikeyb_rep_timer.expires = jiffies + key_repeat_delay;
 	    amikeyb_rep_timer.prev = amikeyb_rep_timer.next = NULL;
 	    add_timer(&amikeyb_rep_timer);
 	}
-	handle_scancode(break_flag | scancode);
+	handle_scancode(scancode);
     } else
-	switch (scancode) {
+	switch (keycode) {
 	    case 0x78:
 		reset_warning = 1;
 		break;
@@ -291,7 +293,7 @@
 #endif
 	    default:
 		printk(KERN_WARNING "amikeyb: unknown keyboard communication code 0x%02x\n",
-		       break_flag | scancode);
+		       scancode);
 		break;
 	}
 }


Greetings,

						Geert

--
Geert Uytterhoeven                   Geert.Uytterhoeven@thomas.kotnet.org
Linux/m68k on Amiga, Wavelets        http://www.cs.kuleuven.ac.be/~geert/
KotNET@Thomas Network Administration -- Make you bed part of Cyberspace!!


