Re: 2.6.2-rc2-mm1

From: Zephaniah E. Hull
Date: Fri Jan 30 2004 - 07:42:43 EST


On Fri, Jan 30, 2004 at 12:20:39PM +0100, Vojtech Pavlik wrote:
> On Fri, Jan 30, 2004 at 06:18:05AM -0500, Zephaniah E. Hull wrote:
> > On Fri, Jan 30, 2004 at 12:02:05PM +0100, Vojtech Pavlik wrote:
> > > On Fri, Jan 30, 2004 at 05:48:29AM -0500, Zephaniah E. Hull wrote:
> > > > On Tue, Jan 27, 2004 at 11:34:02PM -0800, Andrew Morton wrote:
> > > > >
> > > > > ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.2-rc2/2.6.2-rc2-mm1/
> > > > >
> > > > > - From now on, -mm kernels will contain the latest contents of:
> > > > >
> > > > > Vojtech's tree: input.patch
> > > >
> > > > This one seems to have a rather problematic patch, which I can't find
> > > > any explanation for.
> > >
> > > There is another revision of the same mouse from A4Tech (owned by
> > > Jaroslav Kysela), that reports itself as Cypress and has the buttons a
> > > bit differently.
> > >
> > > If it indeed collides with your mouse, then we need somehow to specify
> > > which button carries the wheel information in the quirk list.
> >
> > Ugh, that is not fun, it does indeed conflict.
> > How about HID_QUIRK_2WHEEL_MOUSE_HACK_EXTRA and
> > HID_QUIRK_2WHEEL_MOUSE_HACK_BACK as quirk names?
>
> Sounds OK.

Ok, attached.
It is against 2.6.2-rc2-mm2, and has been tested.
(Yes, I know about the line lengths. If they are a problem, I can
tweak.)

--
1024D/E65A7801 Zephaniah E. Hull <warp@xxxxxxxxxxxxxxxx>
92ED 94E4 B1E6 3624 226D 5727 4453 008B E65A 7801
CCs of replies from mailing lists are requested.

Stubborness will get you where self-esteem won't let you go.
-- Queen Of Swords in the SDM.
diff -ur linux-2.6.2-rc2-mm2.orig/drivers/usb/input/hid-core.c linux-2.6.2-rc2-mm2/drivers/usb/input/hid-core.c
--- linux-2.6.2-rc2-mm2.orig/drivers/usb/input/hid-core.c 2004-01-30 06:10:39.000000000 -0500
+++ linux-2.6.2-rc2-mm2/drivers/usb/input/hid-core.c 2004-01-30 06:35:21.000000000 -0500
@@ -1425,8 +1425,8 @@
{ USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVMC, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_TANGTOP, USB_DEVICE_ID_TANGTOP_USBPS2, HID_QUIRK_NOGET },

- { USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU, HID_QUIRK_2WHEEL_MOUSE_HACK },
- { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_MOUSE, HID_QUIRK_2WHEEL_MOUSE_HACK },
+ { USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU, HID_QUIRK_2WHEEL_MOUSE_HACK_BACK },
+ { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_MOUSE, HID_QUIRK_2WHEEL_MOUSE_HACK_EXTRA },

{ USB_VENDOR_ID_ALPS, USB_DEVICE_ID_IBM_GAMEPAD, HID_QUIRK_BADPAD },
{ USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_DRIVING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
diff -ur linux-2.6.2-rc2-mm2.orig/drivers/usb/input/hid-input.c linux-2.6.2-rc2-mm2/drivers/usb/input/hid-input.c
--- linux-2.6.2-rc2-mm2.orig/drivers/usb/input/hid-input.c 2004-01-30 06:10:39.000000000 -0500
+++ linux-2.6.2-rc2-mm2/drivers/usb/input/hid-input.c 2004-01-30 06:38:45.000000000 -0500
@@ -377,7 +377,8 @@

set_bit(usage->type, input->evbit);
if ((usage->type == EV_REL)
- && (device->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK)
+ && (device->quirks & (HID_QUIRK_2WHEEL_MOUSE_HACK_BACK
+ | HID_QUIRK_2WHEEL_MOUSE_HACK_EXTRA))
&& (usage->code == REL_WHEEL)) {
set_bit(REL_HWHEEL, bit);
}
@@ -431,8 +432,8 @@

input_regs(input, regs);

- if ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK)
- && (usage->code == BTN_BACK || usage->code == BTN_EXTRA)) {
+ if (((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_EXTRA) && (usage->code == BTN_EXTRA))
+ || (hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_BACK) && (usage->code == BTN_BACK)) {
if (value)
hid->quirks |= HID_QUIRK_2WHEEL_MOUSE_HACK_ON;
else
diff -ur linux-2.6.2-rc2-mm2.orig/drivers/usb/input/hid.h linux-2.6.2-rc2-mm2/drivers/usb/input/hid.h
--- linux-2.6.2-rc2-mm2.orig/drivers/usb/input/hid.h 2004-01-30 05:54:18.000000000 -0500
+++ linux-2.6.2-rc2-mm2/drivers/usb/input/hid.h 2004-01-30 06:33:54.000000000 -0500
@@ -201,15 +201,16 @@
* HID device quirks.
*/

-#define HID_QUIRK_INVERT 0x001
-#define HID_QUIRK_NOTOUCH 0x002
-#define HID_QUIRK_IGNORE 0x004
-#define HID_QUIRK_NOGET 0x008
-#define HID_QUIRK_HIDDEV 0x010
-#define HID_QUIRK_BADPAD 0x020
-#define HID_QUIRK_MULTI_INPUT 0x040
-#define HID_QUIRK_2WHEEL_MOUSE_HACK 0x080
-#define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x100
+#define HID_QUIRK_INVERT 0x001
+#define HID_QUIRK_NOTOUCH 0x002
+#define HID_QUIRK_IGNORE 0x004
+#define HID_QUIRK_NOGET 0x008
+#define HID_QUIRK_HIDDEV 0x010
+#define HID_QUIRK_BADPAD 0x020
+#define HID_QUIRK_MULTI_INPUT 0x040
+#define HID_QUIRK_2WHEEL_MOUSE_HACK_BACK 0x080
+#define HID_QUIRK_2WHEEL_MOUSE_HACK_EXTRA 0x100
+#define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x200

/*
* This is the global environment of the parser. This information is

Attachment: signature.asc
Description: Digital signature