cleanup
[linux-2.4.21-pre4.git] / drivers / char / dummy_keyb.c
1 /*
2  * linux/drivers/char/dummy_keyb.c
3  *
4  * Allows CONFIG_VT on hardware without keyboards.
5  *
6  * Copyright (C) 1999, 2001 Bradley D. LaRonde
7  *
8  * This file is subject to the terms and conditions of the GNU General Public
9  * License.  See the file "COPYING" in the main directory of this archive
10  * for more details.
11  *
12  * What is this for?
13  *
14  * Not all systems have keyboards.  Some don't even have a keyboard
15  * port.  However, some of those systems have video support and can
16  * use the virtual terminal support for display.  However, the virtual
17  * terminal code expects a keyboard of some kind.  This driver keeps
18  * the virtual terminal code happy by providing it a "keyboard", albeit
19  * a very quiet one.
20  *
21  * If you want to use the virtual terminal support but your system
22  * does not support a keyboard, define CONFIG_DUMMY_KEYB along with
23  * CONFIG_VT.
24  *
25  */
26 #include <linux/sched.h>
27 #include <linux/errno.h>
28 #include <linux/init.h>
29
30 void kbd_leds(unsigned char leds)
31 {
32 }
33
34 int kbd_setkeycode(unsigned int scancode, unsigned int keycode)
35 {
36         return (scancode == keycode) ? 0 : -EINVAL;
37 }
38
39 int kbd_getkeycode(unsigned int scancode)
40 {
41         return scancode;
42 }
43
44 int kbd_translate(unsigned char scancode, unsigned char *keycode,
45         char raw_mode)
46 {
47         *keycode = scancode;
48
49         return 1;
50 }
51
52 char kbd_unexpected_up(unsigned char keycode)
53 {
54         return 0x80;
55 }
56
57 void __init kbd_init_hw(void)
58 {
59         printk("Dummy keyboard driver installed.\n");
60 }