From: Vojtech Pavlik I'm sending you my collected input-related patches I'd like to see in 2.6.2. I'm sure some will collide with patches from Dmitry, if they do, send the offending patches that you have in your tree to me, and I'll merge them. These are against 2.6.1 (-bk). ChangeSet@1.1521.1.5, 2004-01-18 19:50:00+01:00, akropel1@rochester.rr.com input: Always wait for hid request completion in hiddev before returning to the caller process. ... this one will probably be submitted by Greg KH as well. ChangeSet@1.1521.1.4, 2004-01-18 18:37:38+01:00, deller@gmx.de input: Add support for HP PARISC keyboards to atkbd.c ... an #ifdef __hppa__ patch without any side effects. ChangeSet@1.1521.1.3, 2004-01-18 18:27:53+01:00, deller@gmx.de input: Bugfixes in atkbd and psmouse-base probing. (use unsigned char param[] in atkbd_event, like everywhere else, use param[0] instead of *param at the same place, properly set serio->private to NULL if probe fails in both atkbd and psmouse, and fix preinitializing of the return buffer in *_command() funcitons.) ... rather nice fixes for bugs that have not yet happened. ChangeSet@1.1521.1.2, 2004-01-17 10:05:39+01:00, vojtech@suse.cz input: Key 89 is RO, not ROMAJI. ... trivial renaming, error pointed out by some Japanese guy. ChangeSet@1.1523, 2004-01-16 12:13:42+01:00, marcel@holtmann.org input: Added BUS_BLUETOOTH definition for BlueTooth HID devices. ... for the BlueTooth HID people. ChangeSet@1.1503.12.10, 2004-01-16 06:57:55+01:00, pavel@suse.cz input: Alt-arrow console switch is routinely dropped under high load. This patch fixes it: alt-arrow has to start from console _we want to switch to_, if switch is already pending. ... In 2.6, if you're switching consoles fast while output is going to the screen, you may end up on a different console than you wanted. This fixes it. ChangeSet@1.1503.12.9, 2004-01-15 22:09:09+01:00, johann.deneux@it.uu.se input: Fixes and updates of the USB ForceFeedback drivers. Added Logitech MOMO FF steering wheel ID. ... rather trivial fixes in the FF drivers, plus one added ID. ChangeSet@1.1503.12.8, 2004-01-15 21:51:52+01:00, arvidjaar@mail.ru input: Move devfs entries for joystick into /dev/input ... this may be pointless with devfs going away, but while it remains, let's at least get the locations right. ChangeSet@1.1503.12.7, 2004-01-15 20:34:16+01:00, pebl@math.ku.dk input: i8042.c: Add exists=0 into an error path, change the mux/aux init order to make some of the probing code (second irq probe) unnecessary. ... a fix for potential bug in i8042.c and some trivial cleanup resulting in less code. ChangeSet@1.1503.12.6, 2004-01-15 20:14:40+01:00, doj@cubic.org input: Add backslash and 102nd key to amikbd.c list of scancodes. ... two additional keycodes for some newer Amiga keyboards. ChangeSet@1.1503.12.5, 2004-01-15 20:01:43+01:00, vojtech@suse.cz input: Add IBM GamePad to the BADPAD list. ... a blacklist entry in hid-core.c, adding a quirk for an IBM gamepad, which thus works. ChangeSet@1.1503.12.4, 2004-01-15 18:39:27+01:00, vojtech@ucw.cz input: Add informational printk()s to atkbd.c ... what to do about unknown scancode messages. ChangeSet@1.1503.12.3, 2004-01-15 00:18:13+01:00, vojtech@suse.cz input: Expect only one character in interrupt in i8042.c, this eases the load on the controller (only one status read per interrupt). Also do polling only some time after an interrupt happened. ... this is probably the most controversial one of them all, as it in theory could break some setups, because it changes the access pattern to the i8042 controller. However, it works fine everywhere I could test it, and actually should be nicer to the controller. ChangeSet@1.1503.12.2, 2004-01-15 00:17:18+01:00, vojtech@suse.cz input: Add support for Logitech MX700 mouse. ... trivial one entry added in a table. Makes the MX700 (now more an more common) work correctly with 2.6. ChangeSet@1.1503.12.1, 2004-01-15 00:15:51+01:00, vojtech@suse.cz input: Move keycode definitions around to get as close to 2.4 compatibility as we can at the moment. This also kills KEY_103RD, because PS/2 keyboards don't have it and everyone is expecting to get KEY_BACKSLASH anyway. Fix rawmode generation for PrintScreen key, too. ... this is the big one. It changes all the japanese/brazillian keycodes to original 2.4 numbers. This will break setups for people which already updated to the 2.6.0/2.6.1 numbering, but will make things work for everybody else. I think it should be included now or never. (And I vote for "now" of the two choices, since the other will bring an endless stream of e-mails to me). -- Vojtech Pavlik SuSE Labs, SuSE CR --bg08WKrSYDhXBjb5 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="1.1503.12.1" ChangeSet@1.1503.12.1, 2004-01-15 00:15:51+01:00, vojtech@suse.cz input: Move keycode definitions around to get as close to 2.4 compatibility as we can at the moment. This also kills KEY_103RD, because PS/2 keyboards don't have it and everyone is expecting to get KEY_BACKSLASH anyway. Fix rawmode generation for PrintScreen key, too. --- drivers/char/keyboard.c | 32 +++++---- drivers/input/joydev.c | 4 - drivers/input/keyboard/98kbd.c | 6 - drivers/input/keyboard/amikbd.c | 4 - drivers/input/keyboard/atkbd.c | 52 ++++++++++----- drivers/input/keyboard/hpps2atkbd.h | 105 ++++++++++++++++++++++++++++++ drivers/input/keyboard/maple_keyb.c | 10 +- drivers/input/mouse/logips2pp.c | 2 drivers/input/mouse/psmouse-base.c | 14 +++- drivers/input/serio/i8042.c | 123 +++++++++++++++--------------------- drivers/macintosh/adbhid.c | 4 - drivers/usb/input/hid-core.c | 10 ++ drivers/usb/input/hid-ff.c | 9 +- drivers/usb/input/hid-input.c | 10 +- drivers/usb/input/hid-lgff.c | 21 ++---- drivers/usb/input/hid.h | 1 drivers/usb/input/hiddev.c | 1 drivers/usb/input/usbkbd.c | 10 +- include/linux/input.h | 59 +++++++---------- 19 files changed, 303 insertions(+), 174 deletions(-) diff -puN drivers/char/keyboard.c~input-fixes-and-updates drivers/char/keyboard.c --- 25/drivers/char/keyboard.c~input-fixes-and-updates 2004-01-19 22:21:54.000000000 -0800 +++ 25-akpm/drivers/char/keyboard.c 2004-01-19 22:21:54.000000000 -0800 @@ -493,9 +493,13 @@ static void fn_lastcons(struct vc_data * static void fn_dec_console(struct vc_data *vc, struct pt_regs *regs) { - int i; - - for (i = fg_console-1; i != fg_console; i--) { + int i, cur = fg_console; + + /* Currently switching? Queue this next switch relative to that. */ + if (want_console != -1) + cur = want_console; + + for (i = cur-1; i != cur; i--) { if (i == -1) i = MAX_NR_CONSOLES-1; if (vc_cons_allocated(i)) @@ -506,9 +510,13 @@ static void fn_dec_console(struct vc_dat static void fn_inc_console(struct vc_data *vc, struct pt_regs *regs) { - int i; + int i, cur = fg_console; + + /* Currently switching? Queue this next switch relative to that. */ + if (want_console != -1) + cur = want_console; - for (i = fg_console+1; i != fg_console; i++) { + for (i = cur+1; i != cur; i++) { if (i == MAX_NR_CONSOLES) i = 0; if (vc_cons_allocated(i)) @@ -941,14 +949,14 @@ static unsigned short x86_keycodes[256] 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 93, 86, 87, 88, 94, 95, 85,259,375,260, 90, - 284,285,309,311,312, 91,327,328,329,331,333,335,336,337,338,339, - 367,288,302,304,350, 89,334,326,116,377,109,111,126,347,348,349, + 80, 81, 82, 83, 84,118, 86, 87, 88,115,120,119,121,112,123, 92, + 284,285,309,298,312, 91,327,328,329,331,333,335,336,337,338,339, + 367,288,302,304,350, 89,334,326,267,126,268,269,125,347,348,349, 360,261,262,263,298,376,100,101,321,316,373,286,289,102,351,355, 103,104,105,275,287,279,306,106,274,107,294,364,358,363,362,361, 291,108,381,281,290,272,292,305,280, 99,112,257,258,359,113,114, - 264,117,271,374,379,115,125,273,121,123, 92,265,266,267,268,269, - 120,119,118,277,278,282,283,295,296,297,299,300,301,293,303,307, + 264,117,271,374,379,265,266, 93, 94, 95, 85,259,375,260, 90,116, + 377,109,111,277,278,282,283,295,296,297,299,300,301,293,303,307, 308,310,313,314,315,317,318,319,320,357,322,323,324,325,276,330, 332,340,365,342,343,344,345,346,356,270,341,368,369,370,371,372 }; @@ -978,10 +986,10 @@ static int emulate_raw(struct vc_data *v put_queue(vc, 0x1d | up_flag); put_queue(vc, 0x45 | up_flag); return 0; - case KEY_LANG1: + case KEY_HANGUEL: if (!up_flag) put_queue(vc, 0xf1); return 0; - case KEY_LANG2: + case KEY_HANJA: if (!up_flag) put_queue(vc, 0xf2); return 0; } diff -puN drivers/input/joydev.c~input-fixes-and-updates drivers/input/joydev.c --- 25/drivers/input/joydev.c~input-fixes-and-updates 2004-01-19 22:21:54.000000000 -0800 +++ 25-akpm/drivers/input/joydev.c 2004-01-19 22:22:13.000000000 -0800 @@ -143,7 +143,7 @@ static int joydev_fasync(int fd, struct static void joydev_free(struct joydev *joydev) { - devfs_remove("js%d", joydev->minor); + devfs_remove("input/js%d", joydev->minor); joydev_table[joydev->minor] = NULL; class_simple_device_remove(MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + joydev->minor)); kfree(joydev); @@ -447,7 +447,7 @@ static struct input_handle *joydev_conne S_IFCHR|S_IRUGO|S_IWUSR, "js%d", minor); class_simple_device_add(input_class, MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + minor), - dev->dev, "js%d", minor); + dev->dev, "input/js%d", minor); return &joydev->handle; } diff -puN drivers/input/keyboard/98kbd.c~input-fixes-and-updates drivers/input/keyboard/98kbd.c --- 25/drivers/input/keyboard/98kbd.c~input-fixes-and-updates 2004-01-19 22:21:54.000000000 -0800 +++ 25-akpm/drivers/input/keyboard/98kbd.c 2004-01-19 22:21:54.000000000 -0800 @@ -47,9 +47,9 @@ static unsigned char kbd98_keycode[256] 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 43, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 41, 26, 28, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 27, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 12, 57,184,109,104,110,111,103,105,106,108,102,107, - 74, 98, 71, 72, 73, 55, 75, 76, 77, 78, 79, 80, 81,117, 82,124, - 83,185, 87, 88, 85, 89, 90, 0, 0, 0, 0, 0, 0, 0,102, 0, + 51, 52, 53, 12, 57, 92,109,104,110,111,103,105,106,108,102,107, + 74, 98, 71, 72, 73, 55, 75, 76, 77, 78, 79, 80, 81,117, 82,121, + 83, 94, 87, 88,183,184,185, 0, 0, 0, 0, 0, 0, 0,102, 0, 99,133, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 0, 0, 0, 0, 54, 58, 42, 56, 29 }; diff -puN drivers/input/keyboard/amikbd.c~input-fixes-and-updates drivers/input/keyboard/amikbd.c --- 25/drivers/input/keyboard/amikbd.c~input-fixes-and-updates 2004-01-19 22:21:54.000000000 -0800 +++ 25-akpm/drivers/input/keyboard/amikbd.c 2004-01-19 22:21:54.000000000 -0800 @@ -48,8 +48,8 @@ MODULE_LICENSE("GPL"); static unsigned char amikbd_keycode[0x78] = { 41, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 43, 0, 82, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 0, 79, 80, 81, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 0, 0, 75, 76, 77, - 0, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 0, 83, 71, 72, 73, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 43, 0, 75, 76, 77, + 86, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 0, 83, 71, 72, 73, 57, 14, 15, 96, 28, 1,111, 0, 0, 0, 74, 0,103,108,106,105, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,179,180, 98, 55, 78,138, 42, 54, 58, 29, 56,100,125,126 diff -puN drivers/input/keyboard/atkbd.c~input-fixes-and-updates drivers/input/keyboard/atkbd.c --- 25/drivers/input/keyboard/atkbd.c~input-fixes-and-updates 2004-01-19 22:21:54.000000000 -0800 +++ 25-akpm/drivers/input/keyboard/atkbd.c 2004-01-19 22:21:54.000000000 -0800 @@ -38,7 +38,7 @@ MODULE_LICENSE("GPL"); static int atkbd_set = 2; module_param_named(set, atkbd_set, int, 0); MODULE_PARM_DESC(set, "Select keyboard code set (2 = default, 3, 4)"); -#if defined(__i386__) || defined (__x86_64__) +#if defined(__i386__) || defined(__x86_64__) || defined(__hppa__) static int atkbd_reset; #else static int atkbd_reset = 1; @@ -57,15 +57,19 @@ MODULE_PARM_DESC(softrepeat, "Use softwa * are loadable via an userland utility. */ +#if defined(__hppa__) +#include "hpps2atkbd.h" +#else + static unsigned char atkbd_set2_keycode[512] = { 0, 67, 65, 63, 61, 59, 60, 88, 0, 68, 66, 64, 62, 15, 41,117, - 0, 56, 42,182, 29, 16, 2, 0, 0, 0, 44, 31, 30, 17, 3, 0, - 0, 46, 45, 32, 18, 5, 4,186, 0, 57, 47, 33, 20, 19, 6, 85, - 0, 49, 48, 35, 34, 21, 7, 89, 0, 0, 50, 36, 22, 8, 9, 90, + 0, 56, 42, 93, 29, 16, 2, 0, 0, 0, 44, 31, 30, 17, 3, 0, + 0, 46, 45, 32, 18, 5, 4, 95, 0, 57, 47, 33, 20, 19, 6,183, + 0, 49, 48, 35, 34, 21, 7,184, 0, 0, 50, 36, 22, 8, 9,185, 0, 51, 37, 23, 24, 11, 10, 0, 0, 52, 53, 38, 39, 25, 12, 0, - 0,181, 40, 0, 26, 13, 0, 0, 58, 54, 28, 27, 0, 43, 0,194, - 0, 86,193,192,184, 0, 14,185, 0, 79,182, 75, 71,124, 0, 0, + 0, 89, 40, 0, 26, 13, 0, 0, 58, 54, 28, 27, 0, 43, 0, 85, + 0, 86, 91, 90, 92, 0, 14, 94, 0, 79,124, 75, 71,121, 0, 0, 82, 83, 80, 76, 77, 72, 1, 69, 87, 78, 81, 74, 55, 73, 70, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -80,6 +84,8 @@ static unsigned char atkbd_set2_keycode[ 0, 0, 0, 65, 99, }; +#endif + static unsigned char atkbd_set3_keycode[512] = { 0, 0, 0, 0, 0, 0, 0, 59, 1,138,128,129,130, 15, 41, 60, @@ -87,11 +93,11 @@ static unsigned char atkbd_set3_keycode[ 134, 46, 45, 32, 18, 5, 4, 63,135, 57, 47, 33, 20, 19, 6, 64, 136, 49, 48, 35, 34, 21, 7, 65,137,100, 50, 36, 22, 8, 9, 66, 125, 51, 37, 23, 24, 11, 10, 67,126, 52, 53, 38, 39, 25, 12, 68, - 113,114, 40, 84, 26, 13, 87, 99, 97, 54, 28, 27, 43, 84, 88, 70, + 113,114, 40, 43, 26, 13, 87, 99, 97, 54, 28, 27, 43, 43, 88, 70, 108,105,119,103,111,107, 14,110, 0, 79,106, 75, 71,109,102,104, - 82, 83, 80, 76, 77, 72, 69, 98, 0, 96, 81, 0, 78, 73, 55, 85, + 82, 83, 80, 76, 77, 72, 69, 98, 0, 96, 81, 0, 78, 73, 55,183, - 89, 90, 91, 92, 74,185,184,182, 0, 0, 0,125,126,127,112, 0, + 184,185,186,187, 74, 94, 92, 93, 0, 0, 0,125,126,127,112, 0, 0,139,150,163,165,115,152,150,166,140,160,154,113,114,167,168, 148,149,147,140 }; @@ -246,10 +252,10 @@ static irqreturn_t atkbd_interrupt(struc atkbd->release = 1; goto out; case ATKBD_RET_HANGUEL: - atkbd_report_key(&atkbd->dev, regs, KEY_LANG1, 3); + atkbd_report_key(&atkbd->dev, regs, KEY_HANGUEL, 3); goto out; case ATKBD_RET_HANJA: - atkbd_report_key(&atkbd->dev, regs, KEY_LANG2, 3); + atkbd_report_key(&atkbd->dev, regs, KEY_HANJA, 3); goto out; case ATKBD_RET_ERR: printk(KERN_WARNING "atkbd.c: Keyboard on %s reports too many keys pressed.\n", serio->phys); @@ -272,6 +278,11 @@ static irqreturn_t atkbd_interrupt(struc atkbd->release ? "released" : "pressed", atkbd->translated ? "translated" : "raw", atkbd->set, code, serio->phys); + if (atkbd->translated && atkbd->set == 2 && code == 0x7a) + printk(KERN_WARNING "atkbd.c: This is an XFree86 bug. It shouldn't access" + "hardware directly.\n"); + else + printk(KERN_WARNING "atkbd.c: Use 'setkeycodes %s%02x ' to make it known.\n", code & 0x80 ? "e0" : "", code & 0x7f); break; default: value = atkbd->release ? 0 : @@ -338,6 +349,10 @@ static int atkbd_command(struct atkbd *a if (command == ATKBD_CMD_RESET_BAT) timeout = 2000000; /* 2 sec */ + + if (receive && param) + for (i = 0; i < receive; i++) + atkbd->cmdbuf[(receive - 1) - i] = param[i]; if (command & 0xff) if (atkbd_sendbyte(atkbd, command & 0xff)) @@ -390,7 +405,7 @@ static int atkbd_event(struct input_dev 133, 149, 167, 182, 200, 217, 232, 250, 270, 303, 333, 370, 400, 435, 470, 500 }; const short delay[4] = { 250, 500, 750, 1000 }; - char param[2]; + unsigned char param[2]; int i, j; if (!atkbd->write) @@ -400,9 +415,9 @@ static int atkbd_event(struct input_dev case EV_LED: - *param = (test_bit(LED_SCROLLL, dev->led) ? 1 : 0) - | (test_bit(LED_NUML, dev->led) ? 2 : 0) - | (test_bit(LED_CAPSL, dev->led) ? 4 : 0); + param[0] = (test_bit(LED_SCROLLL, dev->led) ? 1 : 0) + | (test_bit(LED_NUML, dev->led) ? 2 : 0) + | (test_bit(LED_CAPSL, dev->led) ? 4 : 0); atkbd_command(atkbd, param, ATKBD_CMD_SETLEDS); if (atkbd->set == 4) { @@ -461,6 +476,7 @@ static int atkbd_probe(struct atkbd *atk * should make sure we don't try to set the LEDs on it. */ + param[0] = param[1] = 0xa5; /* initialize with invalid values */ if (atkbd_command(atkbd, param, ATKBD_CMD_GETID)) { /* @@ -479,6 +495,11 @@ static int atkbd_probe(struct atkbd *atk return -1; atkbd->id = (param[0] << 8) | param[1]; + if (atkbd->id == 0xaca1 && atkbd->translated) { + printk(KERN_ERR "atkbd.c: NCD terminal keyboards are only supported on non-translating\n"); + printk(KERN_ERR "atkbd.c: controllers. Use i8042.direct=1 to disable translation.\n"); + return -1; + } return 0; } @@ -662,6 +683,7 @@ static void atkbd_connect(struct serio * if (atkbd_probe(atkbd)) { serio_close(serio); + serio->private = NULL; kfree(atkbd); return; } diff -puN /dev/null drivers/input/keyboard/hpps2atkbd.h --- /dev/null 2002-08-30 16:31:37.000000000 -0700 +++ 25-akpm/drivers/input/keyboard/hpps2atkbd.h 2004-01-19 22:21:54.000000000 -0800 @@ -0,0 +1,105 @@ +/* + * drivers/input/keyboard/hpps2atkbd.h + * + * Copyright (c) 2004 Helge Deller + * Copyright (c) 2002 Laurent Canet + * Copyright (c) 2002 Thibaut Varene + * + * based on linux-2.4's hp_mouse.c & hp_keyb.c + * Copyright (c) 1999 Alex deVries + * Copyright (c) 1999-2000 Philipp Rumpf + * Copyright (c) 2000 Xavier Debacker + * Copyright (c) 2000-2001 Thomas Marteau + * + * HP PS/2 AT-compatible Keyboard, found in PA/RISC Workstations + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + */ + + +#define KBD_UNKNOWN 0 + +/* Raw SET 2 scancode table */ + +#if 0 + /* conflicting keys between a RDI Precisionbook keyboard and a normal HP keyboard */ + keytable[0x07] = KEY_F1; /* KEY_F12 */ + keytable[0x11] = KEY_LEFTCTRL; /* KEY_LEFTALT */ + keytable[0x14] = KEY_CAPSLOCK; /* KEY_LEFTCTRL */ + keytable[0x61] = KEY_LEFT; /* KEY_102ND */ +#endif + + +static unsigned char atkbd_set2_keycode[512] = { + + /* 00 */ KBD_UNKNOWN, KEY_F9, KBD_UNKNOWN, KEY_F5, KEY_F3, KEY_F1, KEY_F2, KEY_F1, + /* 08 */ KEY_ESC, KEY_F10, KEY_F8, KEY_F6, KEY_F4, KEY_TAB, KEY_GRAVE, KEY_F2, + /* 10 */ KBD_UNKNOWN, KEY_LEFTCTRL, KEY_LEFTSHIFT, KBD_UNKNOWN, KEY_CAPSLOCK, KEY_Q, KEY_1, KEY_F3, + /* 18 */ KBD_UNKNOWN, KEY_LEFTALT, KEY_Z, KEY_S, KEY_A, KEY_W, KEY_2, KEY_F4, + /* 20 */ KBD_UNKNOWN, KEY_C, KEY_X, KEY_D, KEY_E, KEY_4, KEY_3, KEY_F5, + /* 28 */ KBD_UNKNOWN, KEY_SPACE, KEY_V, KEY_F, KEY_T, KEY_R, KEY_5, KEY_F6, + /* 30 */ KBD_UNKNOWN, KEY_N, KEY_B, KEY_H, KEY_G, KEY_Y, KEY_6, KEY_F7, + /* 38 */ KBD_UNKNOWN, KEY_RIGHTALT, KEY_M, KEY_J, KEY_U, KEY_7, KEY_8, KEY_F8, + /* 40 */ KBD_UNKNOWN, KEY_COMMA, KEY_K, KEY_I, KEY_O, KEY_0, KEY_9, KEY_F9, + /* 48 */ KBD_UNKNOWN, KEY_DOT, KEY_SLASH, KEY_L, KEY_SEMICOLON, KEY_P, KEY_MINUS, KEY_F10, + /* 50 */ KBD_UNKNOWN, KBD_UNKNOWN, KEY_APOSTROPHE,KBD_UNKNOWN, KEY_LEFTBRACE, KEY_EQUAL, KEY_F11, KEY_SYSRQ, + /* 58 */ KEY_CAPSLOCK, KEY_RIGHTSHIFT,KEY_ENTER, KEY_RIGHTBRACE,KEY_BACKSLASH, KEY_BACKSLASH,KEY_F12, KEY_SCROLLLOCK, + /* 60 */ KEY_DOWN, KEY_LEFT, KEY_PAUSE, KEY_UP, KEY_DELETE, KEY_END, KEY_BACKSPACE, KEY_INSERT, + /* 68 */ KBD_UNKNOWN, KEY_KP1, KEY_RIGHT, KEY_KP4, KEY_KP7, KEY_PAGEDOWN, KEY_HOME, KEY_PAGEUP, + /* 70 */ KEY_KP0, KEY_KPDOT, KEY_KP2, KEY_KP5, KEY_KP6, KEY_KP8, KEY_ESC, KEY_NUMLOCK, + /* 78 */ KEY_F11, KEY_KPPLUS, KEY_KP3, KEY_KPMINUS, KEY_KPASTERISK,KEY_KP9, KEY_SCROLLLOCK,KEY_103RD, + /* 80 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* 88 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* 90 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* 98 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* a0 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* a8 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* b0 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* b8 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* c0 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* c8 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* d0 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* d8 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* e0 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* e8 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* f0 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* f8 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + + /* These are offset for escaped keycodes: */ + + /* 00 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KEY_F7, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* 08 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KEY_LEFTMETA, KEY_RIGHTMETA, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* 10 */ KBD_UNKNOWN, KEY_RIGHTALT, KBD_UNKNOWN, KBD_UNKNOWN, KEY_RIGHTCTRL, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* 18 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* 20 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* 28 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* 30 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* 38 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* 40 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* 48 */ KBD_UNKNOWN, KBD_UNKNOWN, KEY_KPSLASH, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* 50 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* 58 */ KBD_UNKNOWN, KBD_UNKNOWN, KEY_KPENTER, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* 60 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* 68 */ KBD_UNKNOWN, KEY_END, KBD_UNKNOWN, KEY_LEFT, KEY_HOME, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* 70 */ KEY_INSERT, KEY_DELETE, KEY_DOWN, KBD_UNKNOWN, KEY_RIGHT, KEY_UP, KBD_UNKNOWN, KBD_UNKNOWN, + /* 78 */ KBD_UNKNOWN, KBD_UNKNOWN, KEY_PAGEDOWN, KBD_UNKNOWN, KEY_SYSRQ, KEY_PAGEUP, KBD_UNKNOWN, KBD_UNKNOWN, + /* 80 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* 88 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* 90 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* 98 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* a0 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* a8 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* b0 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* b8 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* c0 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* c8 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* d0 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* d8 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* e0 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* e8 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* f0 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, + /* f8 */ KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN, KBD_UNKNOWN + +}; diff -puN drivers/input/keyboard/maple_keyb.c~input-fixes-and-updates drivers/input/keyboard/maple_keyb.c --- 25/drivers/input/keyboard/maple_keyb.c~input-fixes-and-updates 2004-01-19 22:21:54.000000000 -0800 +++ 25-akpm/drivers/input/keyboard/maple_keyb.c 2004-01-19 22:21:54.000000000 -0800 @@ -20,13 +20,13 @@ static unsigned char dc_kbd_keycode[256] 0, 0, 0, 0, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38, 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 21, 44, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 28, 1, 14, 15, 57, 12, 13, 26, - 27, 43, 84, 39, 40, 41, 51, 52, 53, 58, 59, 60, 61, 62, 63, 64, + 27, 43, 43, 39, 40, 41, 51, 52, 53, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 87, 88, 99, 70,119,110,102,104,111,107,109,106, 105,108,103, 69, 98, 55, 74, 78, 96, 79, 80, 81, 75, 76, 77, 71, - 72, 73, 82, 83, 86,127,116,117, 85, 89, 90, 91, 92, 93, 94, 95, - 120,121,122,123,134,138,130,132,128,129,131,137,133,135,136,113, - 115,114, 0, 0, 0,124, 0,181,182,183,184,185,186,187,188,189, - 190,191,192,193,194,195,196,197,198, 0, 0, 0, 0, 0, 0, 0, + 72, 73, 82, 83, 86,127,116,117,183,184,185,186,187,188,189,190, + 191,192,193,194,134,138,130,132,128,129,131,137,133,135,136,113, + 115,114, 0, 0, 0,121, 0, 89, 93,124, 92, 94, 95, 0, 0, 0, + 122,123, 90, 91, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, diff -puN drivers/input/mouse/logips2pp.c~input-fixes-and-updates drivers/input/mouse/logips2pp.c --- 25/drivers/input/mouse/logips2pp.c~input-fixes-and-updates 2004-01-19 22:21:54.000000000 -0800 +++ 25-akpm/drivers/input/mouse/logips2pp.c 2004-01-19 22:21:54.000000000 -0800 @@ -150,7 +150,7 @@ static int ps2pp_detect_model(struct psm static int logitech_wheel[] = { 52, 53, 75, 76, 80, 81, 83, 88, 112, -1 }; static int logitech_ps2pp[] = { 12, 13, 40, 41, 42, 43, 50, 51, 52, 53, 73, 75, 76, 80, 81, 83, 88, 96, 97, 112, -1 }; - static int logitech_mx[] = { 112, -1 }; + static int logitech_mx[] = { 61, 112, -1 }; psmouse->vendor = "Logitech"; psmouse->model = ((param[0] >> 4) & 0x07) | ((param[0] << 3) & 0x78); diff -puN drivers/input/mouse/psmouse-base.c~input-fixes-and-updates drivers/input/mouse/psmouse-base.c --- 25/drivers/input/mouse/psmouse-base.c~input-fixes-and-updates 2004-01-19 22:21:54.000000000 -0800 +++ 25-akpm/drivers/input/mouse/psmouse-base.c 2004-01-19 22:21:54.000000000 -0800 @@ -231,6 +231,11 @@ int psmouse_command(struct psmouse *psmo if (command == PSMOUSE_CMD_RESET_BAT) timeout = 4000000; /* 4 sec */ + /* initialize cmdbuf with preset values from param */ + if (receive) + for (i = 0; i < receive; i++) + psmouse->cmdbuf[(receive - 1) - i] = param[i]; + if (command & 0xff) if (psmouse_sendbyte(psmouse, command & 0xff)) return (psmouse->cmdcnt = 0) - 1; @@ -241,8 +246,9 @@ int psmouse_command(struct psmouse *psmo while (psmouse->cmdcnt && timeout--) { - if (psmouse->cmdcnt == 1 && command == PSMOUSE_CMD_RESET_BAT) - timeout = 100000; + if (psmouse->cmdcnt == 1 && command == PSMOUSE_CMD_RESET_BAT && + timeout > 100000) /* do not run in a endless loop */ + timeout = 100000; /* 1 sec */ if (psmouse->cmdcnt == 1 && command == PSMOUSE_CMD_GETID && psmouse->cmdbuf[1] != 0xab && psmouse->cmdbuf[1] != 0xac) { @@ -410,7 +416,7 @@ static int psmouse_probe(struct psmouse * in case of an IntelliMouse in 4-byte mode or 0x04 for IM Explorer. */ - param[0] = param[1] = 0xa5; + param[0] = 0xa5; if (psmouse_command(psmouse, param, PSMOUSE_CMD_GETID)) return -1; @@ -574,12 +580,14 @@ static void psmouse_connect(struct serio serio->private = psmouse; if (serio_open(serio, dev)) { kfree(psmouse); + serio->private = NULL; return; } if (psmouse_probe(psmouse) <= 0) { serio_close(serio); kfree(psmouse); + serio->private = NULL; return; } diff -puN drivers/input/serio/i8042.c~input-fixes-and-updates drivers/input/serio/i8042.c --- 25/drivers/input/serio/i8042.c~input-fixes-and-updates 2004-01-19 22:21:54.000000000 -0800 +++ 25-akpm/drivers/input/serio/i8042.c 2004-01-19 22:21:54.000000000 -0800 @@ -377,65 +377,60 @@ static irqreturn_t i8042_interrupt(int i unsigned long flags; unsigned char str, data; unsigned int dfl; - struct { - int data; - int str; - } buffer[I8042_BUFFER_SIZE]; - int i, j = 0; spin_lock_irqsave(&i8042_lock, flags); - - while (j < I8042_BUFFER_SIZE && - (buffer[j].str = i8042_read_status()) & I8042_STR_OBF) - buffer[j++].data = i8042_read_data(); - + str = i8042_read_status(); + data = i8042_read_data(); spin_unlock_irqrestore(&i8042_lock, flags); - for (i = 0; i < j; i++) { - - str = buffer[i].str; - data = buffer[i].data; - - dfl = ((str & I8042_STR_PARITY) ? SERIO_PARITY : 0) | - ((str & I8042_STR_TIMEOUT) ? SERIO_TIMEOUT : 0); - - if (i8042_mux_values[0].exists && (str & I8042_STR_AUXDATA)) { - - if (str & I8042_STR_MUXERR) { - switch (data) { - case 0xfd: - case 0xfe: dfl = SERIO_TIMEOUT; break; - case 0xff: dfl = SERIO_PARITY; break; - } - data = 0xfe; - } else dfl = 0; - - dbg("%02x <- i8042 (interrupt, aux%d, %d%s%s)", - data, (str >> 6), irq, - dfl & SERIO_PARITY ? ", bad parity" : "", - dfl & SERIO_TIMEOUT ? ", timeout" : ""); - - serio_interrupt(i8042_mux_port + ((str >> 6) & 3), data, dfl, regs); - continue; - } + if (~str & I8042_STR_OBF) { + if (irq) dbg("Interrupt %d, without any data", irq); + return IRQ_RETVAL(0); + } + + dfl = ((str & I8042_STR_PARITY) ? SERIO_PARITY : 0) | + ((str & I8042_STR_TIMEOUT) ? SERIO_TIMEOUT : 0); + + if (i8042_mux_values[0].exists && (str & I8042_STR_AUXDATA)) { + + if (str & I8042_STR_MUXERR) { + switch (data) { + case 0xfd: + case 0xfe: dfl = SERIO_TIMEOUT; break; + case 0xff: dfl = SERIO_PARITY; break; + } + data = 0xfe; + } else dfl = 0; - dbg("%02x <- i8042 (interrupt, %s, %d%s%s)", - data, (str & I8042_STR_AUXDATA) ? "aux" : "kbd", irq, + dbg("%02x <- i8042 (interrupt, aux%d, %d%s%s)", + data, (str >> 6), irq, dfl & SERIO_PARITY ? ", bad parity" : "", dfl & SERIO_TIMEOUT ? ", timeout" : ""); - if (i8042_aux_values.exists && (str & I8042_STR_AUXDATA)) { - serio_interrupt(&i8042_aux_port, data, dfl, regs); - continue; - } + serio_interrupt(i8042_mux_port + ((str >> 6) & 3), data, dfl, regs); + + goto irq_ret; + } - if (!i8042_kbd_values.exists) - continue; + dbg("%02x <- i8042 (interrupt, %s, %d%s%s)", + data, (str & I8042_STR_AUXDATA) ? "aux" : "kbd", irq, + dfl & SERIO_PARITY ? ", bad parity" : "", + dfl & SERIO_TIMEOUT ? ", timeout" : ""); - serio_interrupt(&i8042_kbd_port, data, dfl, regs); + if (i8042_aux_values.exists && (str & I8042_STR_AUXDATA)) { + serio_interrupt(&i8042_aux_port, data, dfl, regs); + goto irq_ret; } - return IRQ_RETVAL(j); + if (!i8042_kbd_values.exists) + goto irq_ret; + + serio_interrupt(&i8042_kbd_port, data, dfl, regs); + +irq_ret: + + mod_timer(&i8042_timer, jiffies + I8042_POLL_PERIOD); + return IRQ_RETVAL(1); } /* @@ -519,17 +514,8 @@ static int i8042_enable_mux_ports(struct static int __init i8042_check_mux(struct i8042_values *values) { - static int i8042_check_mux_cookie; unsigned char mux_version; -/* - * Check if AUX irq is available. - */ - if (request_irq(values->irq, i8042_interrupt, SA_SHIRQ, - "i8042", &i8042_check_mux_cookie)) - return -1; - free_irq(values->irq, &i8042_check_mux_cookie); - if (i8042_enable_mux_mode(values, &mux_version)) return -1; @@ -635,6 +621,7 @@ static int __init i8042_port_register(st if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) { printk(KERN_WARNING "i8042.c: Can't write CTR while registering.\n"); + values->exists = 0; return -1; } @@ -653,7 +640,6 @@ static int __init i8042_port_register(st static void i8042_timer_func(unsigned long data) { i8042_interrupt(0, NULL, NULL); - mod_timer(&i8042_timer, jiffies + I8042_POLL_PERIOD); } @@ -666,8 +652,6 @@ static void i8042_timer_func(unsigned lo static int i8042_controller_init(void) { - if (i8042_noaux) - i8042_nomux = 1; /* * Test the i8042. We need to know if it thinks it's working correctly * before doing anything else. @@ -939,6 +923,9 @@ int __init i8042_init(void) dbg_init(); + init_timer(&i8042_timer); + i8042_timer.function = i8042_timer_func; + if (i8042_platform_init()) return -EBUSY; @@ -951,20 +938,18 @@ int __init i8042_init(void) if (i8042_dumbkbd) i8042_kbd_port.write = NULL; - for (i = 0; i < 4; i++) - i8042_init_mux_values(i8042_mux_values + i, i8042_mux_port + i, i); - - if (!i8042_nomux && !i8042_check_mux(&i8042_aux_values)) - for (i = 0; i < 4; i++) - i8042_port_register(i8042_mux_values + i, i8042_mux_port + i); - else - if (!i8042_noaux && !i8042_check_aux(&i8042_aux_values)) + if (!i8042_noaux && !i8042_check_aux(&i8042_aux_values)) { + if (!i8042_nomux && !i8042_check_mux(&i8042_aux_values)) + for (i = 0; i < 4; i++) { + i8042_init_mux_values(i8042_mux_values + i, i8042_mux_port + i, i); + i8042_port_register(i8042_mux_values + i, i8042_mux_port + i); + } + else i8042_port_register(&i8042_aux_values, &i8042_aux_port); + } i8042_port_register(&i8042_kbd_values, &i8042_kbd_port); - init_timer(&i8042_timer); - i8042_timer.function = i8042_timer_func; mod_timer(&i8042_timer, jiffies + I8042_POLL_PERIOD); if (sysdev_class_register(&kbc_sysclass) == 0) { diff -puN drivers/macintosh/adbhid.c~input-fixes-and-updates drivers/macintosh/adbhid.c --- 25/drivers/macintosh/adbhid.c~input-fixes-and-updates 2004-01-19 22:21:54.000000000 -0800 +++ 25-akpm/drivers/macintosh/adbhid.c 2004-01-19 22:21:54.000000000 -0800 @@ -69,8 +69,8 @@ unsigned char adb_to_linux_keycodes[128] 22, 26, 23, 25, 28, 38, 36, 40, 37, 39, 43, 51, 53, 49, 50, 52, 15, 57, 41, 14, 96, 1, 29,125, 42, 58, 56,105,106,108,103, 0, 0, 83, 0, 55, 0, 78, 0, 69, 0, 0, 0, 98, 96, 0, 74, 0, - 0,117, 82, 79, 80, 81, 75, 76, 77, 71, 0, 72, 73,183,181,124, - 63, 64, 65, 61, 66, 67,191, 87,190, 99, 0, 70, 0, 68,101, 88, + 0,117, 82, 79, 80, 81, 75, 76, 77, 71, 0, 72, 73,124, 89,121, + 63, 64, 65, 61, 66, 67,123, 87,122, 99, 0, 70, 0, 68,101, 88, 0,119,110,102,104,111, 62,107, 60,109, 59, 54,100, 97,126,116 }; diff -puN drivers/usb/input/hid-core.c~input-fixes-and-updates drivers/usb/input/hid-core.c --- 25/drivers/usb/input/hid-core.c~input-fixes-and-updates 2004-01-19 22:21:54.000000000 -0800 +++ 25-akpm/drivers/usb/input/hid-core.c 2004-01-19 22:21:54.000000000 -0800 @@ -1357,6 +1357,9 @@ void hid_init_reports(struct hid_device #define USB_VENDOR_ID_BERKSHIRE 0x0c98 #define USB_DEVICE_ID_BERKSHIRE_PCWD 0x1140 +#define USB_VENDOR_ID_ALPS 0x0433 +#define USB_DEVICE_ID_IBM_GAMEPAD 0x1101 + struct hid_blacklist { __u16 idVendor; __u16 idProduct; @@ -1407,6 +1410,7 @@ struct hid_blacklist { { USB_VENDOR_ID_ESSENTIAL_REALITY, USB_DEVICE_ID_ESSENTIAL_REALITY_P5, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU, HID_QUIRK_2WHEEL_MOUSE_HACK }, { USB_VENDOR_ID_BERKSHIRE, USB_DEVICE_ID_BERKSHIRE_PCWD, HID_QUIRK_IGNORE }, + { USB_VENDOR_ID_ALPS, USB_DEVICE_ID_IBM_GAMEPAD, HID_QUIRK_BADPAD }, { 0, 0 } }; @@ -1525,9 +1529,9 @@ static struct hid_device *usb_hid_config continue; if (!(hid->urbout = usb_alloc_urb(0, GFP_KERNEL))) goto fail; - pipe = usb_sndbulkpipe(dev, endpoint->bEndpointAddress); - usb_fill_bulk_urb(hid->urbout, dev, pipe, hid->outbuf, 0, - hid_irq_out, hid); + pipe = usb_sndintpipe(dev, endpoint->bEndpointAddress); + usb_fill_int_urb(hid->urbout, dev, pipe, hid->outbuf, 0, + hid_irq_out, hid, 1); hid->urbout->transfer_dma = hid->outbuf_dma; hid->urbout->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; } diff -puN drivers/usb/input/hiddev.c~input-fixes-and-updates drivers/usb/input/hiddev.c --- 25/drivers/usb/input/hiddev.c~input-fixes-and-updates 2004-01-19 22:21:54.000000000 -0800 +++ 25-akpm/drivers/usb/input/hiddev.c 2004-01-19 22:21:54.000000000 -0800 @@ -509,6 +509,7 @@ static int hiddev_ioctl(struct inode *in return -EINVAL; hid_submit_report(hid, report, USB_DIR_IN); + hid_wait_io(hid); return 0; diff -puN drivers/usb/input/hid-ff.c~input-fixes-and-updates drivers/usb/input/hid-ff.c --- 25/drivers/usb/input/hid-ff.c~input-fixes-and-updates 2004-01-19 22:21:54.000000000 -0800 +++ 25-akpm/drivers/usb/input/hid-ff.c 2004-01-19 22:21:54.000000000 -0800 @@ -5,7 +5,7 @@ * Not all hid devices use the same protocol. For example, some use PID, * other use their own proprietary procotol. * - * Copyright (c) 2002 Johann Deneux + * Copyright (c) 2002-2004 Johann Deneux */ /* @@ -24,7 +24,7 @@ * 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 + * e-mail - mail your message to */ #include @@ -52,8 +52,9 @@ struct hid_ff_initializer { static struct hid_ff_initializer inits[] = { #ifdef CONFIG_LOGITECH_FF - {0x46d, 0xc211, hid_lgff_init}, - {0x46d, 0xc283, hid_lgff_init}, + {0x46d, 0xc211, hid_lgff_init}, // Logitech Cordless rumble pad + {0x46d, 0xc283, hid_lgff_init}, // Logitech Wingman Force 3d + {0x46d, 0xc295, hid_lgff_init}, // Logitech MOMO force wheel #endif #ifdef CONFIG_HID_PID {0x45e, 0x001b, hid_pid_init}, diff -puN drivers/usb/input/hid.h~input-fixes-and-updates drivers/usb/input/hid.h --- 25/drivers/usb/input/hid.h~input-fixes-and-updates 2004-01-19 22:21:54.000000000 -0800 +++ 25-akpm/drivers/usb/input/hid.h 2004-01-19 22:21:54.000000000 -0800 @@ -448,6 +448,7 @@ int hid_set_field(struct hid_field *, un void hid_submit_report(struct hid_device *, struct hid_report *, unsigned char dir); void hid_init_reports(struct hid_device *hid); int hid_find_report_by_usage(struct hid_device *hid, __u32 wanted_usage, struct hid_report **report, int type); +int hid_wait_io(struct hid_device* hid); #ifdef CONFIG_HID_FF diff -puN drivers/usb/input/hid-input.c~input-fixes-and-updates drivers/usb/input/hid-input.c --- 25/drivers/usb/input/hid-input.c~input-fixes-and-updates 2004-01-19 22:21:54.000000000 -0800 +++ 25-akpm/drivers/usb/input/hid-input.c 2004-01-19 22:21:54.000000000 -0800 @@ -40,13 +40,13 @@ static unsigned char hid_keyboard[256] = 0, 0, 0, 0, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38, 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 21, 44, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 28, 1, 14, 15, 57, 12, 13, 26, - 27, 43, 84, 39, 40, 41, 51, 52, 53, 58, 59, 60, 61, 62, 63, 64, + 27, 43, 43, 39, 40, 41, 51, 52, 53, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 87, 88, 99, 70,119,110,102,104,111,107,109,106, 105,108,103, 69, 98, 55, 74, 78, 96, 79, 80, 81, 75, 76, 77, 71, - 72, 73, 82, 83, 86,127,116,117, 85, 89, 90, 91, 92, 93, 94, 95, - 120,121,122,123,134,138,130,132,128,129,131,137,133,135,136,113, - 115,114,unk,unk,unk,124,unk,181,182,183,184,185,186,187,188,189, - 190,191,192,193,194,195,196,197,198,unk,unk,unk,unk,unk,unk,unk, + 72, 73, 82, 83, 86,127,116,117,183,184,185,186,187,188,189,190, + 191,192,193,194,134,138,130,132,128,129,131,137,133,135,136,113, + 115,114,unk,unk,unk,121,unk, 89, 93,124, 92, 94, 95,unk,unk,unk, + 122,123, 90, 91, 85,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk, unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk, unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk, unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk, diff -puN drivers/usb/input/hid-lgff.c~input-fixes-and-updates drivers/usb/input/hid-lgff.c --- 25/drivers/usb/input/hid-lgff.c~input-fixes-and-updates 2004-01-19 22:21:54.000000000 -0800 +++ 25-akpm/drivers/usb/input/hid-lgff.c 2004-01-19 22:21:54.000000000 -0800 @@ -6,7 +6,7 @@ * - WingMan Cordless RumblePad * - WingMan Force 3D * - * Copyright (c) 2002 Johann Deneux + * Copyright (c) 2002-2004 Johann Deneux */ /* @@ -25,13 +25,13 @@ * 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 + * e-mail - mail your message to */ #include #include -#define DEBUG +//#define DEBUG #include #include @@ -179,8 +179,7 @@ int hid_lgff_init(struct hid_device* hid kfree(private); return -1; } - private->rumble->field[0]->value[0] = 0x03; - private->rumble->field[0]->value[1] = 0x42; + private->rumble->field[0]->value[0] = 0x42; private->condition = hid_lgff_duplicate_report(report); @@ -207,7 +206,7 @@ int hid_lgff_init(struct hid_device* hid add_timer(&private->timer); /*TODO: only run the timer when at least one effect is playing */ - printk(KERN_INFO "Force feedback for Logitech force feedback devices by Johann Deneux \n"); + printk(KERN_INFO "Force feedback for Logitech force feedback devices by Johann Deneux \n"); return 0; } @@ -254,7 +253,7 @@ static void hid_lgff_input_init(struct h signed short* ff; u16 idVendor = hid->dev->descriptor.idVendor; u16 idProduct = hid->dev->descriptor.idProduct; - struct hid_input *hidinput = list_entry(&hid->inputs, struct hid_input, list); + struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list); while (dev->idVendor && (idVendor != dev->idVendor || idProduct != dev->idProduct)) dev++; @@ -511,10 +510,10 @@ static void hid_lgff_timer(unsigned long hid_submit_report(hid, lgff->constant, USB_DIR_OUT); } - if (left != lgff->rumble->field[0]->value[3] - || right != lgff->rumble->field[0]->value[4]) { - lgff->rumble->field[0]->value[3] = left; - lgff->rumble->field[0]->value[4] = right; + if (left != lgff->rumble->field[0]->value[2] + || right != lgff->rumble->field[0]->value[3]) { + lgff->rumble->field[0]->value[2] = left; + lgff->rumble->field[0]->value[3] = right; dbg("(left,right)=(%04x, %04x)", left, right); hid_submit_report(hid, lgff->rumble, USB_DIR_OUT); } diff -puN drivers/usb/input/usbkbd.c~input-fixes-and-updates drivers/usb/input/usbkbd.c --- 25/drivers/usb/input/usbkbd.c~input-fixes-and-updates 2004-01-19 22:21:54.000000000 -0800 +++ 25-akpm/drivers/usb/input/usbkbd.c 2004-01-19 22:21:54.000000000 -0800 @@ -49,13 +49,13 @@ static unsigned char usb_kbd_keycode[256 0, 0, 0, 0, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38, 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 21, 44, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 28, 1, 14, 15, 57, 12, 13, 26, - 27, 43, 84, 39, 40, 41, 51, 52, 53, 58, 59, 60, 61, 62, 63, 64, + 27, 43, 43, 39, 40, 41, 51, 52, 53, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 87, 88, 99, 70,119,110,102,104,111,107,109,106, 105,108,103, 69, 98, 55, 74, 78, 96, 79, 80, 81, 75, 76, 77, 71, - 72, 73, 82, 83, 86,127,116,117, 85, 89, 90, 91, 92, 93, 94, 95, - 120,121,122,123,134,138,130,132,128,129,131,137,133,135,136,113, - 115,114, 0, 0, 0,124, 0,181,182,183,184,185,186,187,188,189, - 190,191,192,193,194,195,196,197,198, 0, 0, 0, 0, 0, 0, 0, + 72, 73, 82, 83, 86,127,116,117,183,184,185,186,187,188,189,190, + 191,192,193,194,134,138,130,132,128,129,131,137,133,135,136,113, + 115,114, 0, 0, 0,121, 0, 89, 93,124, 92, 94, 95, 0, 0, 0, + 122,123, 90, 91, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, diff -puN include/linux/input.h~input-fixes-and-updates include/linux/input.h --- 25/include/linux/input.h~input-fixes-and-updates 2004-01-19 22:21:54.000000000 -0800 +++ 25-akpm/include/linux/input.h 2004-01-19 22:21:54.000000000 -0800 @@ -189,18 +189,18 @@ struct input_absinfo { #define KEY_KP3 81 #define KEY_KP0 82 #define KEY_KPDOT 83 -#define KEY_103RD 84 -#define KEY_F13 85 + +#define KEY_ZENKAKUHANKAKU 85 #define KEY_102ND 86 #define KEY_F11 87 #define KEY_F12 88 -#define KEY_F14 89 -#define KEY_F15 90 -#define KEY_F16 91 -#define KEY_F17 92 -#define KEY_F18 93 -#define KEY_F19 94 -#define KEY_F20 95 +#define KEY_RO 89 +#define KEY_KATAKANA 90 +#define KEY_HIRAGANA 91 +#define KEY_HENKAN 92 +#define KEY_KATAKANAHIRAGANA 93 +#define KEY_MUHENKAN 94 +#define KEY_KPJPCOMMA 95 #define KEY_KPENTER 96 #define KEY_RIGHTCTRL 97 #define KEY_KPSLASH 98 @@ -225,11 +225,11 @@ struct input_absinfo { #define KEY_KPEQUAL 117 #define KEY_KPPLUSMINUS 118 #define KEY_PAUSE 119 -#define KEY_F21 120 -#define KEY_F22 121 -#define KEY_F23 122 -#define KEY_F24 123 -#define KEY_KPCOMMA 124 + +#define KEY_KPCOMMA 121 +#define KEY_HANGUEL 122 +#define KEY_HANJA 123 +#define KEY_YEN 124 #define KEY_LEFTMETA 125 #define KEY_RIGHTMETA 126 #define KEY_COMPOSE 127 @@ -288,24 +288,18 @@ struct input_absinfo { #define KEY_KPLEFTPAREN 179 #define KEY_KPRIGHTPAREN 180 -#define KEY_INTL1 181 -#define KEY_INTL2 182 -#define KEY_INTL3 183 -#define KEY_INTL4 184 -#define KEY_INTL5 185 -#define KEY_INTL6 186 -#define KEY_INTL7 187 -#define KEY_INTL8 188 -#define KEY_INTL9 189 -#define KEY_LANG1 190 -#define KEY_LANG2 191 -#define KEY_LANG3 192 -#define KEY_LANG4 193 -#define KEY_LANG5 194 -#define KEY_LANG6 195 -#define KEY_LANG7 196 -#define KEY_LANG8 197 -#define KEY_LANG9 198 +#define KEY_F13 183 +#define KEY_F14 184 +#define KEY_F15 185 +#define KEY_F16 186 +#define KEY_F17 187 +#define KEY_F18 188 +#define KEY_F19 189 +#define KEY_F20 190 +#define KEY_F21 191 +#define KEY_F22 192 +#define KEY_F23 193 +#define KEY_F24 194 #define KEY_PLAYCD 200 #define KEY_PAUSECD 201 @@ -580,6 +574,7 @@ struct input_absinfo { #define BUS_ISAPNP 0x02 #define BUS_USB 0x03 #define BUS_HIL 0x04 +#define BUS_BLUETOOTH 0x05 #define BUS_ISA 0x10 #define BUS_I8042 0x11 _