Commit 3b168e68 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

[PATCH] M68k update (part 36)

Q40/Q60 keyboard updates
  - Ignore illegal scancodes
  - Remove unused q40kbd_leds()
  - Fix return type and return value of q40kbd_init_hw()
parent 52922341
...@@ -31,9 +31,6 @@ ...@@ -31,9 +31,6 @@
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/q40ints.h> #include <asm/q40ints.h>
/* Some configuration switches are present in the include file... */
#define KBD_REPORT_ERR
/* Simple translation table for the SysRq keys */ /* Simple translation table for the SysRq keys */
...@@ -215,7 +212,6 @@ static unsigned char e0_keys[128] = { ...@@ -215,7 +212,6 @@ static unsigned char e0_keys[128] = {
0, 0, 0, 0, 0, 0, 0, 0 /* 0x78-0x7f */ 0, 0, 0, 0, 0, 0, 0, 0 /* 0x78-0x7f */
}; };
static unsigned int prev_scancode = 0; /* remember E0, E1 */
int q40kbd_setkeycode(unsigned int scancode, unsigned int keycode) int q40kbd_setkeycode(unsigned int scancode, unsigned int keycode)
{ {
...@@ -246,10 +242,21 @@ int q40kbd_getkeycode(unsigned int scancode) ...@@ -246,10 +242,21 @@ int q40kbd_getkeycode(unsigned int scancode)
int q40kbd_translate(unsigned char scancode, unsigned char *keycode, int q40kbd_translate(unsigned char scancode, unsigned char *keycode,
char raw_mode) char raw_mode)
{ {
if (scancode == 0xe0 || scancode == 0xe1) { static int prev_scancode;
/* special prefix scancodes.. */
if (scancode == 0xe0 || scancode == 0xe1) {
prev_scancode = scancode; prev_scancode = scancode;
return 0; return 0;
} }
/* 0xFF is sent by a few keyboards, ignore it. 0x00 is error */
if (scancode == 0x00 || scancode == 0xff) {
prev_scancode = 0;
return 0;
}
scancode &= 0x7f;
if (prev_scancode) { if (prev_scancode) {
/* /*
...@@ -408,8 +415,6 @@ static int __init kbd_read_input(void) ...@@ -408,8 +415,6 @@ static int __init kbd_read_input(void)
return retval; return retval;
} }
extern void q40kbd_leds(unsigned char leds)
{ /* nothing can be done */ }
static void __init kbd_clear_input(void) static void __init kbd_clear_input(void)
{ {
...@@ -422,12 +427,9 @@ static void __init kbd_clear_input(void) ...@@ -422,12 +427,9 @@ static void __init kbd_clear_input(void)
} }
void __init q40kbd_init_hw(void) int __init q40kbd_init_hw(void)
{ {
#if 0
/* Get the keyboard controller registers (incomplete decode) */
request_region(0x60, 16, "keyboard");
#endif
/* Flush any pending input. */ /* Flush any pending input. */
kbd_clear_input(); kbd_clear_input();
...@@ -436,5 +438,6 @@ void __init q40kbd_init_hw(void) ...@@ -436,5 +438,6 @@ void __init q40kbd_init_hw(void)
master_outb(-1,KEYBOARD_UNLOCK_REG); master_outb(-1,KEYBOARD_UNLOCK_REG);
master_outb(1,KEY_IRQ_ENABLE_REG); master_outb(1,KEY_IRQ_ENABLE_REG);
return 0;
} }
...@@ -20,7 +20,7 @@ extern int q40kbd_translate(unsigned char scancode, unsigned char *keycode, ...@@ -20,7 +20,7 @@ extern int q40kbd_translate(unsigned char scancode, unsigned char *keycode,
extern char q40kbd_unexpected_up(unsigned char keycode); extern char q40kbd_unexpected_up(unsigned char keycode);
extern void q40kbd_leds(unsigned char leds); extern void q40kbd_leds(unsigned char leds);
extern int q40kbd_is_sysrq(unsigned char keycode); extern int q40kbd_is_sysrq(unsigned char keycode);
extern void q40kbd_init_hw(void); extern int q40kbd_init_hw(void);
extern unsigned char q40kbd_sysrq_xlate[128]; extern unsigned char q40kbd_sysrq_xlate[128];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment