Make Logitech diNovo edge touchpad work as a mouse (as intended).

Mouse device shows multiple reports with the same usage, which makes
hid-input.c remap those instances of this usage to different events. As a
result, the actual GenericDesktop.X and .Y usages end up mapped to .Z and .RX
events, which prevents the mouse from working.

Signed-off-by: Stanislaw K Skowronek <[EMAIL PROTECTED]>

---

diff -uprN a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
--- a/drivers/usb/input/hid-core.c      2006-12-11 11:32:53.000000000 -0800
+++ b/drivers/usb/input/hid-core.c      2006-12-26 17:23:42.000000000 -0800
@@ -1643,6 +1643,9 @@ void hid_init_reports(struct hid_device 
 #define USB_VENDOR_ID_AIRCABLE         0x16CA
 #define USB_DEVICE_ID_AIRCABLE1                0x1502
 
+#define USB_VENDOR_ID_LOGITECH         0x046D
+#define USB_DEVICE_ID_DINOVO_EDGE_2ND  0xC714
+
 /*
  * Alphabetically sorted blacklist by quirk type.
  */
@@ -1812,7 +1815,9 @@ static const struct hid_blacklist {
        { USB_VENDOR_ID_PANJIT, 0x0004, HID_QUIRK_IGNORE },
 
        { USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_KEYBOARD, HID_QUIRK_NOGET 
},
-       
+
+       { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_DINOVO_EDGE_2ND, 
HID_QUIRK_NO_USAGE_UNIQUIFY },
+
        { 0, 0 }
 };
 
diff -uprN a/drivers/usb/input/hid-input.c b/drivers/usb/input/hid-input.c
--- a/drivers/usb/input/hid-input.c     2006-12-11 11:32:53.000000000 -0800
+++ b/drivers/usb/input/hid-input.c     2006-12-26 17:18:46.000000000 -0800
@@ -583,8 +583,11 @@ static void hidinput_configure_usage(str
 
        set_bit(usage->type, input->evbit);
 
-       while (usage->code <= max && test_and_set_bit(usage->code, bit))
-               usage->code = find_next_zero_bit(bit, max + 1, usage->code);
+       if(device->quirks & HID_QUIRK_NO_USAGE_UNIQUIFY)
+               set_bit(usage->code, bit);
+       else
+               while (usage->code <= max && test_and_set_bit(usage->code, bit))
+                       usage->code = find_next_zero_bit(bit, max + 1, 
usage->code);
 
        if (usage->code > max)
                goto ignore;
diff -uprN a/drivers/usb/input/hid.h b/drivers/usb/input/hid.h
--- a/drivers/usb/input/hid.h   2006-12-11 11:32:53.000000000 -0800
+++ b/drivers/usb/input/hid.h   2006-12-26 17:18:08.000000000 -0800
@@ -261,6 +261,7 @@ struct hid_item {
 #define HID_QUIRK_POWERBOOK_FN_ON              0x00002000
 #define HID_QUIRK_INVERT_HWHEEL                        0x00004000
 #define HID_QUIRK_POWERBOOK_ISO_KEYBOARD       0x00008000
+#define HID_QUIRK_NO_USAGE_UNIQUIFY            0x00010000
 
 /*
  * This is the global environment of the parser. This information is

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

Reply via email to