Input update for 2.6.11 [0/6]
Subsystems (2)
PATCH 1/1 Input update for 2.6.11 [0/6]
Hi!
I'm sending you a few fixes hopefully for the 2.6.11 release. They should fix reboot problems due to the BIOS not expecting the i8042 controller to be in MUX mode, problems with incorrectly assigned buttons on mice with horizontal scroll wheels, spurious kernel messages and endless message loops on disconnect of HID devices on UHCI controllers, and some nuances regarding MSC_SCAN events generation for future tools for assigning keycodes to scancodes.
You can pull the whole set, including merge changesets from
bk://kernel.bkbits.net/vojtech/for-linus
I'll be sending a larger bunch of patches sometime soon, but those aren't as urgent as these six.
Signature · 2 lines
Vojtech Pavlik SuSE Labs, SuSE CR
PATCH 1/6 Add support for H-Wheel on Microsoft Explorer and Logitech MX mice
You can pull this changeset from:
bk://kernel.bkbits.net/vojtech/for-linus
===================================================================
[email protected], 2005-01-11 17:45:14+01:00, [email protected]
input: Add support for H-Wheel on Microsoft Explorer and Logitech MX
USB HID mice.
hid-debug.h | 24 ++++++++++++++---------- hid-input.c | 12 +++++++++--- hid.h | 1 + 3 files changed, 24 insertions(+), 13 deletions(-)
===================================================================
drivers/usb/input/hid-debug.h +14 -10
@@ -81,15 +81,21 @@ {0, 0x8b, "SystemMenuLeft"}, {0, 0x8c, "SystemMenuUp"}, {0, 0x8d, "SystemMenuDown"}, - {0, 0x90, "D-padUp"}, - {0, 0x91, "D-padDown"}, - {0, 0x92, "D-padRight"}, - {0, 0x93, "D-padLeft"}, + {0, 0x90, "D-PadUp"}, + {0, 0x91, "D-PadDown"}, + {0, 0x92, "D-PadRight"}, + {0, 0x93, "D-PadLeft"}, { 7, 0, "Keyboard" }, + {0, 0x01, "NumLock"}, + {0, 0x02, "CapsLock"}, + {0, 0x03, "ScrollLock"}, + {0, 0x04, "Compose"}, + {0, 0x05, "Kana"}, { 8, 0, "LED" }, { 9, 0, "Button" }, { 10, 0, "Ordinal" }, - { 12, 0, "Hotkey" }, + { 12, 0, "Consumer" }, + {0, 0x238, "HorizontalWheel"}, { 13, 0, "Digitizers" }, {0, 0x01, "Digitizer"}, {0, 0x02, "Pen"},
@@ -653,12 +659,10 @@ [KEY_SLOW] = "Slow", [KEY_SHUFFLE] = "Shuffle", [KEY_BREAK] = "Break", [KEY_PREVIOUS] = "Previous", [KEY_DIGITS] = "Digits", [KEY_TEEN] = "TEEN", - [KEY_TWEN] = "TWEN", [KEY_DEL_EOL] = "Delete EOL", - [KEY_DEL_EOS] = "Delete EOS", [KEY_INS_LINE] = "Insert line", - [KEY_DEL_LINE] = "Delete line", + [KEY_TWEN] = "TWEN", [KEY_DEL_EOL] = "DeleteEOL", + [KEY_DEL_EOS] = "DeleteEOS", [KEY_INS_LINE] = "InsertLine", + [KEY_DEL_LINE] = "DeleteLine", }; - -static char *absval[5 ] = {"Value" ,"Min " ,"Max " ,"Fuzz " ,"Flat " };static char *relatives[REL_MAX +1 ] = { [0 ...REL_MAX ] =NULL ,
drivers/usb/input/hid-input.c +9 -3
@@ -185,7 +185,9 @@break ;case HID_UP_LED : -map_led ((usage->hid -1 ) &0xf ); +if (usage->hid -1 >=LED_MAX ) + goto ignore; +map_led (usage->hid -1 );break ;case HID_UP_DIGITIZER :
@@ -231,7 +233,6 @@case HID_UP_CONSUMER :/* USB HUT v1.1, pages 56-62 */ -set_bit (EV_REP , input->evbit);switch (usage->hid &HID_USAGE ) {case 0x000 : goto ignore;case 0x034 :map_key_clear (KEY_SLEEP );break ;
@@ -268,6 +269,7 @@case 0x226 :map_key_clear (KEY_STOP );break ;case 0x227 :map_key_clear (KEY_REFRESH );break ;case 0x22a :map_key_clear (KEY_BOOKMARKS );break ; +case 0x238 :map_rel (REL_HWHEEL );break ;default : goto unknown; }break ;
@@ -288,9 +290,13 @@case 0x084 :map_key_clear (KEY_FINANCE );break ;case 0x085 :map_key_clear (KEY_SPORT );break ;case 0x086 :map_key_clear (KEY_SHOP );break ; -default : goto unknown; +default : goto ignore; }break ; + +case HID_UP_MSVENDOR : + + goto ignore;case HID_UP_PID :
drivers/usb/input/hid.h +1 -0
@@ -181,6 +181,7 @@#define HID_UP_DIGITIZER 0x000d0000#define HID_UP_PID 0x000f0000#define HID_UP_HPVENDOR 0xff7f0000 +#define HID_UP_MSVENDOR 0xff000000#define HID_USAGE 0x0000ffff
PATCH 2/6 Handle -EILSEQ return code in the HID driver
You can pull this changeset from:
bk://kernel.bkbits.net/vojtech/for-linus
===================================================================
[email protected], 2005-01-13 13:32:43+01:00, [email protected]
input: Handle -EILSEQ return code in the HID driver completion
handlers as unplug.
Flush request queue on unplug, too.
hid-core.c | 23 ++++++++++++++++++----- 1 files changed, 18 insertions(+), 5 deletions(-)
===================================================================
drivers/usb/input/hid-core.c +18 -5
@@ -925,8 +925,9 @@break ;case -ECONNRESET :/* unlink */ case -ENOENT : -case -ESHUTDOWN :case -EPERM : +case -ESHUTDOWN :/* unplug */ +case -EILSEQ :/* unplug timeout on uhci */ return ;case -ETIMEDOUT :/* NAK */ break ;
@@ -1136,12 +1137,15 @@ {struct hid_device *hid = urb->context;unsigned long flags; +int unplug =0 ;switch (urb->status) {case 0 :/* success */ +case -ESHUTDOWN :/* unplug */ +case -EILSEQ :/* unplug timeout on uhci */ + unplug =1 ;case -ECONNRESET :/* unlink */ case -ENOENT : -case -ESHUTDOWN :break ;default :/* error */ warn ("output irq status %d received" , urb->status);
@@ -1149,7 +1153,10 @@spin_lock_irqsave (&hid->outlock, flags); - hid->outtail = (hid->outtail +1 ) & (HID_OUTPUT_FIFO_SIZE -1 ); +if (unplug) + hid->outtail = hid->outhead; +else + hid->outtail = (hid->outtail +1 ) & (HID_OUTPUT_FIFO_SIZE -1 );if (hid->outhead != hid->outtail) {if (hid_submit_out (hid)) {
@@ -1173,6 +1180,7 @@ {struct hid_device *hid = urb->context;unsigned long flags; +int unplug =0 ;spin_lock_irqsave (&hid->ctrllock, flags);
@@ -1180,16 +1188,21 @@case 0 :/* success */ if (hid->ctrl[hid->ctrltail].dir ==USB_DIR_IN )hid_input_report (hid->ctrl[hid->ctrltail].report->type, urb, regs); +case -ESHUTDOWN :/* unplug */ +case -EILSEQ :/* unplug timectrl on uhci */ + unplug =1 ;case -ECONNRESET :/* unlink */ case -ENOENT : -case -ESHUTDOWN :case -EPIPE :/* report not available */ break ;default :/* error */ warn ("ctrl urb status %d received" , urb->status); } - hid->ctrltail = (hid->ctrltail +1 ) & (HID_CONTROL_FIFO_SIZE -1 ); +if (unplug) + hid->ctrltail = hid->ctrlhead; +else + hid->ctrltail = (hid->ctrltail +1 ) & (HID_CONTROL_FIFO_SIZE -1 );if (hid->ctrlhead != hid->ctrltail) {if (hid_submit_ctrl (hid)) {
PATCH 3/6 Always bring the i8042 multiplexer out of multiplexing mode
You can pull this changeset from:
bk://kernel.bkbits.net/vojtech/for-linus
===================================================================
[email protected], 2005-01-27 13:47:19+01:00, [email protected]
input: Always bring the i8042 multiplexer out of multiplexing mode before
rebooting.
i8042.c | 36 ++++++++++++++++++++++-------------- 1 files changed, 22 insertions(+), 14 deletions(-)
===================================================================
drivers/input/serio/i8042.c +22 -14
@@ -458,12 +458,11 @@ }/* -* i8042_enable_mux_mode checks whether the controller has an active -* multiplexor and puts the chip into Multiplexed (as opposed to -* Legacy) mode. +* i8042_set_mux_mode checks whether the controller has an active +* multiplexor and puts the chip into Multiplexed (1) or Legacy (0) mode. */ -static int i8042_enable_mux_mode (struct i8042_values *values,unsigned char *mux_version) +static int i8042_set_mux_mode (unsigned int mode,unsigned char *mux_version) {unsigned char param;
@@ -482,11 +481,11 @@ param =0xf0 ;if (i8042_command (¶m,I8042_CMD_AUX_LOOP ) || param !=0x0f )return -1 ; - param =0x56 ; + param = mode ?0x56 :0xf6 ;if (i8042_command (¶m,I8042_CMD_AUX_LOOP ) || param !=0xa9 )return -1 ; - param =0xa4 ; -if (i8042_command (¶m,I8042_CMD_AUX_LOOP ) || param ==0x5b ) + param = mode ?0xa4 :0xa5 ; +if (i8042_command (¶m,I8042_CMD_AUX_LOOP ) || param == (mode ?0x5b :0x5a ))return -1 ;if (mux_version)
@@ -540,11 +539,11 @@ {unsigned char mux_version; -if (i8042_enable_mux_mode (values, &mux_version)) +if (i8042_set_mux_mode (1 , &mux_version))return -1 ; -/* Workaround for broken chips which seem to support MUX, but in reality don't. */ -/* They all report version 10.12 */ +/* Workaround for interference with USB Legacy emulation */ +/* that causes a v10.12 MUX to be found. */ if (mux_version ==0xAC )return -1 ;
@@ -774,12 +773,21 @@*/ void i8042_controller_reset (void ) { -if (i8042_reset) { -unsigned char param; +unsigned char param; + +/* +* Reset the controller if requested. +*/ +if (i8042_reset)if (i8042_command (¶m,I8042_CMD_CTL_TEST ))printk (KERN_ERR "i8042.c: i8042 controller reset timeout.\n" ); - } + +/* +* Disable MUX mode if present. +*/ + +i8042_set_mux_mode (0 ,NULL );/* * Restore the original control register setting.
@@ -888,7 +896,7 @@ }if (i8042_mux_present) -if (i8042_enable_mux_mode (&i8042_aux_values,NULL ) || +if (i8042_set_mux_mode (1 ,NULL ) ||i8042_enable_mux_ports (&i8042_aux_values)) {printk (KERN_WARNING "i8042: failed to resume active multiplexor, mouse won't work.\n" ); }
PATCH 4/6 Enable scancode event generation in the HID driver
You can pull this changeset from:
bk://kernel.bkbits.net/vojtech/for-linus
===================================================================
[email protected], 2005-01-27 14:48:48+01:00, [email protected]
input: Enable scancode event generation in the HID driver. This should allow
changing HID->event mappings (via EVIOCS*) in the future and make debugging easier now.
hid-input.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-)
===================================================================
drivers/usb/input/hid-input.c +7 -3
@@ -403,11 +403,12 @@if (!input)return ; +input_regs (input, regs); +input_event (input,EV_MSC ,MSC_SCAN , usage->hid); +if (!usage->type)return ; -input_regs (input, regs); -if (((hid->quirks &HID_QUIRK_2WHEEL_MOUSE_HACK_5 ) && (usage->hid ==0x00090005 )) || ((hid->quirks &HID_QUIRK_2WHEEL_MOUSE_HACK_7 ) && (usage->hid ==0x00090007 ))) {if (value) hid->quirks |=HID_QUIRK_2WHEEL_MOUSE_HACK_ON ;
@@ -574,13 +575,16 @@ hidinput->input.id.product =le16_to_cpu (dev->descriptor.idProduct); hidinput->input.id.version =le16_to_cpu (dev->descriptor.bcdDevice); hidinput->input.dev = &hid->intf->dev; + +set_bit (EV_MSC , hidinput->input.evbit); +set_bit (MSC_SCAN , hidinput->input.mscbit); }for (i =0 ; i < report->maxfield; i++)for (j =0 ; j < report->field[i]->maxusage; j++)hidinput_configure_usage (hidinput, report->field[i], report->field[i]->usage + j); - +if (hid->quirks &HID_QUIRK_MULTI_INPUT ) {/* This will leave hidinput NULL, so that it * allocates another one if we have more inputs on
PATCH 5/6 Add missing input_sync() calls to atkbd.c
You can pull this changeset from:
bk://kernel.bkbits.net/vojtech/for-linus
===================================================================
[email protected], 2005-01-27 14:58:43+01:00, [email protected]
input: Add missing input_sync() calls to atkbd.c.
atkbd.c | 2 ++ 1 files changed, 2 insertions(+)
===================================================================
drivers/input/keyboard/atkbd.c +2 -0
@@ -234,6 +234,7 @@input_regs (dev, regs);if (value ==3 ) {input_report_key (dev, code,1 ); +input_sync (dev);input_report_key (dev, code,0 ); }else input_event (dev,EV_KEY , code, value);
@@ -352,6 +353,7 @@"to make it known.\n" , code & 0x80 ? "e0" : "", code & 0x7f); } +input_sync (&atkbd->dev);break ;case ATKBD_SCR_1 : scroll =1 - atkbd->release *2 ;
PATCH 6/6 Fix ACK/NAK handling in libps2.c - don't ignore bytes before ACK
You can pull this changeset from:
bk://kernel.bkbits.net/vojtech/for-linus
===================================================================
[email protected], 2005-01-27 01:18:50-05:00, [email protected]
Input: ACK/NAK processing rules in libps2 were too strict - while it is a
good idea to discard any character other than ACK/NAK during probe it causes missing releases and keys getting "stuck" when a command issued on enabled device. The effect is easily demonstrated with the following command:
while true; do xset led 3; xset -led 3; done
With this change extra characters will be discarded only if device has not been marked as "enabled" yet.
libps2.c | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-)
===================================================================
drivers/input/serio/libps2.c +13 -3
@@ -223,7 +223,8 @@ }/* -* ps2_handle_ack() +* ps2_handle_ack() is supposed to be used in interrupt handler +* to properly process ACK/NAK of a command from a PS/2 device. */ int ps2_handle_ack (struct ps2dev *ps2dev,unsigned char data)
@@ -250,18 +251,27 @@ }/* Fall through */ default : -return 1 ; +return 0 ; } +if (!ps2dev->nak && ps2dev->cmdcnt) ps2dev->flags |=PS2_FLAG_CMD |PS2_FLAG_CMD1 ; ps2dev->flags &= ~PS2_FLAG_ACK ;wake_up_interruptible (&ps2dev->wait); -return data ==PS2_RET_ACK || data ==PS2_RET_NAK ; +if (data !=PS2_RET_ACK ) +ps2_handle_response (ps2dev, data); + +return 1 ; } +/* +* ps2_handle_response() is supposed to be used in interrupt handler +* to properly store device's response to a command and notify process +* waiting for completion of the command. +*/ int ps2_handle_response (struct ps2dev *ps2dev,unsigned char data) {
PATCH 1/1 One more: Fix libps2 timeout handling
In reply to Vojtech PavlikYou can pull this changeset from:
bk://kernel.bkbits.net/vojtech/for-linus
===================================================================
[email protected], 2005-01-28 02:01:34-05:00, [email protected]
Input: libps2 - fix timeout handling in ps2_command, switch to using
wait_event_timeout instead of wait_event_interruptible_timeout now that first form is available.
libps2.c | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-)
===================================================================
drivers/input/serio/libps2.c +11 -11
@@ -60,9 +60,9 @@serio_continue_rx (ps2dev->serio);if (serio_write (ps2dev->serio, byte) ==0 ) -wait_event_interruptible_timeout (ps2dev->wait, - !(ps2dev->flags &PS2_FLAG_ACK ), -msecs_to_jiffies (timeout)); +wait_event_timeout (ps2dev->wait, + !(ps2dev->flags &PS2_FLAG_ACK ), +msecs_to_jiffies (timeout));serio_pause_rx (ps2dev->serio); ps2dev->flags &= ~PS2_FLAG_ACK ;
@@ -115,8 +115,8 @@*/ timeout =msecs_to_jiffies (command ==PS2_CMD_RESET_BAT ?4000 :500 ); -wait_event_interruptible_timeout (ps2dev->wait, - !(ps2dev->flags &PS2_FLAG_CMD1 ), timeout); + timeout =wait_event_timeout (ps2dev->wait, + !(ps2dev->flags &PS2_FLAG_CMD1 ), timeout);if (ps2dev->cmdcnt && timeout >0 ) {
@@ -147,8 +147,8 @@serio_continue_rx (ps2dev->serio); } -wait_event_interruptible_timeout (ps2dev->wait, - !(ps2dev->flags &PS2_FLAG_CMD ), timeout); +wait_event_timeout (ps2dev->wait, + !(ps2dev->flags &PS2_FLAG_CMD ), timeout); }if (param)
@@ -259,7 +259,7 @@ ps2dev->flags |=PS2_FLAG_CMD |PS2_FLAG_CMD1 ; ps2dev->flags &= ~PS2_FLAG_ACK ; -wake_up_interruptible (&ps2dev->wait); +wake_up (&ps2dev->wait);if (data !=PS2_RET_ACK )ps2_handle_response (ps2dev, data);
@@ -281,12 +281,12 @@if (ps2dev->flags &PS2_FLAG_CMD1 ) { ps2dev->flags &= ~PS2_FLAG_CMD1 ;if (ps2dev->cmdcnt) -wake_up_interruptible (&ps2dev->wait); +wake_up (&ps2dev->wait); }if (!ps2dev->cmdcnt) { ps2dev->flags &= ~PS2_FLAG_CMD ; -wake_up_interruptible (&ps2dev->wait); +wake_up (&ps2dev->wait); }return 1 ;
@@ -298,7 +298,7 @@ ps2dev->nak =1 ;if (ps2dev->flags & (PS2_FLAG_ACK |PS2_FLAG_CMD )) -wake_up_interruptible (&ps2dev->wait); +wake_up (&ps2dev->wait); ps2dev->flags =0 ; }