···629629 support for its special functionalities.630630631631config HID_SAITEK632632- tristate "Saitek non-fully HID-compliant devices"632632+ tristate "Saitek (Mad Catz) non-fully HID-compliant devices"633633 depends on HID634634 ---help---635635 Support for Saitek devices that are not fully compliant with the···637637638638 Supported devices:639639 - PS1000 Dual Analog Pad640640+ - R.A.T.9 Gaming Mouse640641 - R.A.T.7 Gaming Mouse641642 - M.M.O.7 Gaming Mouse642643
+10-11
drivers/hid/hid-core.c
···780780 hid->group = HID_GROUP_MULTITOUCH_WIN_8;781781782782 /*783783- * Vendor specific handlings784784- */785785- if ((hid->vendor == USB_VENDOR_ID_SYNAPTICS) &&786786- (hid->group == HID_GROUP_GENERIC) &&787787- /* only bind to the mouse interface of composite USB devices */788788- (hid->bus != BUS_USB || hid->type == HID_TYPE_USBMOUSE))789789- /* hid-rmi should take care of them, not hid-generic */790790- hid->group = HID_GROUP_RMI;791791-792792- /*793783 * Vendor specific handlings794784 */795785 switch (hid->vendor) {796786 case USB_VENDOR_ID_WACOM:797787 hid->group = HID_GROUP_WACOM;788788+ break;789789+ case USB_VENDOR_ID_SYNAPTICS:790790+ if ((hid->group == HID_GROUP_GENERIC) &&791791+ (hid->bus != BUS_USB || hid->type == HID_TYPE_USBMOUSE))792792+ /* hid-rmi should only bind to the mouse interface of793793+ * composite USB devices */794794+ hid->group = HID_GROUP_RMI;798795 break;799796 }800797···19071910 { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_PS1000) },19081911 { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_RAT7) },19091912 { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_MMO7) },19131913+ { HID_USB_DEVICE(USB_VENDOR_ID_MADCATZ, USB_DEVICE_ID_MADCATZ_RAT9) },19101914#endif19111915 { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE) },19121916 { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE) },···25372539 * Scan generic devices for group information25382540 */25392541 if (hid_ignore_special_drivers ||25402540- !hid_match_id(hdev, hid_have_special_driver)) {25422542+ (!hdev->group &&25432543+ !hid_match_id(hdev, hid_have_special_driver))) {25412544 ret = hid_scan_report(hdev);25422545 if (ret)25432546 hid_warn(hdev, "bad device descriptor (%d)\n", ret);
···77 * (This module is based on "hid-ortek".)88 * Copyright (c) 2012 Andreas Hübner99 *1010- * R.A.T.7, M.M.O.7 (USB gaming mice):1010+ * R.A.T.7, R.A.T.9, M.M.O.7 (USB gaming mice):1111 * Fixes the mode button which cycles through three constantly pressed1212 * buttons. All three press events are mapped to one button and the1313 * missing release event is generated immediately.···178178 { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_PS1000),179179 .driver_data = SAITEK_FIX_PS1000 },180180 { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_RAT7),181181+ .driver_data = SAITEK_RELEASE_MODE_RAT7 },182182+ { HID_USB_DEVICE(USB_VENDOR_ID_MADCATZ, USB_DEVICE_ID_MADCATZ_RAT9),181183 .driver_data = SAITEK_RELEASE_MODE_RAT7 },182184 { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_MMO7),183185 .driver_data = SAITEK_RELEASE_MODE_MMO7 },
+1-1
drivers/hid/i2c-hid/i2c-hid.c
···369369static void i2c_hid_get_input(struct i2c_hid *ihid)370370{371371 int ret, ret_size;372372- int size = le16_to_cpu(ihid->hdesc.wMaxInputLength);372372+ int size = ihid->bufsize;373373374374 ret = i2c_master_recv(ihid->client, ihid->inbuf, size);375375 if (ret != size) {
+24-12
drivers/hid/usbhid/hid-core.c
···278278 usbhid->retry_delay = 0;279279 if ((hid->quirks & HID_QUIRK_ALWAYS_POLL) && !hid->open)280280 break;281281- hid_input_report(urb->context, HID_INPUT_REPORT,282282- urb->transfer_buffer,283283- urb->actual_length, 1);284284- /*285285- * autosuspend refused while keys are pressed286286- * because most keyboards don't wake up when287287- * a key is released288288- */289289- if (hid_check_keys_pressed(hid))290290- set_bit(HID_KEYS_PRESSED, &usbhid->iofl);291291- else292292- clear_bit(HID_KEYS_PRESSED, &usbhid->iofl);281281+ if (!test_bit(HID_RESUME_RUNNING, &usbhid->iofl)) {282282+ hid_input_report(urb->context, HID_INPUT_REPORT,283283+ urb->transfer_buffer,284284+ urb->actual_length, 1);285285+ /*286286+ * autosuspend refused while keys are pressed287287+ * because most keyboards don't wake up when288288+ * a key is released289289+ */290290+ if (hid_check_keys_pressed(hid))291291+ set_bit(HID_KEYS_PRESSED, &usbhid->iofl);292292+ else293293+ clear_bit(HID_KEYS_PRESSED, &usbhid->iofl);294294+ }293295 break;294296 case -EPIPE: /* stall */295297 usbhid_mark_busy(usbhid);···690688 goto done;691689 }692690 usbhid->intf->needs_remote_wakeup = 1;691691+ set_bit(HID_RESUME_RUNNING, &usbhid->iofl);693692 res = hid_start_in(hid);694693 if (res) {695694 if (res != -ENOSPC) {···704701 }705702 }706703 usb_autopm_put_interface(usbhid->intf);704704+705705+ /*706706+ * In case events are generated while nobody was listening,707707+ * some are released when the device is re-opened.708708+ * Wait 50 msec for the queue to empty before allowing events709709+ * to go through hid.710710+ */711711+ msleep(50);712712+ clear_bit(HID_RESUME_RUNNING, &usbhid->iofl);707713 }708714done:709715 mutex_unlock(&hid_open_mut);
+1
drivers/hid/usbhid/usbhid.h
···5252#define HID_STARTED 85353#define HID_KEYS_PRESSED 105454#define HID_NO_BANDWIDTH 115555+#define HID_RESUME_RUNNING 1255565657/*5758 * USB-specific HID struct, to be pointed to