add support for PC-9800 architecture (input)
PATCH 11/25 add support for PC-9800 architecture (input)
This is part 11/26 of patchset for add support NEC PC-9800 architecture, against 2.5.43.
Summary:
input modules
- add new driver for PC-9800 standard keyboard and mouse.
input.h changes are temporally hack.
I'll remove this hack using propery keycode.
To do this, I need "kbd" utility that can make keymap even if keycode > 127.
diffstat:
drivers/input/keyboard/98kbd.c | 359 +++++++++++++++++++++++++++++++++++++++ drivers/input/keyboard/Config.in | 4 drivers/input/keyboard/Makefile | 1 drivers/input/misc/pcspkr.c | 24 ++ drivers/input/mouse/Config.in | 7 drivers/input/mouse/logibm.c | 48 +++++ drivers/input/serio/Config.in | 3 drivers/input/serio/Makefile | 1 drivers/input/serio/i8042-98.c | 346 +++++++++++++++++++++++++++++++++++++ drivers/input/serio/i8042-98io.h | 74 ++++++++ drivers/input/serio/i8042.h | 2 include/linux/input.h | 21 ++ 12 files changed, 890 insertions(+)
patch:
drivers/input/keyboard/Config.in +4 -0
@@ -9,6 +9,10 @@ dep_tristate ' XT Keyboard support' CONFIG_KEYBOARD_XTKBD $CONFIG_INPUT $CONFIG_INPUT_KEYBOARD $CONFIG_SERIO dep_tristate ' Newton keyboard' CONFIG_KEYBOARD_NEWTON $CONFIG_INPUT $CONFIG_INPUT_KEYBOARD $CONFIG_SERIO +if [ "$CONFIG_PC9800" = "y" ]; then + dep_tristate ' NEC PC-9801 keyboard support' CONFIG_KEYBOARD_98KBD $CONFIG_INPUT $CONFIG_INPUT_KEYBOARD $CONFIG_SERIO +fi + if [ "$CONFIG_SH_DREAMCAST" = "y" ]; then dep_tristate ' Maple bus keyboard support' CONFIG_KEYBOARD_MAPLE $CONFIG_INPUT $CONFIG_INPUT_KEYBOARD $CONFIG_MAPLE fi
drivers/input/keyboard/Makefile +1 -0
@@ -10,6 +10,7 @@ obj-$(CONFIG_KEYBOARD_XTKBD) += xtkbd.o obj-$(CONFIG_KEYBOARD_AMIGA) += amikbd.o obj-$(CONFIG_KEYBOARD_NEWTON) += newtonkbd.o +obj-$(CONFIG_KEYBOARD_98KBD) += 98kbd.o # The global Rules.make.
drivers/input/keyboard/98kbd.c +359 -0
359 lines not on this page · raw message
drivers/input/misc/pcspkr.c +24 -0
@@ -12,6 +12,7 @@* the Free Software Foundation */ +#include <linux/config.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h>
@@ -23,7 +24,11 @@MODULE_LICENSE ("GPL" );static char pcspkr_name[] ="PC Speaker" ; +#ifndef CONFIG_PC9800 static char pcspkr_phys[] ="isa0061/input0" ; +#else +static char pcspkr_phys[] ="isa3fdb/input0" ; +#endif static struct input_dev pcspkr_dev;spinlock_t i8253_beep_lock =SPIN_LOCK_UNLOCKED ;
@@ -43,11 +48,16 @@ } if (value > 20 && value < 32767) +#ifndef CONFIG_PC9800 count =1193182 / value; +#else + count =CLOCK_TICK_RATE / value; +#endif spin_lock_irqsave (&i8253_beep_lock, flags);if (count) { +#ifndef CONFIG_PC9800 /* enable counter 2 */ outb_p (inb_p (0x61 ) |3 ,0x61 );/* set command for counter 2, 2 byte write */
@@ -55,9 +65,23 @@/* select desired HZ */ outb_p (count &0xff ,0x42 );outb ((count >>8 ) &0xff ,0x42 ); +#else /* CONFIG_PC9800 */ +outb (0x76 ,0x3fdf ); +outb (0 ,0x5f ); +outb (count &0xff ,0x3fdb ); +outb (0 ,0x5f ); +outb ((count >>8 ) &0xff ,0x3fdb ); +/* beep on */ +outb (6 ,0x37 ); +#endif /* !CONFIG_PC9800 */ }else {/* disable counter 2 */ +#ifndef CONFIG_PC9800 outb (inb_p (0x61 ) &0xFC ,0x61 ); +#else +/* beep off */ +outb (7 ,0x37 ); +#endif }spin_unlock_irqrestore (&i8253_beep_lock, flags);
drivers/input/mouse/Config.in +7 -0
@@ -7,6 +7,12 @@ dep_tristate ' PS/2 mouse' CONFIG_MOUSE_PS2 $CONFIG_INPUT $CONFIG_INPUT_MOUSE $CONFIG_SERIO dep_tristate ' Serial mouse' CONFIG_MOUSE_SERIAL $CONFIG_INPUT $CONFIG_INPUT_MOUSE $CONFIG_SERIO +if [ "$CONFIG_PC9800" = "y" ]; then + dep_tristate ' NEC PC-9801 busmouse' CONFIG_MOUSE_LOGIBM $CONFIG_INPUT $CONFIG_INPUT_MOUSE $CONFIG_ISA + if [ "$CONFIG_MOUSE_LOGIBM" != "n" ]; then + define_bool CONFIG_LOGIBUSMOUSE_PC9800 y + fi +else dep_tristate ' InPort/MS/ATIXL busmouse' CONFIG_MOUSE_INPORT $CONFIG_INPUT $CONFIG_INPUT_MOUSE $CONFIG_ISA if [ "$CONFIG_MOUSE_INPORT" != "n" ]; then bool ' ATI XL variant' CONFIG_MOUSE_ATIXL
@@ -22,3 +28,4 @@ if [ "$CONFIG_ARCH_ACORN" = "y" ]; then dep_tristate ' Acorn RiscPC mouse' CONFIG_MOUSE_ACORN $CONFIG_INPUT $CONFIG_INPUT_MOUSE fi +fi
drivers/input/mouse/logibm.c +48 -0
106 lines not on this page · raw message
drivers/input/serio/Config.in +3 -0
@@ -21,3 +21,6 @@ if [ "$CONFIG_SA1111" = "y" ]; then dep_tristate ' Intel SA1111 keyboard controller' CONFIG_SERIO_SA1111 $CONFIG_SERIO fi +if [ "$CONFIG_PC9800" = "y" ]; then + dep_tristate ' NEC PC-9801 keyboard controller' CONFIG_SERIO_98KBD $CONFIG_SERIO +fi
drivers/input/serio/Makefile +1 -0
@@ -17,6 +17,7 @@ obj-$(CONFIG_SERIO_SA1111) += sa1111ps2.o obj-$(CONFIG_SERIO_AMBAKMI) += ambakmi.o obj-$(CONFIG_SERIO_Q40KBD) += q40kbd.o +obj-$(CONFIG_SERIO_98KBD) += i8042-98.o # The global Rules.make.
drivers/input/serio/i8042-98.c +346 -0
346 lines not on this page · raw message
drivers/input/serio/i8042-98io.h +74 -0
74 lines not on this page · raw message
drivers/input/serio/i8042.h +2 -0
@@ -17,6 +17,8 @@#include "i8042-ppcio.h" #elif defined(CONFIG_SPARC32 ) || defined(CONFIG_SPARC64 )#include "i8042-sparcio.h" +#elif defined(CONFIG_PC9800 ) +#include "i8042-98io.h" #else #include "i8042-io.h" #endif
include/linux/input.h +21 -0
@@ -9,6 +9,7 @@* the Free Software Foundation. */ +#include <linux/config.h> #ifdef __KERNEL__#include <linux/time.h> #include <linux/list.h>
@@ -134,7 +135,11 @@#define KEY_LEFTBRACE 26#define KEY_RIGHTBRACE 27#define KEY_ENTER 28 +#ifndef CONFIG_PC9800 #define KEY_LEFTCTRL 29 +#else +#define KEY_LEFTCTRL 116 +#endif #define KEY_A 30#define KEY_S 31#define KEY_D 32
@@ -147,7 +152,11 @@#define KEY_SEMICOLON 39#define KEY_APOSTROPHE 40#define KEY_GRAVE 41 +#ifndef CONFIG_PC9800 #define KEY_LEFTSHIFT 42 +#else +#define KEY_LEFTSHIFT 112 +#endif #define KEY_BACKSLASH 43#define KEY_Z 44#define KEY_X 45
@@ -161,9 +170,17 @@#define KEY_SLASH 53#define KEY_RIGHTSHIFT 54#define KEY_KPASTERISK 55 +#ifndef CONFIG_PC9800 #define KEY_LEFTALT 56 +#else +#define KEY_LEFTALT 115 +#endif #define KEY_SPACE 57 +#ifndef CONFIG_PC9800 #define KEY_CAPSLOCK 58 +#else +#define KEY_CAPSLOCK 113 +#endif #define KEY_F1 59#define KEY_F2 60#define KEY_F3 61
@@ -204,7 +221,11 @@#define KEY_KPENTER 96#define KEY_RIGHTCTRL 97#define KEY_KPSLASH 98 +#ifndef CONFIG_PC9800 #define KEY_SYSRQ 99 +#else +#define KEY_SYSRQ 96 +#endif #define KEY_RIGHTALT 100#define KEY_LINEFEED 101#define KEY_HOME 102