* add p cc
[mascara-docs.git] / i386 / linux / linux-2.3.21 / include / asm-m68k / keyboard.h
blob555ef68ec6fda2d2dc25bd74c6081a7595b69919
1 /*
2 * linux/include/asm-m68k/keyboard.h
4 * Created 3 Nov 1996 by Geert Uytterhoeven
5 */
7 /*
8 * This file contains the m68k architecture specific keyboard definitions
9 */
11 #include <linux/config.h> /* CONFIG_MAGIC_SYSRQ */
12 #ifndef __M68K_KEYBOARD_H
13 #define __M68K_KEYBOARD_H
15 #ifdef __KERNEL__
17 #include <asm/machdep.h>
19 #ifdef CONFIG_Q40
20 #include <asm/q40_keyboard.h>
21 #endif
23 static __inline__ int kbd_setkeycode(unsigned int scancode,
24 unsigned int keycode)
26 #ifdef CONFIG_Q40
27 if (MACH_IS_Q40)
28 return q40kbd_setkeycode(scancode,keycode);
29 #endif
30 return -EOPNOTSUPP;
33 static __inline__ int kbd_getkeycode(unsigned int scancode)
35 #ifdef CONFIG_Q40
36 if (MACH_IS_Q40)
37 return q40kbd_getkeycode(scancode);
38 #endif
39 return scancode > 127 ? -EINVAL : scancode;
42 static __inline__ int kbd_translate(unsigned char scancode,
43 unsigned char *keycode, char raw_mode)
45 #ifdef CONFIG_Q40
46 if (MACH_IS_Q40)
47 return q40kbd_translate(scancode,keycode,raw_mode);
48 #endif
49 *keycode = scancode;
50 return 1;
53 static __inline__ char kbd_unexpected_up(unsigned char keycode)
55 #ifdef CONFIG_Q40
56 if (MACH_IS_Q40)
57 return q40kbd_unexpected_up(keycode);
58 #endif
59 return 0200;
62 static __inline__ void kbd_leds(unsigned char leds)
64 if (mach_kbd_leds)
65 mach_kbd_leds(leds);
68 #ifdef CONFIG_MAGIC_SYSRQ
69 #define kbd_is_sysrq(keycode) ((keycode) == mach_sysrq_key && \
70 (up_flag || \
71 (shift_state & mach_sysrq_shift_mask) == \
72 mach_sysrq_shift_state))
73 #define kbd_sysrq_xlate mach_sysrq_xlate
74 #endif
76 #define kbd_init_hw mach_keyb_init
78 #endif /* __KERNEL__ */
80 #endif /* __M68K_KEYBOARD_H */