Ok. I didn't make 2.4.0 in 2000. Tough. I tried, but we had some
[davej-history.git] / include / asm-ppc / keyboard.h
blob8a6e74fccdcf6a71b5eaee18cdf4164f48f5c388
1 /*
2 * linux/include/asm-ppc/keyboard.h
4 * Created 3 Nov 1996 by Geert Uytterhoeven
5 * Modified for Power Macintosh by Paul Mackerras
6 */
8 /*
9 * This file contains the ppc architecture specific keyboard definitions -
10 * like the intel pc for prep systems, different for power macs.
13 #ifndef __ASMPPC_KEYBOARD_H
14 #define __ASMPPC_KEYBOARD_H
16 #ifdef __KERNEL__
18 #include <linux/adb.h>
19 #include <asm/machdep.h>
21 #include <linux/kernel.h>
22 #include <linux/ioport.h>
23 #include <asm/io.h>
25 #define KEYBOARD_IRQ 1
26 #define DISABLE_KBD_DURING_INTERRUPTS 0
27 #define INIT_KBD
29 static inline int kbd_setkeycode(unsigned int scancode, unsigned int keycode)
31 if ( ppc_md.kbd_setkeycode )
32 return ppc_md.kbd_setkeycode(scancode, keycode);
33 else
34 return 0;
37 static inline int kbd_getkeycode(unsigned int scancode)
39 if ( ppc_md.kbd_getkeycode )
40 return ppc_md.kbd_getkeycode(scancode);
41 else
42 return 0;
45 static inline int kbd_translate(unsigned char keycode, unsigned char *keycodep,
46 char raw_mode)
48 if ( ppc_md.kbd_translate )
49 return ppc_md.kbd_translate(keycode, keycodep, raw_mode);
50 else
51 return 0;
54 static inline int kbd_unexpected_up(unsigned char keycode)
56 if ( ppc_md.kbd_unexpected_up )
57 return ppc_md.kbd_unexpected_up(keycode);
58 else
59 return 0;
62 static inline void kbd_leds(unsigned char leds)
64 if ( ppc_md.kbd_leds )
65 ppc_md.kbd_leds(leds);
68 static inline void kbd_init_hw(void)
70 if ( ppc_md.kbd_init_hw )
71 ppc_md.kbd_init_hw();
74 #define kbd_sysrq_xlate (ppc_md.ppc_kbd_sysrq_xlate)
76 extern unsigned long SYSRQ_KEY;
78 /* resource allocation */
79 #define kbd_request_region()
80 #define kbd_request_irq(handler) request_irq(KEYBOARD_IRQ, handler, 0, \
81 "keyboard", NULL)
83 /* How to access the keyboard macros on this platform. */
84 #define kbd_read_input() inb(KBD_DATA_REG)
85 #define kbd_read_status() inb(KBD_STATUS_REG)
86 #define kbd_write_output(val) outb(val, KBD_DATA_REG)
87 #define kbd_write_command(val) outb(val, KBD_CNTL_REG)
89 /* Some stoneage hardware needs delays after some operations. */
90 #define kbd_pause() do { } while(0)
93 * Machine specific bits for the PS/2 driver
96 #define AUX_IRQ 12
98 #define aux_request_irq(hand, dev_id) \
99 request_irq(AUX_IRQ, hand, SA_SHIRQ, "PS/2 Mouse", dev_id)
101 #define aux_free_irq(dev_id) free_irq(AUX_IRQ, dev_id)
103 #endif /* __KERNEL__ */
105 #endif /* __ASMPPC_KEYBOARD_H */