1 /* $Id: kbd-jazz.c,v 1.1 1998/10/28 12:38:10 ralf Exp $
3 * Low-level hardware access stuff for Jazz family machines.
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
9 * Copyright (C) 1995, 1996, 1997, 1998 by Ralf Baechle
11 #include <linux/sched.h>
12 #include <linux/pc_keyb.h>
13 #include <asm/keyboard.h>
16 #define jazz_kh ((keyboard_hardware *) JAZZ_KEYBOARD_ADDRESS)
18 static void jazz_request_region(void)
20 /* No I/O ports are being used on Jazz. */
23 static int jazz_request_irq(void (*handler
)(int, void *, struct pt_regs
*))
27 res
= request_irq(JAZZ_KEYBOARD_IRQ
, handler
, 0, "keyboard", NULL
);
31 /* jazz_request_irq() should do this ... */
32 r4030_write_reg16(JAZZ_IO_IRQ_ENABLE
,
33 r4030_read_reg16(JAZZ_IO_IRQ_ENABLE
)
39 static int jazz_aux_request_irq(void (*handler
)(int, void *, struct pt_regs
*))
43 ret
= request_irq(JAZZ_MOUSE_IRQ
, handler
, 0, "PS/2 Mouse", NULL
);
47 r4030_write_reg16(JAZZ_IO_IRQ_ENABLE
,
48 r4030_read_reg16(JAZZ_IO_IRQ_ENABLE
) |
53 static void jazz_aux_free_irq(void)
55 r4030_write_reg16(JAZZ_IO_IRQ_ENABLE
,
56 r4030_read_reg16(JAZZ_IO_IRQ_ENABLE
)
58 free_irq(JAZZ_MOUSE_IRQ
, NULL
);
61 static unsigned char jazz_read_input(void)
66 static void jazz_write_output(unsigned char val
)
71 status
= jazz_kh
->command
;
72 } while (status
& KBD_STAT_IBF
);
76 static void jazz_write_command(unsigned char val
)
81 status
= jazz_kh
->command
;
82 } while (status
& KBD_STAT_IBF
);
83 jazz_kh
->command
= val
;
86 static unsigned char jazz_read_status(void)
88 return jazz_kh
->command
;
91 struct kbd_ops jazz_kbd_ops
= {