Bug 6462

Summary: Various usb/input/hid-input.c bugs make Apple Mighty Mouse work poorly
Product: Drivers Reporter: Bart Massey (bart)
Component: USBAssignee: Greg Kroah-Hartman (greg)
Status: RESOLVED PATCH_ALREADY_AVAILABLE    
Severity: normal CC: dmitry.torokhov
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.17-rc3-g543f2a33-dirty Subsystem:
Regression: --- Bisected commit-id:
Bug Depends on:    
Bug Blocks: 5089    
Attachments: Patch to fix problems with Apple MightyMouse

Description Bart Massey 2006-04-30 00:47:58 UTC
Most recent kernel where this bug did not occur: Present at least back to 2.6.15.6
Distribution: Debian unstable, but kernel is from kernel.org source
Hardware Environment: AMD Athlon XP 2000+, 768MB, various USB stuff, etc.
Software Environment: ?
Problem Description:

Transposed lines of code in drivers/usb/input/hid-input.c causes the capability
bits for a new HID device to be set before quirks are applied at configuration
time.  When an HID event is then sent up to the input layer, it may then be
discarded as irrelevant because the wrong capability bit is set.

Further, the quirks for the Apple Mighty Mouse are not quite right: the
horizontal scrolling needs its axis reversed, and the left and center buttons
are transposed.  Also, the mouse is labeled in the kernel with its earlier name
of Apple PowerMouse.

Steps to reproduce:

Plug in an Apple Mighty Mouse.  Note that horizontal scrolling doesn't work at
all, and in fact doesn't generate any input events on /dev/input/eventN.  Note
also that pushing the middle button performs the right button action, and vice
versa.  Once you have the horizontal scrolling working, note that it is backward
WRT both to vertical scrolling and to common sense.
Comment 1 Bart Massey 2006-04-30 00:54:32 UTC
Created attachment 7987 [details]
Patch to fix problems with Apple MightyMouse

This patch maybe should be broken up, as it does address two problems.	The
transposed code in hidinput_configure_usage() probably creates bugs beyond just
the Mighty Mouse.  The rest of the patch renames POWERMOUSE to MIGHTYMOUSE
everywhere (which I *believe* is correct), fixes the MIGHTYMOUSE quirk to swap
the center and right mouse buttons, and adds a new quirk
HID_QUIRK_INVERT_HWHEEL also assigned to the MIGHTYMOUSE with code in
hidinput_hid_event() to implement it.
Comment 2 Bart Massey 2006-04-30 00:55:51 UTC
See also http://fob.po8.org/node/165
Comment 3 Greg Kroah-Hartman 2006-05-08 13:33:18 UTC
Please send this patch, as per Documentation/SubmittingPatches
to the input subsystem maintainer and me.  We can take it from there.