From 419b5a3c0ac267bb19df02a4e7454204da2afaad Mon Sep 17 00:00:00 2001 From: Vojtech Pavlik Date: Thu, 15 Jan 2004 02:15:51 +0100 Subject: 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 | 14 +++++++------- drivers/input/keyboard/98kbd.c | 6 +++--- drivers/input/keyboard/atkbd.c | 20 ++++++++++---------- drivers/input/keyboard/maple_keyb.c | 10 +++++----- drivers/macintosh/adbhid.c | 4 ++-- drivers/usb/input/hid-input.c | 10 +++++----- drivers/usb/input/usbkbd.c | 10 +++++----- 7 files changed, 37 insertions(+), 37 deletions(-) (limited to 'drivers') diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c index b4c683f0e37c..129a2fb08a09 100644 --- a/drivers/char/keyboard.c +++ b/drivers/char/keyboard.c @@ -941,14 +941,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 +978,10 @@ static int emulate_raw(struct vc_data *vc, unsigned int keycode, 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 --git a/drivers/input/keyboard/98kbd.c b/drivers/input/keyboard/98kbd.c index 645a84799a4e..803df0db00b6 100644 --- a/drivers/input/keyboard/98kbd.c +++ b/drivers/input/keyboard/98kbd.c @@ -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 --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index 030d75c4ed17..fa8b5a011935 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c @@ -50,12 +50,12 @@ static int atkbd_softrepeat; 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, @@ -77,11 +77,11 @@ static unsigned char atkbd_set3_keycode[512] = { 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 }; @@ -236,10 +236,10 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data, 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); diff --git a/drivers/input/keyboard/maple_keyb.c b/drivers/input/keyboard/maple_keyb.c index 9793ba27b644..ebd0244777f0 100644 --- a/drivers/input/keyboard/maple_keyb.c +++ b/drivers/input/keyboard/maple_keyb.c @@ -19,13 +19,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 --git a/drivers/macintosh/adbhid.c b/drivers/macintosh/adbhid.c index 409bf8140099..01f95a2687d3 100644 --- a/drivers/macintosh/adbhid.c +++ b/drivers/macintosh/adbhid.c @@ -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 --git a/drivers/usb/input/hid-input.c b/drivers/usb/input/hid-input.c index d02886d8275e..83b6825dad12 100644 --- a/drivers/usb/input/hid-input.c +++ b/drivers/usb/input/hid-input.c @@ -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 --git a/drivers/usb/input/usbkbd.c b/drivers/usb/input/usbkbd.c index 57659fdae0de..f69ede4f4abf 100644 --- a/drivers/usb/input/usbkbd.c +++ b/drivers/usb/input/usbkbd.c @@ -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, -- cgit v1.2.3 From c0fd61785ce2ea07df174397e6afe908500e7b59 Mon Sep 17 00:00:00 2001 From: Vojtech Pavlik Date: Thu, 15 Jan 2004 02:17:18 +0100 Subject: input: Add support for Logitech MX700 mouse. --- drivers/input/mouse/logips2pp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/input/mouse/logips2pp.c b/drivers/input/mouse/logips2pp.c index 7fd9c2afdef9..e9dac656cee1 100644 --- a/drivers/input/mouse/logips2pp.c +++ b/drivers/input/mouse/logips2pp.c @@ -150,7 +150,7 @@ static int ps2pp_detect_model(struct psmouse *psmouse, unsigned char *param) 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); -- cgit v1.2.3 From 3adcc00cf03173179b2f72a85e2f0fc6bf8e190c Mon Sep 17 00:00:00 2001 From: Vojtech Pavlik Date: Thu, 15 Jan 2004 02:18:13 +0100 Subject: 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. --- drivers/input/serio/i8042.c | 89 +++++++++++++++++++++------------------------ 1 file changed, 42 insertions(+), 47 deletions(-) (limited to 'drivers') diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c index 1b0e7a5fd16b..74c59741e6db 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c @@ -371,65 +371,60 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs) 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_OBF) { + if (irq) dbg("Interrupt %d, without any data", irq); + return IRQ_RETVAL(0); + } - 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; + dfl = ((str & I8042_STR_PARITY) ? SERIO_PARITY : 0) | + ((str & I8042_STR_TIMEOUT) ? SERIO_TIMEOUT : 0); - dbg("%02x <- i8042 (interrupt, aux%d, %d%s%s)", - data, (str >> 6), irq, - dfl & SERIO_PARITY ? ", bad parity" : "", - dfl & SERIO_TIMEOUT ? ", timeout" : ""); + if (i8042_mux_values[0].exists && (str & I8042_STR_AUXDATA)) { - serio_interrupt(i8042_mux_port + ((str >> 6) & 3), data, dfl, regs); - continue; - } + 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); } /* @@ -645,7 +640,6 @@ static int __init i8042_port_register(struct i8042_values *values, struct serio static void i8042_timer_func(unsigned long data) { i8042_interrupt(0, NULL, NULL); - mod_timer(&i8042_timer, jiffies + I8042_POLL_PERIOD); } @@ -899,6 +893,9 @@ int __init i8042_init(void) dbg_init(); + init_timer(&i8042_timer); + i8042_timer.function = i8042_timer_func; + if (i8042_platform_init()) return -EBUSY; @@ -923,8 +920,6 @@ int __init i8042_init(void) 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) { -- cgit v1.2.3 From 0d3808783eb5d3f0588ae173f8ee9a52ac35ab1c Mon Sep 17 00:00:00 2001 From: Vojtech Pavlik Date: Thu, 15 Jan 2004 20:39:27 +0100 Subject: input: Add informational printk()s to atkbd.c --- drivers/input/keyboard/atkbd.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers') diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index fa8b5a011935..f3e8d671c97b 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c @@ -262,6 +262,11 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data, 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 : @@ -469,6 +474,11 @@ static int atkbd_probe(struct atkbd *atkbd) 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; } -- cgit v1.2.3 From 57c247b4b389b089558eddd8ec3b28415c9111a6 Mon Sep 17 00:00:00 2001 From: Vojtech Pavlik Date: Thu, 15 Jan 2004 22:01:43 +0100 Subject: input: Add IBM GamePad to the BADPAD list. --- drivers/usb/input/hid-core.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers') diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c index bde3364f41fb..071bb06f274f 100644 --- a/drivers/usb/input/hid-core.c +++ b/drivers/usb/input/hid-core.c @@ -1357,6 +1357,9 @@ void hid_init_reports(struct hid_device *hid) #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 } }; -- cgit v1.2.3 From 2297341140c10936348c476b85d8f72fc36a86f5 Mon Sep 17 00:00:00 2001 From: Dirk Jagdmann Date: Thu, 15 Jan 2004 22:14:40 +0100 Subject: input: Add backslash and 102nd key to amikbd.c list of scancodes. --- drivers/input/keyboard/amikbd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/input/keyboard/amikbd.c b/drivers/input/keyboard/amikbd.c index 4357ca9393d2..b8244b3359f2 100644 --- a/drivers/input/keyboard/amikbd.c +++ b/drivers/input/keyboard/amikbd.c @@ -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 -- cgit v1.2.3 From 6cd3bc94c880e4b63a0cf4df0d6be4413b0482bc Mon Sep 17 00:00:00 2001 From: Peter Berg Larsen Date: Thu, 15 Jan 2004 22:34:16 +0100 Subject: 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. --- drivers/input/serio/i8042.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) (limited to 'drivers') diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c index 74c59741e6db..8e09037ab1aa 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c @@ -508,17 +508,8 @@ static int i8042_enable_mux_ports(struct i8042_values *values) 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; @@ -622,6 +613,7 @@ static int __init i8042_port_register(struct i8042_values *values, struct serio 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; } @@ -652,8 +644,6 @@ static void i8042_timer_func(unsigned long data) 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. @@ -908,15 +898,15 @@ 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); -- cgit v1.2.3 From 5ca3f1f9b554cb12b481df0c39b7039587351588 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Thu, 15 Jan 2004 23:51:52 +0100 Subject: input: Move devfs entries for joystick into /dev/input --- drivers/input/joydev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c index 822ae5473b3f..4a0ba1346374 100644 --- a/drivers/input/joydev.c +++ b/drivers/input/joydev.c @@ -143,7 +143,7 @@ static int joydev_fasync(int fd, struct file *file, int on) 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; kfree(joydev); } @@ -443,7 +443,7 @@ static struct input_handle *joydev_connect(struct input_handler *handler, struct joydev_table[minor] = joydev; devfs_mk_cdev(MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + minor), - S_IFCHR|S_IRUGO|S_IWUSR, "js%d", minor); + S_IFCHR|S_IRUGO|S_IWUSR, "input/js%d", minor); return &joydev->handle; } -- cgit v1.2.3 From 1907957982daa75b593fd6b56f44f1855f7cf6ca Mon Sep 17 00:00:00 2001 From: Johann Deneux Date: Fri, 16 Jan 2004 00:09:09 +0100 Subject: input: Fixes and updates of the USB ForceFeedback drivers. Added Logitech MOMO FF steering wheel ID. --- drivers/usb/input/hid-core.c | 6 +++--- drivers/usb/input/hid-ff.c | 9 +++++---- drivers/usb/input/hid-lgff.c | 21 ++++++++++----------- 3 files changed, 18 insertions(+), 18 deletions(-) (limited to 'drivers') diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c index 071bb06f274f..911e0e169aa3 100644 --- a/drivers/usb/input/hid-core.c +++ b/drivers/usb/input/hid-core.c @@ -1529,9 +1529,9 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) 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 --git a/drivers/usb/input/hid-ff.c b/drivers/usb/input/hid-ff.c index b9066add28e0..10a0a329390b 100644 --- a/drivers/usb/input/hid-ff.c +++ b/drivers/usb/input/hid-ff.c @@ -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 --git a/drivers/usb/input/hid-lgff.c b/drivers/usb/input/hid-lgff.c index d3e00e5e1596..fa8be80dac0b 100644 --- a/drivers/usb/input/hid-lgff.c +++ b/drivers/usb/input/hid-lgff.c @@ -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 hid_device* hid) 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 timer_data) 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); } -- cgit v1.2.3 From 2e7f25256de20cc624feb87e06e423b108188854 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Fri, 16 Jan 2004 08:57:55 +0100 Subject: 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. --- drivers/char/keyboard.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c index 129a2fb08a09..f628d1500907 100644 --- a/drivers/char/keyboard.c +++ b/drivers/char/keyboard.c @@ -493,9 +493,13 @@ static void fn_lastcons(struct vc_data *vc, struct pt_regs *regs) 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_data *vc, struct pt_regs *regs) 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)) -- cgit v1.2.3 From 70144f785bea7791848ecdbdc473ea1e10dd4540 Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Sun, 18 Jan 2004 20:27:53 +0100 Subject: 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.) --- drivers/input/keyboard/atkbd.c | 14 ++++++++++---- drivers/input/mouse/psmouse-base.c | 14 +++++++++++--- 2 files changed, 21 insertions(+), 7 deletions(-) (limited to 'drivers') diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index f3e8d671c97b..41bc4172fc6a 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c @@ -333,6 +333,10 @@ static int atkbd_command(struct atkbd *atkbd, unsigned char *param, int command) 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)) @@ -385,7 +389,7 @@ static int atkbd_event(struct input_dev *dev, unsigned int type, unsigned int co 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) @@ -395,9 +399,9 @@ static int atkbd_event(struct input_dev *dev, unsigned int type, unsigned int co 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) { @@ -456,6 +460,7 @@ static int atkbd_probe(struct atkbd *atkbd) * 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)) { /* @@ -662,6 +667,7 @@ static void atkbd_connect(struct serio *serio, struct serio_dev *dev) if (atkbd_probe(atkbd)) { serio_close(serio); + serio->private = NULL; kfree(atkbd); return; } diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index 89e1c47a1b8a..19e0c3cc0e01 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c @@ -235,6 +235,11 @@ int psmouse_command(struct psmouse *psmouse, unsigned char *param, int command) 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; @@ -245,8 +250,9 @@ int psmouse_command(struct psmouse *psmouse, unsigned char *param, int command) 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) { @@ -414,7 +420,7 @@ static int psmouse_probe(struct psmouse *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; @@ -578,12 +584,14 @@ static void psmouse_connect(struct serio *serio, struct serio_dev *dev) 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; } -- cgit v1.2.3 From dd4de4102fce3eec9eed1e60c288e39f30f7a7ab Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Sun, 18 Jan 2004 20:37:38 +0100 Subject: input: Add support for HP PARISC keyboards to atkbd.c --- drivers/input/keyboard/atkbd.c | 8 ++- drivers/input/keyboard/hpps2atkbd.h | 105 ++++++++++++++++++++++++++++++++++++ 2 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 drivers/input/keyboard/hpps2atkbd.h (limited to 'drivers') diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index 41bc4172fc6a..8c906b77ed80 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c @@ -35,7 +35,7 @@ MODULE_PARM(atkbd_softrepeat, "1i"); MODULE_LICENSE("GPL"); static int atkbd_set = 2; -#if defined(__i386__) || defined (__x86_64__) +#if defined(__i386__) || defined(__x86_64__) || defined(__hppa__) static int atkbd_reset; #else static int atkbd_reset = 1; @@ -47,6 +47,10 @@ static int atkbd_softrepeat; * 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, @@ -70,6 +74,8 @@ static unsigned char atkbd_set2_keycode[512] = { 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, diff --git a/drivers/input/keyboard/hpps2atkbd.h b/drivers/input/keyboard/hpps2atkbd.h new file mode 100644 index 000000000000..2086ff7945d7 --- /dev/null +++ b/drivers/input/keyboard/hpps2atkbd.h @@ -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 + +}; -- cgit v1.2.3 From 53f5dc3f44192a8655d716b48d7ef1bc0e459fa9 Mon Sep 17 00:00:00 2001 From: Adam Kropelin Date: Sun, 18 Jan 2004 21:50:00 +0100 Subject: input: Always wait for hid request completion in hiddev before returning to the caller process. --- drivers/usb/input/hid.h | 1 + drivers/usb/input/hiddev.c | 1 + 2 files changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/usb/input/hid.h b/drivers/usb/input/hid.h index cc13afe00fac..eaba10d550ff 100644 --- a/drivers/usb/input/hid.h +++ b/drivers/usb/input/hid.h @@ -448,6 +448,7 @@ int hid_set_field(struct hid_field *, unsigned, __s32); 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 --git a/drivers/usb/input/hiddev.c b/drivers/usb/input/hiddev.c index a63cf4ae9f95..3c74a4d6fd04 100644 --- a/drivers/usb/input/hiddev.c +++ b/drivers/usb/input/hiddev.c @@ -509,6 +509,7 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd return -EINVAL; hid_submit_report(hid, report, USB_DIR_IN); + hid_wait_io(hid); return 0; -- cgit v1.2.3 From 3f8cd96760d3d21eb2382262d08e7a1272d1b501 Mon Sep 17 00:00:00 2001 From: Vojtech Pavlik Date: Mon, 19 Jan 2004 23:45:45 +0100 Subject: input: Add a missing space in atkbd warning message. --- drivers/input/keyboard/atkbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index 8c906b77ed80..a0f9fc24b545 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c @@ -270,7 +270,7 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data, 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"); + " hardware directly.\n"); else printk(KERN_WARNING "atkbd.c: Use 'setkeycodes %s%02x ' to make it known.\n", code & 0x80 ? "e0" : "", code & 0x7f); break; -- cgit v1.2.3 From 963be119e0d2afb7cf1909a6036690ad14e2c4cc Mon Sep 17 00:00:00 2001 From: Vojtech Pavlik Date: Tue, 20 Jan 2004 00:46:17 +0100 Subject: input: Make scancode for a Sun5 type keyboard one of those not ignored because of protocol nastiness. --- drivers/char/keyboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c index f628d1500907..2bc239ac7806 100644 --- a/drivers/char/keyboard.c +++ b/drivers/char/keyboard.c @@ -952,7 +952,7 @@ static unsigned short x86_keycodes[256] = 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, + 360,261,262,263,268,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,265,266, 93, 94, 95, 85,259,375,260, 90,116, -- cgit v1.2.3 From db288fe4634b11cec105a48b874ef787afe2dde0 Mon Sep 17 00:00:00 2001 From: Glenn Burkhardt Date: Tue, 20 Jan 2004 21:50:34 +0100 Subject: input: Properly recompute initial values upon recalibration in joydev. --- drivers/input/joydev.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c index 4a0ba1346374..1ca52c925e16 100644 --- a/drivers/input/joydev.c +++ b/drivers/input/joydev.c @@ -290,7 +290,7 @@ static int joydev_ioctl(struct inode *inode, struct file *file, unsigned int cmd struct joydev_list *list = file->private_data; struct joydev *joydev = list->joydev; struct input_dev *dev = joydev->handle.dev; - int i; + int i, j; if (!joydev->exist) return -ENODEV; @@ -324,8 +324,14 @@ static int joydev_ioctl(struct inode *inode, struct file *file, unsigned int cmd case JSIOCGBUTTONS: return put_user(joydev->nkey, (__u8 *) arg); case JSIOCSCORR: - return copy_from_user(joydev->corr, (struct js_corr *) arg, - sizeof(struct js_corr) * joydev->nabs) ? -EFAULT : 0; + if (copy_from_user(joydev->corr, (struct js_corr *)arg, + sizeof(struct js_corr) * joydev->nabs)) + return -EFAULT; + for (i = 0; i < joydev->nabs; i++) { + j = joydev->abspam[i]; + joydev->abs[i] = joydev_correct(dev->abs[j], joydev->corr + i); + } + return 0; case JSIOCGCORR: return copy_to_user((struct js_corr *) arg, joydev->corr, sizeof(struct js_corr) * joydev->nabs) ? -EFAULT : 0; @@ -426,6 +432,7 @@ static struct input_handle *joydev_connect(struct input_handler *handler, struct j = joydev->abspam[i]; if (dev->absmax[j] == dev->absmin[j]) { joydev->corr[i].type = JS_CORR_NONE; + joydev->abs[i] = dev->abs[j]; continue; } joydev->corr[i].type = JS_CORR_BROKEN; -- cgit v1.2.3