Commit e8d3c294 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

[PATCH] M68k input drivers cleanup

M68k input drivers cleanup:
  - Remove remnants from the old input layer:
      o Config.help entries for the Amiga and Atari mouse drivers
      o Apollo keyboard code (including beep support)
      o Dummy keyboard initialization, keyboard repeat, and keyboard LEDs code
        for MVME147, Sun-3, Sun-3x,
      o Makefile entries for Atari keyboard, mouse and joystick drivers, and
        the HP300 Human Interface Loop driver
      o kbd-reset kernel command line parameters
      o defconfig entry for the Amiga mouse driver
      o Mac ADB mouse driver glue
      o Amiga and Mac ADB mouse driver minors
  - Always include new input layer configuration data
parent 0bbb88f0
......@@ -647,9 +647,7 @@ source "drivers/block/Kconfig"
source "drivers/md/Kconfig"
if MAC
source "drivers/input/Kconfig"
endif
menu "ATA/ATAPI/MFM/RLL device support"
......@@ -1800,51 +1798,6 @@ config NVRAM
The module will be called nvram.o. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
config AMIGAMOUSE
tristate "Amiga mouse support"
depends on AMIGA
help
If you want to be able to use an Amiga mouse in Linux, say Y.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module is called amigamouse.o. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
config BUSMOUSE
bool
depends on SUN3X_ZS || ATARI && VT && ATARIMOUSE || AMIGA && AMIGAMOUSE
default y
---help---
Say Y here if your machine has a bus mouse as opposed to a serial
mouse. Most people have a regular serial MouseSystem or
Microsoft mouse (made by Logitech) that plugs into a COM port
(rectangular with 9 or 25 pins). These people say N here.
If you have a laptop, you either have to check the documentation or
experiment a bit to find out whether the trackball is a serial mouse
or not; it's best to say Y here for you.
This is the generic bus mouse driver code. If you have a bus mouse,
you will have to say Y here and also to the specific driver for your
mouse below.
This code is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called busmouse.o. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
config ATARIMOUSE
tristate "Atari mouse support"
depends on ATARI && VT
help
If you want to be able to use an Atari mouse in Linux, say Y.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module is called atarimouse.o. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
config ATARI_MFPSER
tristate "Atari MFP serial support"
depends on ATARI
......
......@@ -26,8 +26,6 @@ u_long timer_physaddr;
u_long apollo_model;
extern void dn_sched_init(void (*handler)(int,void *,struct pt_regs *));
extern int dn_keyb_init(void);
extern int dn_dummy_kbdrate(struct kbd_repeat *);
extern void dn_init_IRQ(void);
extern int dn_request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *), unsigned long flags, const char *devname, void *dev_id);
extern void dn_free_irq(unsigned int irq, void *dev_id);
......@@ -37,7 +35,6 @@ extern int show_dn_interrupts(struct seq_file *, void *);
extern unsigned long dn_gettimeoffset(void);
extern int dn_dummy_hwclk(int, struct rtc_time *);
extern int dn_dummy_set_clock_mmss(unsigned long);
extern void dn_mksound(unsigned int count, unsigned int ticks);
extern void dn_dummy_reset(void);
extern void dn_dummy_waitbut(void);
extern struct fb_info *dn_fb_init(long *);
......@@ -165,10 +162,6 @@ void config_apollo(void) {
dn_setup_model();
mach_sched_init=dn_sched_init; /* */
#ifdef CONFIG_VT
mach_keyb_init=dn_keyb_init;
mach_kbdrate=dn_dummy_kbdrate;
#endif
mach_init_IRQ=dn_init_IRQ;
mach_default_handler=NULL;
mach_request_irq = dn_request_irq;
......@@ -189,9 +182,6 @@ void config_apollo(void) {
#ifdef CONFIG_DUMMY_CONSOLE
conswitchp = &dummy_con;
#endif
#ifdef CONFIG_VT
kd_mksound = dn_mksound;
#endif
#ifdef CONFIG_HEARTBEAT
mach_heartbeat = dn_heartbeat;
#endif
......
......@@ -117,35 +117,6 @@ struct fb_info *dn_dummy_fb_init(long *mem_start) {
}
#ifdef CONFIG_VT
extern void write_keyb_cmd(u_short length, u_char *cmd);
static char BellOnCommand[] = { 0xFF, 0x21, 0x81 },
BellOffCommand[] = { 0xFF, 0x21, 0x82 };
static void dn_nosound (unsigned long ignored) {
write_keyb_cmd(sizeof(BellOffCommand),BellOffCommand);
}
void dn_mksound( unsigned int count, unsigned int ticks ) {
static struct timer_list sound_timer = { function: dn_nosound };
del_timer( &sound_timer );
if(count) {
write_keyb_cmd(sizeof(BellOnCommand),BellOnCommand);
if (ticks) {
sound_timer.expires = jiffies + ticks;
add_timer( &sound_timer );
}
}
else
write_keyb_cmd(sizeof(BellOffCommand),BellOffCommand);
}
#endif /* CONFIG_VT */
void dn_dummy_video_setup(char *options,int *ints) {
printk("no video yet\n");
......
......@@ -7,8 +7,6 @@ export-objs := atari_ksyms.o
obj-y := config.o time.o debug.o ataints.o stdma.o \
atasound.o stram.o atari_ksyms.o
obj-$(CONFIG_VT) += atakeyb.o joystick.o
ifeq ($(CONFIG_PCI),y)
obj-$(CONFIG_HADES) += hades-pci.o
endif
......
......@@ -186,7 +186,6 @@ CONFIG_NETDEVICES=y
#
CONFIG_VT=y
CONFIG_VT_CONSOLE=y
CONFIG_AMIGAMOUSE=y
CONFIG_BUSMOUSE=y
CONFIG_AMIGA_BUILTIN_SERIAL=y
# CONFIG_GVPIOEXT is not set
......
......@@ -4,6 +4,4 @@
obj-y := ksyms.o config.o ints.o time.o reboot.o
obj-$(CONFIG_VT) += hil.o
include $(TOPDIR)/Rules.make
......@@ -537,11 +537,6 @@ void __init floppy_setup(char *str, int *ints)
#endif
/* for "kbd-reset" cmdline param */
void __init kbd_reset_setup(char *str, int *ints)
{
}
void check_bugs(void)
{
#ifndef CONFIG_M68KFPU_EMU
......
......@@ -181,11 +181,6 @@ int mvme147_set_clock_mmss (unsigned long nowtime)
return 0;
}
int mvme147_keyb_init (void)
{
return 0;
}
/*------------------- Serial console stuff ------------------------*/
static void scc_delay (void)
......
......@@ -151,9 +151,6 @@ void __init config_sun3(void)
mach_default_handler = &sun3_default_handler;
mach_request_irq = sun3_request_irq;
mach_free_irq = sun3_free_irq;
#ifdef CONFIG_VT
// mach_keyb_init = sun3_keyb_init;
#endif
enable_irq = sun3_enable_irq;
disable_irq = sun3_disable_irq;
mach_process_int = sun3_process_int;
......
......@@ -24,21 +24,6 @@ volatile char *clock_va;
extern volatile unsigned char *sun3_intreg;
int __init sun3x_keyb_init(void)
{
return 0;
}
int sun3x_kbdrate(struct kbd_repeat *r)
{
return 0;
}
void sun3x_kbd_leds(unsigned int i)
{
}
void sun3_leds(unsigned int i)
{
......@@ -61,12 +46,6 @@ void __init config_sun3x(void)
mach_get_irq_list = show_sun3_interrupts;
mach_max_dma_address = 0xffffffff; /* we can DMA anywhere, whee */
#ifdef CONFIG_VT
mach_keyb_init = sun3x_keyb_init;
mach_kbdrate = sun3x_kbdrate;
mach_kbd_leds = sun3x_kbd_leds;
#endif
mach_default_handler = &sun3_default_handler;
mach_sched_init = sun3x_sched_init;
mach_init_IRQ = sun3_init_IRQ;
......
......@@ -73,7 +73,6 @@ CONFIG_GEN_RTC=y
CONFIG_FB_CONSOLE=y
CONFIG_AMIGA=y
CONFIG_ZORRO=y
CONFIG_AMIGAMOUSE=y
CONFIG_ABSTRACT_CONSOLE=y
CONFIG_FB=y
CONFIG_MOUSE=y
......
......@@ -57,7 +57,6 @@ obj-$(CONFIG_DTLK) += dtlk.o
obj-$(CONFIG_R3964) += n_r3964.o
obj-$(CONFIG_APPLICOM) += applicom.o
obj-$(CONFIG_SONYPI) += sonypi.o
obj-$(CONFIG_ATARIMOUSE) += atarimouse.o
obj-$(CONFIG_RTC) += rtc.o
obj-$(CONFIG_GEN_RTC) += genrtc.o
obj-$(CONFIG_EFI_RTC) += efirtc.o
......
......@@ -247,14 +247,6 @@ static void init_turbomouse(int id);
static void init_microspeed(int id);
static void init_ms_a3(int id);
#ifdef CONFIG_ADBMOUSE
/* XXX: Hook for mouse driver */
void (*adb_mouse_interrupt_hook)(unsigned char *, int);
int adb_emulate_buttons = 0;
int adb_button2_keycode = 0x7d; /* right control key */
int adb_button3_keycode = 0x7c; /* right option key */
#endif
extern struct kbd_struct kbd_table[];
extern void handle_scancode(unsigned char, int);
......@@ -342,38 +334,6 @@ input_keycode(int keycode, int repeat)
if (!repeat)
del_timer(&repeat_timer);
#ifdef CONFIG_ADBMOUSE
/*
* XXX: Add mouse button 2+3 fake codes here if mouse open.
* Keep track of 'button' states here as we only send
* single up/down events!
* Really messy; might need to check if keyboard is in
* VC_RAW mode.
* Might also want to know how many buttons need to be emulated.
* -> hide this as function in arch/m68k/mac ?
*/
if (adb_emulate_buttons
&& (keycode == adb_button2_keycode
|| keycode == adb_button3_keycode)
&& (adb_mouse_interrupt_hook || console_loglevel == 10)) {
int button;
/* faked ADB packet */
static unsigned char data[4] = { 0, 0x80, 0x80, 0x80 };
button = keycode == adb_button2_keycode? 2: 3;
if (data[button] != up_flag) {
/* send a fake mouse packet */
data[button] = up_flag;
if (console_loglevel >= 8)
printk("fake mouse event: %x %x %x\n",
data[1], data[2], data[3]);
if (adb_mouse_interrupt_hook)
adb_mouse_interrupt_hook(data, 4);
}
return;
}
#endif /* CONFIG_ADBMOUSE */
if (kbd->kbdmode != VC_RAW) {
if (!up_flag && !dont_repeat[keycode]) {
last_keycode = keycode;
......@@ -428,163 +388,6 @@ static void mac_put_queue(int ch)
}
}
#ifdef CONFIG_ADBMOUSE
static void
mouse_input(unsigned char *data, int nb, struct pt_regs *regs, int autopoll)
{
/* [ACA:23-Mar-97] Three button mouse support. This is designed to
function with MkLinux DR-2.1 style X servers. It only works with
three-button mice that conform to Apple's multi-button mouse
protocol. */
/*
The X server for MkLinux DR2.1 uses the following unused keycodes to
read the mouse:
0x7e This indicates that the next two keycodes should be interpreted
as mouse information. The first following byte's high bit
represents the state of the left button. The lower seven bits
represent the x-axis acceleration. The lower seven bits of the
second byte represent y-axis acceleration.
0x3f The x server interprets this keycode as a middle button
release.
0xbf The x server interprets this keycode as a middle button
depress.
0x40 The x server interprets this keycode as a right button
release.
0xc0 The x server interprets this keycode as a right button
depress.
NOTES: There should be a better way of handling mice in the X server.
The MOUSE_ESCAPE code (0x7e) should be followed by three bytes instead
of two. The three mouse buttons should then, in the X server, be read
as the high-bits of all three bytes. The x and y motions can still be
in the first two bytes. Maybe I'll do this...
*/
/*
Handler 1 -- 100cpi original Apple mouse protocol.
Handler 2 -- 200cpi original Apple mouse protocol.
For Apple's standard one-button mouse protocol the data array will
contain the following values:
BITS COMMENTS
data[0] = dddd 1100 ADB command: Talk, register 0, for device dddd.
data[1] = bxxx xxxx First button and x-axis motion.
data[2] = byyy yyyy Second button and y-axis motion.
Handler 4 -- Apple Extended mouse protocol.
For Apple's 3-button mouse protocol the data array will contain the
following values:
BITS COMMENTS
data[0] = dddd 1100 ADB command: Talk, register 0, for device dddd.
data[1] = bxxx xxxx Left button and x-axis motion.
data[2] = byyy yyyy Second button and y-axis motion.
data[3] = byyy bxxx Third button and fourth button. Y is additional
high bits of y-axis motion. XY is additional
high bits of x-axis motion.
MacAlly 2-button mouse protocol.
For MacAlly 2-button mouse protocol the data array will contain the
following values:
BITS COMMENTS
data[0] = dddd 1100 ADB command: Talk, register 0, for device dddd.
data[1] = bxxx xxxx Left button and x-axis motion.
data[2] = byyy yyyy Right button and y-axis motion.
data[3] = ???? ???? unknown
data[4] = ???? ???? unknown
*/
struct kbd_struct *kbd;
/* If it's a trackpad, we alias the second button to the first.
NOTE: Apple sends an ADB flush command to the trackpad when
the first (the real) button is released. We could do
this here using async flush requests.
*/
switch (adb_mouse_kinds[(data[0]>>4) & 0xf])
{
case ADBMOUSE_TRACKPAD:
data[1] = (data[1] & 0x7f) | ((data[1] & data[2]) & 0x80);
data[2] = data[2] | 0x80;
break;
case ADBMOUSE_MICROSPEED:
data[1] = (data[1] & 0x7f) | ((data[3] & 0x01) << 7);
data[2] = (data[2] & 0x7f) | ((data[3] & 0x02) << 6);
data[3] = (data[3] & 0x77) | ((data[3] & 0x04) << 5)
| (data[3] & 0x08);
break;
case ADBMOUSE_TRACKBALLPRO:
data[1] = (data[1] & 0x7f) | (((data[3] & 0x04) << 5)
& ((data[3] & 0x08) << 4));
data[2] = (data[2] & 0x7f) | ((data[3] & 0x01) << 7);
data[3] = (data[3] & 0x77) | ((data[3] & 0x02) << 6);
break;
case ADBMOUSE_MS_A3:
data[1] = (data[1] & 0x7f) | ((data[3] & 0x01) << 7);
data[2] = (data[2] & 0x7f) | ((data[3] & 0x02) << 6);
data[3] = ((data[3] & 0x04) << 5);
break;
case ADBMOUSE_MACALLY2:
data[3] = (data[2] & 0x80) ? 0x80 : 0x00;
data[2] |= 0x80; /* Right button is mapped as button 3 */
nb=4;
break;
}
if (adb_mouse_interrupt_hook)
adb_mouse_interrupt_hook(data, nb);
kbd = kbd_table + fg_console;
/* Only send mouse codes when keyboard is in raw mode. */
if (kbd->kbdmode == VC_RAW) {
static unsigned char uch_ButtonStateSecond = 0x80;
unsigned char uchButtonSecond;
/* Send first button, second button and movement. */
mac_put_queue(0x7e);
mac_put_queue(data[1]);
mac_put_queue(data[2]);
/* [ACA: Are there any two-button ADB mice that use handler 1 or 2?] */
/* Store the button state. */
uchButtonSecond = (data[2] & 0x80);
/* Send second button. */
if (uchButtonSecond != uch_ButtonStateSecond) {
mac_put_queue(0x3f | uchButtonSecond);
uch_ButtonStateSecond = uchButtonSecond;
}
/* Macintosh 3-button mouse (handler 4). */
if (nb >= 4) {
static unsigned char uch_ButtonStateThird = 0x80;
unsigned char uchButtonThird;
/* Store the button state for speed. */
uchButtonThird = (data[3] & 0x80);
/* Send third button. */
if (uchButtonThird != uch_ButtonStateThird) {
mac_put_queue(0x40 | uchButtonThird);
uch_ButtonStateThird = uchButtonThird;
}
}
}
}
#endif /* CONFIG_ADBMOUSE */
static void
buttons_input(unsigned char *data, int nb, struct pt_regs *regs, int autopoll)
{
......@@ -708,11 +511,6 @@ void __init mackbd_init_hw(void)
memcpy(key_maps[8], macalt_map, sizeof(plain_map));
memcpy(key_maps[12], macctrl_alt_map, sizeof(plain_map));
#ifdef CONFIG_ADBMOUSE
/* initialize mouse interrupt hook */
adb_mouse_interrupt_hook = NULL;
#endif
led_request.complete = 1;
mackeyb_probe();
......@@ -752,10 +550,6 @@ mackeyb_probe(void)
struct adb_request req;
int i;
#ifdef CONFIG_ADBMOUSE
adb_register(ADB_MOUSE, 0, &mouse_ids, mouse_input);
#endif /* CONFIG_ADBMOUSE */
adb_register(ADB_KEYBOARD, 0, &keyboard_ids, keyboard_input);
adb_register(0x07, 0x1F, &buttons_ids, buttons_input);
......
......@@ -7,12 +7,12 @@
#define PSMOUSE_MINOR 1
#define MS_BUSMOUSE_MINOR 2
#define ATIXL_BUSMOUSE_MINOR 3
#define AMIGAMOUSE_MINOR 4
/*#define AMIGAMOUSE_MINOR 4 FIXME OBSOLETE */
#define ATARIMOUSE_MINOR 5
#define SUN_MOUSE_MINOR 6
#define APOLLO_MOUSE_MINOR 7
#define PC110PAD_MINOR 9
#define ADB_MOUSE_MINOR 10
/*#define ADB_MOUSE_MINOR 10 FIXME OBSOLETE */
#define WATCHDOG_MINOR 130 /* Watchdog timer */
#define TEMP_MINOR 131 /* Temperature Sensor */
#define RTC_MINOR 135
......
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