summaryrefslogtreecommitdiffstats
path: root/arch/mips/sgi/kernel/setup.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-01-04 16:03:48 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-01-04 16:03:48 +0000
commit78c388aed2b7184182c08428db1de6c872d815f5 (patch)
tree4b2003b1b4ceb241a17faa995da8dd1004bb8e45 /arch/mips/sgi/kernel/setup.c
parenteb7a5bf93aaa4be1d7c6181100ab7639e74d67f7 (diff)
Merge with Linux 2.1.131 and more MIPS goodies.
(Did I mention that CVS is buggy ...)
Diffstat (limited to 'arch/mips/sgi/kernel/setup.c')
-rw-r--r--arch/mips/sgi/kernel/setup.c64
1 files changed, 46 insertions, 18 deletions
diff --git a/arch/mips/sgi/kernel/setup.c b/arch/mips/sgi/kernel/setup.c
index 99cd9946f..dd1a67bfd 100644
--- a/arch/mips/sgi/kernel/setup.c
+++ b/arch/mips/sgi/kernel/setup.c
@@ -1,10 +1,11 @@
-/* $Id: setup.c,v 1.15 1998/09/26 12:25:03 tsbogend Exp $
+/* $Id: setup.c,v 1.16 1998/10/02 22:06:11 tsbogend Exp $
*
* setup.c: SGI specific setup, including init of the feature struct.
*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
* Copyright (C) 1997, 1998 Ralf Baechle (ralf@gnu.org)
*/
+#include <linux/config.h>
#include <linux/init.h>
#include <linux/kbd_ll.h>
#include <linux/kernel.h>
@@ -13,6 +14,7 @@
#include <linux/console.h>
#include <linux/sched.h>
#include <linux/mc146818rtc.h>
+#include <linux/pc_keyb.h>
#include <asm/addrspace.h>
#include <asm/bcache.h>
@@ -28,10 +30,38 @@
extern struct rtc_ops indy_rtc_ops;
void indy_reboot_setup(void);
-static volatile struct hpc_keyb *sgi_kh = (struct hpc_keyb *) (KSEG1 + 0x1fbd9800 + 64);
+#define sgi_kh ((struct hpc_keyb *) (KSEG1 + 0x1fbd9800 + 64))
#define KBD_STAT_IBF 0x02 /* Keyboard input buffer full */
+static void sgi_request_region(void)
+{
+ /* No I/O ports are being used on the Indy. */
+}
+
+static int sgi_request_irq(void (*handler)(int, void *, struct pt_regs *))
+{
+ /* Dirty hack, this get's called as a callback from the keyboard
+ driver. We piggyback the initialization of the front panel
+ button handling on it even though they're technically not
+ related with the keyboard driver in any way. Doing it from
+ indy_setup wouldn't work since kmalloc isn't initialized yet. */
+ indy_reboot_setup();
+
+ return request_irq(SGI_KEYBOARD_IRQ, handler, 0, "keyboard", NULL);
+}
+
+static int sgi_aux_request_irq(void (*handler)(int, void *, struct pt_regs *))
+{
+ /* Nothing to do, interrupt is shared with the keyboard hw */
+ return 0;
+}
+
+static void sgi_aux_free_irq(void)
+{
+ /* Nothing to do, interrupt is shared with the keyboard hw */
+}
+
static unsigned char sgi_read_input(void)
{
return sgi_kh->data;
@@ -62,23 +92,18 @@ static unsigned char sgi_read_status(void)
return sgi_kh->command;
}
-__initfunc(static void sgi_keyboard_setup(void))
-{
- kbd_read_input = sgi_read_input;
- kbd_write_output = sgi_write_output;
- kbd_write_command = sgi_write_command;
- kbd_read_status = sgi_read_status;
+struct kbd_ops sgi_kbd_ops = {
+ sgi_request_region,
+ sgi_request_irq,
- request_irq(SGI_KEYBOARD_IRQ, keyboard_interrupt,
- 0, "keyboard", NULL);
+ sgi_aux_request_irq,
+ sgi_aux_free_irq,
- /* Dirty hack, this get's called as a callback from the keyboard
- driver. We piggyback the initialization of the front panel
- button handling on it even though they're technically not
- related with the keyboard driver in any way. Doing it from
- indy_setup wouldn't work since kmalloc isn't initialized yet. */
- indy_reboot_setup();
-}
+ sgi_read_input,
+ sgi_write_output,
+ sgi_write_command,
+ sgi_read_status
+};
__initfunc(static void sgi_irq_setup(void))
{
@@ -92,7 +117,6 @@ __initfunc(void sgi_setup(void))
#endif
irq_setup = sgi_irq_setup;
- keyboard_setup = sgi_keyboard_setup;
/* Init the INDY HPC I/O controller. Need to call this before
* fucking with the memory controller because it needs to know the
@@ -124,4 +148,8 @@ __initfunc(void sgi_setup(void))
conswitchp = &newport_con;
#endif
rtc_ops = &indy_rtc_ops;
+ kbd_ops = &sgi_kbd_ops;
+#ifdef CONFIG_PSMOUSE
+ aux_device_present = 0xaa;
+#endif
}