Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branches 'for-3.18/upstream-fixes' and 'for-3.19/upstream' into for-linus

Conflicts:
drivers/hid/hid-input.c

+50 -43
+2 -1
drivers/hid/Kconfig
··· 629 629 support for its special functionalities. 630 630 631 631 config HID_SAITEK 632 - tristate "Saitek non-fully HID-compliant devices" 632 + tristate "Saitek (Mad Catz) non-fully HID-compliant devices" 633 633 depends on HID 634 634 ---help--- 635 635 Support for Saitek devices that are not fully compliant with the ··· 637 637 638 638 Supported devices: 639 639 - PS1000 Dual Analog Pad 640 + - R.A.T.9 Gaming Mouse 640 641 - R.A.T.7 Gaming Mouse 641 642 - M.M.O.7 Gaming Mouse 642 643
+10 -11
drivers/hid/hid-core.c
··· 780 780 hid->group = HID_GROUP_MULTITOUCH_WIN_8; 781 781 782 782 /* 783 - * Vendor specific handlings 784 - */ 785 - if ((hid->vendor == USB_VENDOR_ID_SYNAPTICS) && 786 - (hid->group == HID_GROUP_GENERIC) && 787 - /* only bind to the mouse interface of composite USB devices */ 788 - (hid->bus != BUS_USB || hid->type == HID_TYPE_USBMOUSE)) 789 - /* hid-rmi should take care of them, not hid-generic */ 790 - hid->group = HID_GROUP_RMI; 791 - 792 - /* 793 783 * Vendor specific handlings 794 784 */ 795 785 switch (hid->vendor) { 796 786 case USB_VENDOR_ID_WACOM: 797 787 hid->group = HID_GROUP_WACOM; 788 + break; 789 + case USB_VENDOR_ID_SYNAPTICS: 790 + if ((hid->group == HID_GROUP_GENERIC) && 791 + (hid->bus != BUS_USB || hid->type == HID_TYPE_USBMOUSE)) 792 + /* hid-rmi should only bind to the mouse interface of 793 + * composite USB devices */ 794 + hid->group = HID_GROUP_RMI; 798 795 break; 799 796 } 800 797 ··· 1907 1910 { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_PS1000) }, 1908 1911 { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_RAT7) }, 1909 1912 { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_MMO7) }, 1913 + { HID_USB_DEVICE(USB_VENDOR_ID_MADCATZ, USB_DEVICE_ID_MADCATZ_RAT9) }, 1910 1914 #endif 1911 1915 { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE) }, 1912 1916 { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE) }, ··· 2537 2539 * Scan generic devices for group information 2538 2540 */ 2539 2541 if (hid_ignore_special_drivers || 2540 - !hid_match_id(hdev, hid_have_special_driver)) { 2542 + (!hdev->group && 2543 + !hid_match_id(hdev, hid_have_special_driver))) { 2541 2544 ret = hid_scan_report(hdev); 2542 2545 if (ret) 2543 2546 hid_warn(hdev, "bad device descriptor (%d)\n", ret);
+1
drivers/hid/hid-ids.h
··· 621 621 622 622 #define USB_VENDOR_ID_MADCATZ 0x0738 623 623 #define USB_DEVICE_ID_MADCATZ_BEATPAD 0x4540 624 + #define USB_DEVICE_ID_MADCATZ_RAT9 0x1709 624 625 625 626 #define USB_VENDOR_ID_MCC 0x09db 626 627 #define USB_DEVICE_ID_MCC_PMD1024LS 0x0076
+1 -1
drivers/hid/hid-input.c
··· 872 872 case 0x2cb: map_key_clear(KEY_KBDINPUTASSIST_ACCEPT); break; 873 873 case 0x2cc: map_key_clear(KEY_KBDINPUTASSIST_CANCEL); break; 874 874 875 - default: goto ignore; 875 + default: map_key_clear(KEY_UNKNOWN); 876 876 } 877 877 break; 878 878
+5 -4
drivers/hid/hid-roccat-kone.c
··· 46 46 static void kone_profile_report(struct kone_device *kone, uint new_profile) 47 47 { 48 48 struct kone_roccat_report roccat_report; 49 + 49 50 roccat_report.event = kone_mouse_event_switch_profile; 50 51 roccat_report.value = new_profile; 51 52 roccat_report.key = 0; ··· 164 163 struct kone_settings const *settings) 165 164 { 166 165 int retval; 166 + 167 167 retval = kone_send(usb_dev, kone_command_settings, 168 168 settings, sizeof(struct kone_settings)); 169 169 if (retval) ··· 389 387 .read = kone_sysfs_read_profilex, \ 390 388 .write = kone_sysfs_write_profilex, \ 391 389 .private = &profile_numbers[number-1], \ 392 - }; 390 + } 393 391 PROFILE_ATTR(1); 394 392 PROFILE_ATTR(2); 395 393 PROFILE_ATTR(3); ··· 458 456 static int kone_tcu_command(struct usb_device *usb_dev, int number) 459 457 { 460 458 unsigned char value; 459 + 461 460 value = number; 462 461 return kone_send(usb_dev, kone_command_calibrate, &value, 1); 463 462 } ··· 700 697 == USB_INTERFACE_PROTOCOL_MOUSE) { 701 698 702 699 kone = kzalloc(sizeof(*kone), GFP_KERNEL); 703 - if (!kone) { 704 - hid_err(hdev, "can't alloc device descriptor\n"); 700 + if (!kone) 705 701 return -ENOMEM; 706 - } 707 702 hid_set_drvdata(hdev, kone); 708 703 709 704 retval = kone_init_kone_device_struct(usb_dev, kone);
+3 -1
drivers/hid/hid-saitek.c
··· 7 7 * (This module is based on "hid-ortek".) 8 8 * Copyright (c) 2012 Andreas Hübner 9 9 * 10 - * R.A.T.7, M.M.O.7 (USB gaming mice): 10 + * R.A.T.7, R.A.T.9, M.M.O.7 (USB gaming mice): 11 11 * Fixes the mode button which cycles through three constantly pressed 12 12 * buttons. All three press events are mapped to one button and the 13 13 * missing release event is generated immediately. ··· 178 178 { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_PS1000), 179 179 .driver_data = SAITEK_FIX_PS1000 }, 180 180 { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_RAT7), 181 + .driver_data = SAITEK_RELEASE_MODE_RAT7 }, 182 + { HID_USB_DEVICE(USB_VENDOR_ID_MADCATZ, USB_DEVICE_ID_MADCATZ_RAT9), 181 183 .driver_data = SAITEK_RELEASE_MODE_RAT7 }, 182 184 { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_MMO7), 183 185 .driver_data = SAITEK_RELEASE_MODE_MMO7 },
+1 -1
drivers/hid/i2c-hid/i2c-hid.c
··· 369 369 static void i2c_hid_get_input(struct i2c_hid *ihid) 370 370 { 371 371 int ret, ret_size; 372 - int size = le16_to_cpu(ihid->hdesc.wMaxInputLength); 372 + int size = ihid->bufsize; 373 373 374 374 ret = i2c_master_recv(ihid->client, ihid->inbuf, size); 375 375 if (ret != size) {
+24 -12
drivers/hid/usbhid/hid-core.c
··· 278 278 usbhid->retry_delay = 0; 279 279 if ((hid->quirks & HID_QUIRK_ALWAYS_POLL) && !hid->open) 280 280 break; 281 - hid_input_report(urb->context, HID_INPUT_REPORT, 282 - urb->transfer_buffer, 283 - urb->actual_length, 1); 284 - /* 285 - * autosuspend refused while keys are pressed 286 - * because most keyboards don't wake up when 287 - * a key is released 288 - */ 289 - if (hid_check_keys_pressed(hid)) 290 - set_bit(HID_KEYS_PRESSED, &usbhid->iofl); 291 - else 292 - clear_bit(HID_KEYS_PRESSED, &usbhid->iofl); 281 + if (!test_bit(HID_RESUME_RUNNING, &usbhid->iofl)) { 282 + hid_input_report(urb->context, HID_INPUT_REPORT, 283 + urb->transfer_buffer, 284 + urb->actual_length, 1); 285 + /* 286 + * autosuspend refused while keys are pressed 287 + * because most keyboards don't wake up when 288 + * a key is released 289 + */ 290 + if (hid_check_keys_pressed(hid)) 291 + set_bit(HID_KEYS_PRESSED, &usbhid->iofl); 292 + else 293 + clear_bit(HID_KEYS_PRESSED, &usbhid->iofl); 294 + } 293 295 break; 294 296 case -EPIPE: /* stall */ 295 297 usbhid_mark_busy(usbhid); ··· 690 688 goto done; 691 689 } 692 690 usbhid->intf->needs_remote_wakeup = 1; 691 + set_bit(HID_RESUME_RUNNING, &usbhid->iofl); 693 692 res = hid_start_in(hid); 694 693 if (res) { 695 694 if (res != -ENOSPC) { ··· 704 701 } 705 702 } 706 703 usb_autopm_put_interface(usbhid->intf); 704 + 705 + /* 706 + * In case events are generated while nobody was listening, 707 + * some are released when the device is re-opened. 708 + * Wait 50 msec for the queue to empty before allowing events 709 + * to go through hid. 710 + */ 711 + msleep(50); 712 + clear_bit(HID_RESUME_RUNNING, &usbhid->iofl); 707 713 } 708 714 done: 709 715 mutex_unlock(&hid_open_mut);
+1
drivers/hid/usbhid/usbhid.h
··· 52 52 #define HID_STARTED 8 53 53 #define HID_KEYS_PRESSED 10 54 54 #define HID_NO_BANDWIDTH 11 55 + #define HID_RESUME_RUNNING 12 55 56 56 57 /* 57 58 * USB-specific HID struct, to be pointed to
+1 -8
drivers/hid/wacom_sys.c
··· 70 70 static int wacom_open(struct input_dev *dev) 71 71 { 72 72 struct wacom *wacom = input_get_drvdata(dev); 73 - int retval; 74 73 75 - mutex_lock(&wacom->lock); 76 - retval = hid_hw_open(wacom->hdev); 77 - mutex_unlock(&wacom->lock); 78 - 79 - return retval; 74 + return hid_hw_open(wacom->hdev); 80 75 } 81 76 82 77 static void wacom_close(struct input_dev *dev) 83 78 { 84 79 struct wacom *wacom = input_get_drvdata(dev); 85 80 86 - mutex_lock(&wacom->lock); 87 81 hid_hw_close(wacom->hdev); 88 - mutex_unlock(&wacom->lock); 89 82 } 90 83 91 84 /*
+1
drivers/hid/wacom_wac.c
··· 3026 3026 { USB_DEVICE_WACOM(0x4004) }, 3027 3027 { USB_DEVICE_WACOM(0x5000) }, 3028 3028 { USB_DEVICE_WACOM(0x5002) }, 3029 + { USB_DEVICE_LENOVO(0x6004) }, 3029 3030 3030 3031 { USB_DEVICE_WACOM(HID_ANY_ID) }, 3031 3032 { }
-4
include/linux/hid.h
··· 312 312 * Vendor specific HID device groups 313 313 */ 314 314 #define HID_GROUP_RMI 0x0100 315 - 316 - /* 317 - * Vendor specific HID device groups 318 - */ 319 315 #define HID_GROUP_WACOM 0x0101 320 316 321 317 /*