1 /*
2  * linux/include/asm-arm/arch-shark/keyboard.h
3  * by Alexander Schulz
4  *
5  * Derived from linux/include/asm-arm/arch-ebsa285/keyboard.h
6  * (C) 1998 Russell King
7  * (C) 1998 Phil Blundell
8  */
9 #include <linux/config.h>
10 #include <linux/ioport.h>
11 #include <asm/irq.h>
12 #include <asm/io.h>
13 #include <asm/system.h>
14 
15 #define KEYBOARD_IRQ			IRQ_ISA_KEYBOARD
16 #define NR_SCANCODES			128
17 
18 #define kbd_disable_irq()		do { } while (0)
19 #define kbd_enable_irq()		do { } while (0)
20 
21 extern int pckbd_setkeycode(unsigned int scancode, unsigned int keycode);
22 extern int pckbd_getkeycode(unsigned int scancode);
23 extern int pckbd_translate(unsigned char scancode, unsigned char *keycode,
24 			   char raw_mode);
25 extern char pckbd_unexpected_up(unsigned char keycode);
26 extern void pckbd_leds(unsigned char leds);
27 extern void pckbd_init_hw(void);
28 extern unsigned char pckbd_sysrq_xlate[128];
29 
kbd_init_hw(void)30 static inline void kbd_init_hw(void)
31 {
32 		k_setkeycode    = pckbd_setkeycode;
33 		k_getkeycode    = pckbd_getkeycode;
34 		k_translate     = pckbd_translate;
35 		k_unexpected_up = pckbd_unexpected_up;
36 		k_leds          = pckbd_leds;
37 #ifdef CONFIG_MAGIC_SYSRQ
38 		k_sysrq_key     = 0x54;
39 		k_sysrq_xlate   = pckbd_sysrq_xlate;
40 #endif
41 		pckbd_init_hw();
42 }
43 
44 /*
45  * PC Keyboard specifics
46  */
47 
48 /* resource allocation */
49 #define kbd_request_region() request_region(0x60, 16, "keyboard")
50 #define kbd_request_irq(handler) request_irq(KEYBOARD_IRQ, handler, 0, \
51                                              "keyboard", NULL)
52 
53 /* How to access the keyboard macros on this platform.  */
54 #define kbd_read_input() inb(KBD_DATA_REG)
55 #define kbd_read_status() inb(KBD_STATUS_REG)
56 #define kbd_write_output(val) outb(val, KBD_DATA_REG)
57 #define kbd_write_command(val) outb(val, KBD_CNTL_REG)
58 
59 /* Some stoneage hardware needs delays after some operations.  */
60 #define kbd_pause() do { } while(0)
61 
62 /*
63  * Machine specific bits for the PS/2 driver
64  */
65 #define aux_request_irq(hand, dev_id)					\
66 	request_irq(AUX_IRQ, hand, SA_SHIRQ, "PS/2 Mouse", dev_id)
67 
68 #define aux_free_irq(dev_id) free_irq(AUX_IRQ, dev_id)
69