add support for PC-9800 architecture (input)
Subsystems (2)
RFC PATCH 11/24 add support for PC-9800 architecture (input)
This is a part 11/24 of patchset for add support NEC PC-9800 architecture, against 2.5.44.
Thanks for many comments.
I've merged input(11/25) and keyboard(13/25) patch.
In this patch, I don't change input.h defkeymap.c defkeymap.map. I removed kana support for default. I'll load another keymaps for kana support.
I added codes into new driver(98kbd.c) to emulate US101 keyboard.
I can't find interface module for xtkbd.c to serio.c. So I write new module based on i8042.c.
In defkeymaps, KEY_KPEQUAL and KEY_KPCOMMA seems odd. Please fix them.
Summary:
input modules
- add new driver for PC-9800 standard keyboard and mouse.
- add few changes for PC-9800 hardware spec.
diffstat:
drivers/char/keyboard.c | 4 drivers/input/keyboard/98kbd.c | 356 +++++++++++++++++++++++++++++++++++++++ drivers/input/keyboard/Config.in | 4 drivers/input/keyboard/Makefile | 1 drivers/input/misc/pcspkr.c | 24 ++ drivers/input/mouse/98busmouse.c | 201 ++++++++++++++++++++++ drivers/input/mouse/Config.in | 3 drivers/input/mouse/Makefile | 1 drivers/input/serio/98kbd-io.c | 181 +++++++++++++++++++ drivers/input/serio/Config.in | 3 drivers/input/serio/Makefile | 1 include/linux/kbd_kern.h | 5 include/linux/keyboard.h | 1 13 files changed, 783 insertions(+), 2 deletions(-)
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 +356 -0
356 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/98busmouse.c +201 -0
201 lines not on this page · raw message
drivers/input/mouse/Config.in +3 -0
@@ -22,3 +22,6 @@ if [ "$CONFIG_ARCH_ACORN" = "y" ]; then dep_tristate ' Acorn RiscPC mouse' CONFIG_MOUSE_ACORN $CONFIG_INPUT $CONFIG_INPUT_MOUSE fi +if [ "$CONFIG_PC9800" = "y" ]; then + dep_tristate ' NEC PC-9801 busmouse' CONFIG_BUSMOUSE_PC9800 $CONFIG_INPUT $CONFIG_INPUT_MOUSE $CONFIG_ISA +fi
drivers/input/mouse/Makefile +0 -0
+++
@@ -12,6 +12,7 @@
obj-$(CONFIG_MOUSE_PC110PAD) += pc110pad.o
obj-$(CONFIG_MOUSE_PS2) += psmouse.o
obj-$(CONFIG_MOUSE_SERIAL) += sermouse.o
+obj-$(CONFIG_BUSMOUSE_PC9800) += 98busmouse.o
# The global Rules.make.
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) += 98kbd-io.o # The global Rules.make.
drivers/input/serio/98kbd-io.c +181 -0
181 lines not on this page · raw message
drivers/char/keyboard.c +4 -0
@@ -58,7 +58,11 @@* Some laptops take the 789uiojklm,. keys as number pad when NumLock is on. * This seems a good reason to start with NumLock off. */ +#ifndef CONFIG_PC9800 #define KBD_DEFLEDS 0 +#else +#define KBD_DEFLEDS (1 << VC_NUMLOCK) +#endif #endif #ifndef KBD_DEFLOCK
include/linux/kbd_kern.h +3 -2
@@ -43,11 +43,12 @@#define LED_SHOW_IOCTL 1/* only change leds upon ioctl */ #define LED_SHOW_MEM 2/* `heartbeat': peek into memory */ - unsigned char ledflagstate:3; /* flags, not lights */ - unsigned char default_ledflagstate:3; + unsigned char ledflagstate:4; /* flags, not lights */ + unsigned char default_ledflagstate:4;#define VC_SCROLLOCK 0/* scroll-lock mode */ #define VC_NUMLOCK 1/* numeric lock mode */ #define VC_CAPSLOCK 2/* capslock mode */ +#define VC_KANALOCK 3/* kanalock mode */ unsigned char kbdmode:2; /* one 2-bit value */#define VC_XLATE 0/* translate keycodes using keymap */
include/linux/keyboard.h +1 -0
@@ -9,6 +9,7 @@#define KG_ALT 3#define KG_ALTGR 1#define KG_SHIFTL 4 +#define KG_KANASHIFT 4#define KG_SHIFTR 5#define KG_CTRLL 6#define KG_CTRLR 7