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

m68k: Atari keyboard ACIA driver cleanup

m68k: Atari keyboard ACIA driver cleanup:
  - removed dead key autorepeat code
  - removed hardcoded initial keymap
Signed-off-by: default avatarMichael Schmitz <schmitz@biophys.uni-duesseldorf.de>
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 6615c5b2
/* /*
* linux/atari/atakeyb.c * linux/arch/m68k/atari/atakeyb.c
* *
* Atari Keyboard driver for 680x0 Linux * Atari Keyboard driver for 680x0 Linux
* *
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
/* /*
* Atari support by Robert de Vries * Atari support by Robert de Vries
* enhanced by Bjoern Brauel and Roman Hodek * enhanced by Bjoern Brauel and Roman Hodek
*
* 2.6 and input cleanup (removed autorepeat stuff) for 2.6.21
* 06/07 Michael Schmitz
*/ */
#include <linux/module.h> #include <linux/module.h>
...@@ -32,7 +35,6 @@ ...@@ -32,7 +35,6 @@
#include <asm/atari_joystick.h> #include <asm/atari_joystick.h>
#include <asm/irq.h> #include <asm/irq.h>
static void atakeyb_rep(unsigned long ignore);
extern unsigned int keymap_count; extern unsigned int keymap_count;
/* Hook for MIDI serial driver */ /* Hook for MIDI serial driver */
...@@ -104,25 +106,6 @@ static unsigned long broken_keys[128/(sizeof(unsigned long)*8)] = { 0, }; ...@@ -104,25 +106,6 @@ static unsigned long broken_keys[128/(sizeof(unsigned long)*8)] = { 0, };
* - Keypad Left/Right Parenthesis mapped to new K_PPAREN[LR] * - Keypad Left/Right Parenthesis mapped to new K_PPAREN[LR]
*/ */
static u_short ataplain_map[NR_KEYS] __initdata = {
0xf200, 0xf01b, 0xf031, 0xf032, 0xf033, 0xf034, 0xf035, 0xf036,
0xf037, 0xf038, 0xf039, 0xf030, 0xf02d, 0xf03d, 0xf008, 0xf009,
0xfb71, 0xfb77, 0xfb65, 0xfb72, 0xfb74, 0xfb79, 0xfb75, 0xfb69,
0xfb6f, 0xfb70, 0xf05b, 0xf05d, 0xf201, 0xf702, 0xfb61, 0xfb73,
0xfb64, 0xfb66, 0xfb67, 0xfb68, 0xfb6a, 0xfb6b, 0xfb6c, 0xf03b,
0xf027, 0xf060, 0xf700, 0xf05c, 0xfb7a, 0xfb78, 0xfb63, 0xfb76,
0xfb62, 0xfb6e, 0xfb6d, 0xf02c, 0xf02e, 0xf02f, 0xf700, 0xf200,
0xf703, 0xf020, 0xf207, 0xf100, 0xf101, 0xf102, 0xf103, 0xf104,
0xf105, 0xf106, 0xf107, 0xf108, 0xf109, 0xf200, 0xf200, 0xf114,
0xf603, 0xf200, 0xf30b, 0xf601, 0xf200, 0xf602, 0xf30a, 0xf200,
0xf600, 0xf200, 0xf115, 0xf07f, 0xf200, 0xf200, 0xf200, 0xf200,
0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
0xf200, 0xf1ff, 0xf11b, 0xf312, 0xf313, 0xf30d, 0xf30c, 0xf307,
0xf308, 0xf309, 0xf304, 0xf305, 0xf306, 0xf301, 0xf302, 0xf303,
0xf300, 0xf310, 0xf30e, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200
};
typedef enum kb_state_t { typedef enum kb_state_t {
KEYBOARD, AMOUSE, RMOUSE, JOYSTICK, CLOCK, RESYNC KEYBOARD, AMOUSE, RMOUSE, JOYSTICK, CLOCK, RESYNC
} KB_STATE_T; } KB_STATE_T;
...@@ -137,41 +120,6 @@ typedef struct keyboard_state { ...@@ -137,41 +120,6 @@ typedef struct keyboard_state {
KEYBOARD_STATE kb_state; KEYBOARD_STATE kb_state;
#define DEFAULT_KEYB_REP_DELAY (HZ/4)
#define DEFAULT_KEYB_REP_RATE (HZ/25)
/* These could be settable by some ioctl() in future... */
static unsigned int key_repeat_delay = DEFAULT_KEYB_REP_DELAY;
static unsigned int key_repeat_rate = DEFAULT_KEYB_REP_RATE;
static unsigned char rep_scancode;
static struct timer_list atakeyb_rep_timer = {
.function = atakeyb_rep,
};
static void atakeyb_rep(unsigned long ignore)
{
/* Disable keyboard for the time we call handle_scancode(), else a race
* in the keyboard tty queue may happen */
atari_disable_irq(IRQ_MFP_ACIA);
del_timer(&atakeyb_rep_timer);
/* A keyboard int may have come in before we disabled the irq, so
* double-check whether rep_scancode is still != 0 */
if (rep_scancode) {
init_timer(&atakeyb_rep_timer);
atakeyb_rep_timer.expires = jiffies + key_repeat_rate;
add_timer(&atakeyb_rep_timer);
//handle_scancode(rep_scancode, 1);
if (atari_input_keyboard_interrupt_hook)
atari_input_keyboard_interrupt_hook(rep_scancode, 1);
}
atari_enable_irq(IRQ_MFP_ACIA);
}
/* ++roman: If a keyboard overrun happened, we can't tell in general how much /* ++roman: If a keyboard overrun happened, we can't tell in general how much
* bytes have been lost and in which state of the packet structure we are now. * bytes have been lost and in which state of the packet structure we are now.
* This usually causes keyboards bytes to be interpreted as mouse movements * This usually causes keyboards bytes to be interpreted as mouse movements
...@@ -209,9 +157,6 @@ repeat: ...@@ -209,9 +157,6 @@ repeat:
/* ...happens often if interrupts were disabled for too long */ /* ...happens often if interrupts were disabled for too long */
printk(KERN_DEBUG "Keyboard overrun\n"); printk(KERN_DEBUG "Keyboard overrun\n");
scancode = acia.key_data; scancode = acia.key_data;
/* Turn off autorepeating in case a break code has been lost */
del_timer(&atakeyb_rep_timer);
rep_scancode = 0;
if (ikbd_self_test) if (ikbd_self_test)
/* During self test, don't do resyncing, just process the code */ /* During self test, don't do resyncing, just process the code */
goto interpret_scancode; goto interpret_scancode;
...@@ -281,11 +226,12 @@ repeat: ...@@ -281,11 +226,12 @@ repeat:
* make codes instead. Therefore, simply ignore * make codes instead. Therefore, simply ignore
* break_flag... * break_flag...
*/ */
int keyval = plain_map[scancode], keytyp; int keyval, keytyp;
set_bit(scancode, broken_keys); set_bit(scancode, broken_keys);
self_test_last_rcv = jiffies; self_test_last_rcv = jiffies;
keyval = plain_map[scancode]; /* new Linux scancodes; approx. */
keyval = scancode;
keytyp = KTYP(keyval) - 0xf0; keytyp = KTYP(keyval) - 0xf0;
keyval = KVAL(keyval); keyval = KVAL(keyval);
...@@ -301,19 +247,6 @@ repeat: ...@@ -301,19 +247,6 @@ repeat:
} else if (test_bit(scancode, broken_keys)) } else if (test_bit(scancode, broken_keys))
break; break;
#if 0 // FIXME; hangs at boot
if (break_flag) {
del_timer(&atakeyb_rep_timer);
rep_scancode = 0;
} else {
del_timer(&atakeyb_rep_timer);
rep_scancode = scancode;
atakeyb_rep_timer.expires = jiffies + key_repeat_delay;
add_timer(&atakeyb_rep_timer);
}
#endif
// handle_scancode(scancode, !break_flag);
if (atari_input_keyboard_interrupt_hook) if (atari_input_keyboard_interrupt_hook)
atari_input_keyboard_interrupt_hook((unsigned char)scancode, !break_flag); atari_input_keyboard_interrupt_hook((unsigned char)scancode, !break_flag);
break; break;
...@@ -639,9 +572,6 @@ int __init atari_keyb_init(void) ...@@ -639,9 +572,6 @@ int __init atari_keyb_init(void)
if (atari_keyb_done) if (atari_keyb_done)
return 0; return 0;
/* setup key map */
memcpy(key_maps[0], ataplain_map, sizeof(plain_map));
kb_state.state = KEYBOARD; kb_state.state = KEYBOARD;
kb_state.len = 0; kb_state.len = 0;
...@@ -704,26 +634,6 @@ int __init atari_keyb_init(void) ...@@ -704,26 +634,6 @@ int __init atari_keyb_init(void)
return 0; return 0;
} }
int atari_kbdrate(struct kbd_repeat *k)
{
if (k->delay > 0) {
/* convert from msec to jiffies */
key_repeat_delay = (k->delay * HZ + 500) / 1000;
if (key_repeat_delay < 1)
key_repeat_delay = 1;
}
if (k->period > 0) {
key_repeat_rate = (k->period * HZ + 500) / 1000;
if (key_repeat_rate < 1)
key_repeat_rate = 1;
}
k->delay = key_repeat_delay * 1000 / HZ;
k->period = key_repeat_rate * 1000 / HZ;
return 0;
}
int atari_kbd_translate(unsigned char keycode, unsigned char *keycodep, char raw_mode) int atari_kbd_translate(unsigned char keycode, unsigned char *keycodep, char raw_mode)
{ {
#ifdef CONFIG_MAGIC_SYSRQ #ifdef CONFIG_MAGIC_SYSRQ
......
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