From: James S. <jsi...@us...> - 2002-02-13 17:33:48
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input/keyboard In directory usw-pr-cvs1:/tmp/cvs-serv30361 Modified Files: Config.help Config.in Makefile apollokbd.c Log Message: Now you can select the amiga keyboard. Index: Config.help =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/keyboard/Config.help,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Config.help 26 Jan 2002 19:20:36 -0000 1.1 +++ Config.help 13 Feb 2002 17:33:44 -0000 1.2 @@ -55,3 +55,12 @@ The module will be called maple_keyb.o. If you want to compile it as a module, say M here and read <file:Documentation/modules.txt>. +CONFIG_KEYBOARD_AMIGA + Say Y here if you are running Linux on a m68k amiga and have a keyboard + attached. + + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + The module will be called maple_keyb.o. If you want to compile it as a + module, say M here and read <file:Documentation/modules.txt>. + Index: Config.in =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/keyboard/Config.in,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Config.in 23 Jan 2002 06:35:30 -0000 1.2 +++ Config.in 13 Feb 2002 17:33:44 -0000 1.3 @@ -8,8 +8,11 @@ dep_tristate ' Sun Type 4 and Type 5 keyboard support' CONFIG_KEYBOARD_SUNKBD $CONFIG_INPUT $CONFIG_INPUT_KEYBOARD $CONFIG_SERIO dep_tristate ' PS/2 to Serial converter support' CONFIG_KEYBOARD_PS2SERKBD $CONFIG_INPUT $CONFIG_INPUT_KEYBOARD $CONFIG_SERIO dep_tristate ' XT Keyboard support' CONFIG_KEYBOARD_XTKBD $CONFIG_INPUT $CONFIG_INPUT_KEYBOARD $CONFIG_SERIO -dep_tristate ' Newton Keyboard support' CONFIG_KEYBOARD_NEWTON $CONFIG_INPUT $CONFIG_INPUT_KEYBOARD $CONFIG_SERIO if [ "$CONFIG_SH_DREAMCAST" = "y" ]; then dep_tristate ' Maple bus keyboard support' CONFIG_KEYBOARD_MAPLE $CONFIG_INPUT $CONFIG_INPUT_KEYBOARD $CONFIG_MAPLE +fi + +if [ "$CONFIG_AMIGA" = "y" ]; then + dep_tristate ' Amiga keyboard' CONFIG_KEYBOARD_AMIKBD $CONFIG_INPUT $CONFIG_INPUT_KEYBOARD fi Index: Makefile =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/keyboard/Makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile 1 Feb 2002 00:06:12 -0000 1.3 +++ Makefile 13 Feb 2002 17:33:44 -0000 1.4 @@ -13,7 +13,7 @@ obj-$(CONFIG_KEYBOARD_PS2SERKBD) += ps2serkbd.o obj-$(CONFIG_KEYBOARD_SUNKBD) += sunkbd.o obj-$(CONFIG_KEYBOARD_XTKBD) += xtkbd.o -obj-$(CONFIG_KEYBOARD_NEWTON) += newtonkbd.o +obj-$(CONFIG_KEYBOARD_AMIGA) += amikbd.o # The global Rules.make. Index: apollokbd.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/keyboard/apollokbd.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- apollokbd.c 24 Jan 2002 19:26:37 -0000 1.1 +++ apollokbd.c 13 Feb 2002 17:33:44 -0000 1.2 @@ -1,3 +1,35 @@ +/* + * $Id$ + * + * Copyright (c) 2001 James Simmons <jsi...@us...> + * + * Based on the work of: + * Peter De Schrijver <p2...@mi...> + */ + +/* + * Apollo input keyboard driver for Linux/m68k + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Should you need to contact me, the author, you can do so by + * e-mail - mail your message to <jsi...@us...>. + */ + #include <linux/sched.h> #include <linux/interrupt.h> #include <linux/errno.h> @@ -8,7 +40,6 @@ #include <linux/kernel.h> #include <linux/module.h> #include <linux/poll.h> -#include <linux/miscdevice.h> #include <linux/init.h> #include <asm/setup.h> @@ -16,10 +47,6 @@ #include <asm/apollohw.h> #include <asm/uaccess.h> -#include "busmouse.h" - -/* extern void handle_scancode(unsigned char,int ); */ - #define DNKEY_CAPS 0x7e #define BREAK_FLAG 0x80 #define DNKEY_REPEAT_DELAY 50 @@ -43,258 +70,6 @@ static unsigned int kbd_mode=APOLLO_KBD_MODE_KEYB; -#if 0 -static void debug_keyb_timer_handler(unsigned long ignored); -static u_char debug_buf1[4096],debug_buf2[4096],*debug_buf=&debug_buf1[0]; -static u_char *shadow_buf=&debug_buf2[0]; -static short debug_buf_count=0; -static int debug_buf_overrun=0,debug_timer_running=0; -static unsigned long debug_buffer_updated=0; -static struct timer_list debug_keyb_timer = { NULL, NULL, 0, 0, - debug_keyb_timer_handler }; -#endif - -static u_short dnplain_map[NR_KEYS] __initdata = { -/* ins del del F1 F2 F3 F4 - mark line char */ - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, -/* F5 F6 F7 F8 F9 F0 Again Read */ - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, -/* Edit Exit Hold Copy Paste Grow ESC */ - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf01b, -/* 1 2 3 4 5 6 7 8 */ - 0xf031, 0xf032, 0xf033, 0xf034, 0xf035, 0xf036, 0xf037, 0xf038, -/* 9 0 - = ` Back |<-- - Space */ - 0xf039, 0xf030, 0xf02d, 0xf03d, 0xf060, 0xf07f, 0xf200, 0xf200, -/* Shell -->| Tab q w e - Cmd */ - 0xf200, 0xf200, 0xf200, 0xf200, 0xf009, 0xfb71, 0xfb77, 0xfb65, -/* r t y u i o p [ */ - 0xfb72, 0xfb74, 0xfb79, 0xfb75, 0xfb69, 0xfb6f, 0xfb70, 0xf05b, -/* ] Del 7 8 9 + */ - 0xf05d, 0xf200, 0xf200, 0xf200, 0xf307, 0xf308, 0xf300, 0xf30a, -/* [<--] Up [-->] Ctrl a s */ - 0xf200, 0xf600, 0xf200, 0xf702, 0xf200, 0xf200, 0xfb61, 0xfb73, -/* d f g h j k l ; */ - 0xfb64, 0xfb66, 0xfb67, 0xfb68, 0xfb6a, 0xfb6b, 0xfb6c, 0xf03b, -/* ' Return \ 4 5 6 */ - 0xf027, 0xf200, 0xf201, 0xf05c, 0xf200, 0xf304, 0xf305, 0xf306, -/* - <-- Next --> Rept Shift - Window */ - 0xf30b, 0xf601, 0xf200, 0xf602, 0xf200, 0xf200, 0xf700, 0xf200, -/* z x c v b n m , */ - 0xfb7a, 0xfb78, 0xfb63, 0xfb76, 0xfb62, 0xfb6e, 0xfb6d, 0xf02c, -/* . / Shift Pop 1 2 */ - 0xf02e, 0xf02f, 0xf700, 0xf200, 0xf200, 0xf200, 0xf301, 0xf302, -/* 3 PgUp Down PgDn Alt Space Alt */ - 0xf303, 0xf200, 0xf118, 0xf603, 0xf119, 0xf703, 0xf020, 0xf701, -/* 0 . Enter */ - 0xf200, 0xf300, 0xf200, 0xf310, 0xf30e, 0xf200, 0xf700, 0xf200, -}; - -static u_short dnshift_map[NR_KEYS] __initdata = { -/* ins del del F1 F2 F3 F4 - mark line char */ - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, -/* F5 F6 F7 F8 F9 F0 Again Read */ - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, -/* Save Abort Help Cut Undo Grow ESC */ - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf01b, -/* ! @ # $ % ^ & * */ - 0xf021, 0xf040, 0xf023, 0xf024, 0xf025, 0xf05e, 0xf026, 0xf02a, -/* ( ) _ + ~ Back |<-- - Space */ - 0xf028, 0xf029, 0xf05f, 0xf02b, 0xf07e, 0xf07f, 0xf200, 0xf200, -/* Shell -->| Tab Q W E - Cmd */ - 0xf200, 0xf200, 0xf200, 0xf200, 0xf009, 0xfb51, 0xfb57, 0xfb45, -/* R T Y U I O P { */ - 0xfb52, 0xfb54, 0xfb59, 0xfb55, 0xfb49, 0xfb4f, 0xfb50, 0xf07b, -/* } Del 7 8 9 + */ - 0xf07d, 0xf200, 0xf200, 0xf200, 0xf307, 0xf308, 0xf300, 0xf30a, -/* [<--] Up [-->] Ctrl A S */ - 0xf200, 0xf600, 0xf200, 0xf702, 0xf200, 0xf200, 0xfb41, 0xfb53, -/* D F G H J K L : */ - 0xfb44, 0xfb46, 0xfb47, 0xfb48, 0xfb4a, 0xfb4b, 0xfb4c, 0xf03a, -/* " Return | 4 5 6 */ - 0xf022, 0xf200, 0xf201, 0xf07c, 0xf200, 0xf304, 0xf305, 0xf306, -/* - <-- Next --> Rept Shift - Window */ - 0xf30b, 0xf601, 0xf200, 0xf602, 0xf200, 0xf200, 0xf700, 0xf200, -/* Z X C V B N M < */ - 0xfb5a, 0xfb58, 0xfb43, 0xfb56, 0xfb42, 0xfb4e, 0xfb4d, 0xf03c, -/* > ? Shift Pop 1 2 */ - 0xf03e, 0xf03f, 0xf700, 0xf200, 0xf200, 0xf200, 0xf301, 0xf302, -/* 3 PgUp Down PgDn Alt Space Alt */ - 0xf303, 0xf200, 0xf118, 0xf603, 0xf119, 0xf703, 0xf020, 0xf701, -/* 0 . Enter */ - 0xf200, 0xf300, 0xf200, 0xf310, 0xf30e, 0xf200, 0xf708, 0xf200, -}; - -static u_short dnctrl_map[NR_KEYS] __initdata = { -/* ins del del F1 F2 F3 F4 - mark line char */ - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, -/* F5 F6 F7 F8 F9 F0 Again Read */ - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, -/* Save Abort Help Cut Undo Grow ESC */ - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf01b, -/* ! @ # $ % ^ & * */ - 0xf200, 0xf000, 0xf01b, 0xf01c, 0xf01d, 0xf01e, 0xf01f, 0xf07f, -/* ( ) _ + ~ Back |<-- - Space */ - 0xf200, 0xf200, 0xf01f, 0xf200, 0xf01c, 0xf200, 0xf200, 0xf200, -/* Shell -->| Tab Q W E - Cmd */ - 0xf200, 0xf200, 0xf200, 0xf200, 0xf009, 0xf011, 0xf017, 0xf005, -/* R T Y U I O P { */ - 0xf012, 0xf014, 0xf019, 0xf015, 0xf009, 0xf00f, 0xf010, 0xf01b, -/* } Del 7 8 9 + */ - 0xf01d, 0xf200, 0xf200, 0xf200, 0xf307, 0xf308, 0xf300, 0xf30a, -/* [<--] Up [-->] Ctrl A S */ - 0xf200, 0xf600, 0xf200, 0xf702, 0xf200, 0xf200, 0xfb01, 0xfb53, -/* D F G H J K L : */ - 0xf004, 0xf006, 0xf007, 0xf008, 0xf00a, 0xf00b, 0xf00c, 0xf200, -/* " Return | 4 5 6 */ - 0xf200, 0xf200, 0xf201, 0xf01c, 0xf200, 0xf304, 0xf305, 0xf306, -/* - <-- Next --> Rept Shift - Window */ - 0xf30b, 0xf601, 0xf200, 0xf602, 0xf200, 0xf200, 0xf704, 0xf200, -/* Z X C V B N M < */ - 0xf01a, 0xf018, 0xf003, 0xf016, 0xf002, 0xf00e, 0xf01d, 0xf03c, -/* > ? Shift Pop 1 2 */ - 0xf03e, 0xf03f, 0xf705, 0xf200, 0xf200, 0xf200, 0xf301, 0xf302, -/* 3 PgUp Down PgDn Alt Space Alt */ - 0xf303, 0xf200, 0xf118, 0xf603, 0xf119, 0xf703, 0xf020, 0xf701, -/* 0 . Enter */ - 0xf200, 0xf300, 0xf200, 0xf310, 0xf30e, 0xf200, 0xf200, 0xf200, -}; - -static u_short dnalt_map[NR_KEYS] __initdata = { -/* ins del del F1 F2 F3 F4 - mark line char */ - 0xf200, 0xf200, 0xf200, 0xf200, 0xf500, 0xf501, 0xf502, 0xf503, -/* F5 F6 F7 F8 F9 F0 Again Read */ - 0xf504, 0xf505, 0xf506, 0xf507, 0xf508, 0xf509, 0xf200, 0xf200, -/* Edit Exit Hold Copy Paste Grow ESC */ - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf01b, -/* 1 2 3 4 5 6 7 8 */ - 0xf831, 0xf832, 0xf833, 0xf834, 0xf835, 0xf836, 0xf837, 0xf838, -/* 9 0 - = ` Back |<-- - Space */ - 0xf839, 0xf830, 0xf82d, 0xf83d, 0xf860, 0xf87f, 0xf200, 0xf200, -/* Shell -->| Tab q w e - Cmd */ - 0xf200, 0xf200, 0xf200, 0xf200, 0xf809, 0xf871, 0xf877, 0xf865, -/* r t y u i o p [ */ - 0xf872, 0xf874, 0xf879, 0xf875, 0xf869, 0xf86f, 0xf870, 0xf85b, -/* ] Del 7 8 9 + */ - 0xf05d, 0xf200, 0xf200, 0xf200, 0xf307, 0xf308, 0xf300, 0xf30a, -/* [<--] Up [-->] Ctrl a s */ - 0xf200, 0xf600, 0xf200, 0xf702, 0xf200, 0xf200, 0xf861, 0xf873, -/* d f g h j k l ; */ - 0xf864, 0xf866, 0xf867, 0xf868, 0xf86a, 0xf86b, 0xf86c, 0xf03b, -/* ' Return \ 4 5 6 */ - 0xf027, 0xf200, 0xf201, 0xf05c, 0xf200, 0xf304, 0xf305, 0xf306, -/* - <-- Next --> Rept Shift - Window */ - 0xf30b, 0xf601, 0xf200, 0xf602, 0xf200, 0xf200, 0xf704, 0xf200, -/* z x c v b n m , */ - 0xf87a, 0xf878, 0xf863, 0xf876, 0xf862, 0xf86e, 0xf86d, 0xf82c, -/* . / Shift Pop 1 2 */ - 0xf82e, 0xf82f, 0xf705, 0xf200, 0xf200, 0xf200, 0xf301, 0xf302, -/* 3 PgUp Down PgDn Alt Space Alt */ - 0xf303, 0xf200, 0xf118, 0xf603, 0xf119, 0xf703, 0xf820, 0xf701, -/* 0 . Enter */ - 0xf200, 0xf300, 0xf200, 0xf310, 0xf30e, 0xf200, 0xf200, 0xf200, -}; - -static u_short dnaltgr_map[NR_KEYS] __initdata = { - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200 -}; - -static u_short dnshift_ctrl_map[NR_KEYS] __initdata = { - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200 -}; - -static u_short dnctrl_alt_map[NR_KEYS] __initdata = { - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200 -}; - -#if 0 -static void debug_keyb_timer_handler(unsigned long ignored) { - - unsigned long flags; - u_char *swap; - short length,i; - - if (time_after(jiffies, debug_buffer_updated + 100)) { - save_flags(flags); - cli(); - length=debug_buf_count; - swap=debug_buf; - debug_buf=shadow_buf; - shadow_buf=swap; - debug_buf_count=0; - debug_timer_running=0; - restore_flags(flags); - for(i=1;length;length--,i++) - printk("%02x%c",*(swap++), (i % 25) ? ' ' : '\n'); - printk("\n"); - } - else { - debug_keyb_timer.expires=jiffies+10; - add_timer(&debug_keyb_timer); - } -} -#endif - static void dn_keyb_process_key_event(unsigned char scancode) { static unsigned char lastscancode; @@ -374,8 +149,8 @@ } } -static void dn_keyb_int(int irq, void *dummy, struct pt_regs *fp) { - +static void apollokbd_interrupt(int irq, void *dummy, struct pt_regs *fp) +{ unsigned char data; unsigned long flags; int scn2681_ints; @@ -402,7 +177,7 @@ continue; } - if(kbd_mode==APOLLO_KBD_MODE_KEYB) + if (kbd_mode==APOLLO_KBD_MODE_KEYB) dn_keyb_process_key_event(data); else dn_keyb_process_mouse_event(data); @@ -465,46 +240,49 @@ APOLLO_MOUSE_MINOR, "apollomouse", open_mouse, release_mouse,7 }; -int __init dn_keyb_init(void){ +static int __init apollokbd_init(void) +{ + int i; -/* printk("dn_keyb_init\n"); */ + apollokbd_dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REP); + apollokbd_dev.keycode = apollokbd_keycode; - memcpy(key_maps[0], dnplain_map, sizeof(plain_map)); - memcpy(key_maps[1], dnshift_map, sizeof(plain_map)); - memcpy(key_maps[2], dnaltgr_map, sizeof(plain_map)); - memcpy(key_maps[4], dnctrl_map, sizeof(plain_map)); - memcpy(key_maps[5], dnshift_ctrl_map, sizeof(plain_map)); - memcpy(key_maps[8], dnalt_map, sizeof(plain_map)); - memcpy(key_maps[12], dnctrl_alt_map, sizeof(plain_map)); + for (i = 0; i < 0x78; i++) + if (apollokbd_keycode[i]) + set_bit(apollokbd_keycode[i], apollokbd_dev.keybit); + /* program UpDownMode */ + while (!(sio01.sra_csra & 0x4)); + sio01.rhra_thra=0xff; - msedev=register_busmouse(&apollo_mouse); - if (msedev < 0) - printk(KERN_WARNING "Unable to install Apollo mouse driver.\n"); - else - printk(KERN_INFO "Apollo mouse installed.\n"); + while (!(sio01.sra_csra & 0x4)); + sio01.rhra_thra=0x1; - /* program UpDownMode */ + request_irq(1, apollokbd_interrupt, 0, "apollokbd", NULL); - while(!(sio01.sra_csra & 0x4)); - sio01.rhra_thra=0xff; + /* enable receive int on DUART */ + sio01.isr_imr=3; - while(!(sio01.sra_csra & 0x4)); - sio01.rhra_thra=0x1; + apollokbd_dev.name = apollokbd_name; + apollokbd_dev.phys = apollokbd_phys; + apollokbd_dev.idbus = BUS_AMIGA; + apollokbd_dev.idvendor = 0x0001; + apollokbd_dev.idproduct = 0x0001; + apollokbd_dev.idversion = 0x0100; - request_irq(1, dn_keyb_int,0,NULL,NULL); - - /* enable receive int on DUART */ - sio01.isr_imr=3; + input_register_device(&apollokbd_dev); - return 0; + printk(KERN_INFO "input: %s\n", apollokbd_name); + return 0; } -int dn_dummy_kbdrate(struct kbd_repeat *k) { - - printk("dn_dummy_kbdrate\n"); +static void __exit apollokbd_exit(void) +{ + input_unregister_device(&apollokbd_dev); + free_irq(1, apollokbd_interrupt); +} - return 0; +module_init(apollokbd_init); +module_exit(apollokbd_exit); -} |