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

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid

Pull HID fixes from Jiri Kosina:

- Workaround for device ID conflict between Masterkit MA901 usb radio
device and Atmel V-USB devices, to avoid regressions from older
kernels, by Alexey Klimov

- fix for possible race during input device registration in magicmouse
driver, by Benjamin Tissoires

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
HID: magicmouse: fix race between input_register() and probe()
media: radio-ma901: return ENODEV in probe if usb_device doesn't match
HID: fix Masterkit MA901 hid quirks

+45 -13
+12 -1
drivers/hid/hid-core.c
··· 2077 2077 { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_HYBRID) }, 2078 2078 { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_HEATCONTROL) }, 2079 2079 { HID_USB_DEVICE(USB_VENDOR_ID_MADCATZ, USB_DEVICE_ID_MADCATZ_BEATPAD) }, 2080 - { HID_USB_DEVICE(USB_VENDOR_ID_MASTERKIT, USB_DEVICE_ID_MASTERKIT_MA901RADIO) }, 2081 2080 { HID_USB_DEVICE(USB_VENDOR_ID_MCC, USB_DEVICE_ID_MCC_PMD1024LS) }, 2082 2081 { HID_USB_DEVICE(USB_VENDOR_ID_MCC, USB_DEVICE_ID_MCC_PMD1208LS) }, 2083 2082 { HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICKIT1) }, ··· 2241 2242 hdev->product <= USB_DEVICE_ID_VELLEMAN_K8055_LAST) || 2242 2243 (hdev->product >= USB_DEVICE_ID_VELLEMAN_K8061_FIRST && 2243 2244 hdev->product <= USB_DEVICE_ID_VELLEMAN_K8061_LAST)) 2245 + return true; 2246 + break; 2247 + case USB_VENDOR_ID_ATMEL_V_USB: 2248 + /* Masterkit MA901 usb radio based on Atmel tiny85 chip and 2249 + * it has the same USB ID as many Atmel V-USB devices. This 2250 + * usb radio is handled by radio-ma901.c driver so we want 2251 + * ignore the hid. Check the name, bus, product and ignore 2252 + * if we have MA901 usb radio. 2253 + */ 2254 + if (hdev->product == USB_DEVICE_ID_ATMEL_V_USB && 2255 + hdev->bus == BUS_USB && 2256 + strncmp(hdev->name, "www.masterkit.ru MA901", 22) == 0) 2244 2257 return true; 2245 2258 break; 2246 2259 }
+2 -3
drivers/hid/hid-ids.h
··· 158 158 #define USB_VENDOR_ID_ATMEL 0x03eb 159 159 #define USB_DEVICE_ID_ATMEL_MULTITOUCH 0x211c 160 160 #define USB_DEVICE_ID_ATMEL_MXT_DIGITIZER 0x2118 161 + #define USB_VENDOR_ID_ATMEL_V_USB 0x16c0 162 + #define USB_DEVICE_ID_ATMEL_V_USB 0x05df 161 163 162 164 #define USB_VENDOR_ID_AUREAL 0x0755 163 165 #define USB_DEVICE_ID_AUREAL_W01RN 0x2626 ··· 558 556 559 557 #define USB_VENDOR_ID_MADCATZ 0x0738 560 558 #define USB_DEVICE_ID_MADCATZ_BEATPAD 0x4540 561 - 562 - #define USB_VENDOR_ID_MASTERKIT 0x16c0 563 - #define USB_DEVICE_ID_MASTERKIT_MA901RADIO 0x05df 564 559 565 560 #define USB_VENDOR_ID_MCC 0x09db 566 561 #define USB_DEVICE_ID_MCC_PMD1024LS 0x0076
+20 -9
drivers/hid/hid-magicmouse.c
··· 462 462 return 0; 463 463 } 464 464 465 + static void magicmouse_input_configured(struct hid_device *hdev, 466 + struct hid_input *hi) 467 + 468 + { 469 + struct magicmouse_sc *msc = hid_get_drvdata(hdev); 470 + 471 + int ret = magicmouse_setup_input(msc->input, hdev); 472 + if (ret) { 473 + hid_err(hdev, "magicmouse setup input failed (%d)\n", ret); 474 + /* clean msc->input to notify probe() of the failure */ 475 + msc->input = NULL; 476 + } 477 + } 478 + 479 + 465 480 static int magicmouse_probe(struct hid_device *hdev, 466 481 const struct hid_device_id *id) 467 482 { ··· 508 493 goto err_free; 509 494 } 510 495 511 - /* We do this after hid-input is done parsing reports so that 512 - * hid-input uses the most natural button and axis IDs. 513 - */ 514 - if (msc->input) { 515 - ret = magicmouse_setup_input(msc->input, hdev); 516 - if (ret) { 517 - hid_err(hdev, "magicmouse setup input failed (%d)\n", ret); 518 - goto err_stop_hw; 519 - } 496 + if (!msc->input) { 497 + hid_err(hdev, "magicmouse input not registered\n"); 498 + ret = -ENOMEM; 499 + goto err_stop_hw; 520 500 } 521 501 522 502 if (id->product == USB_DEVICE_ID_APPLE_MAGICMOUSE) ··· 578 568 .remove = magicmouse_remove, 579 569 .raw_event = magicmouse_raw_event, 580 570 .input_mapping = magicmouse_input_mapping, 571 + .input_configured = magicmouse_input_configured, 581 572 }; 582 573 module_hid_driver(magicmouse_driver); 583 574
+11
drivers/media/radio/radio-ma901.c
··· 347 347 static int usb_ma901radio_probe(struct usb_interface *intf, 348 348 const struct usb_device_id *id) 349 349 { 350 + struct usb_device *dev = interface_to_usbdev(intf); 350 351 struct ma901radio_device *radio; 351 352 int retval = 0; 353 + 354 + /* Masterkit MA901 usb radio has the same USB ID as many others 355 + * Atmel V-USB devices. Let's make additional checks to be sure 356 + * that this is our device. 357 + */ 358 + 359 + if (dev->product && dev->manufacturer && 360 + (strncmp(dev->product, "MA901", 5) != 0 361 + || strncmp(dev->manufacturer, "www.masterkit.ru", 16) != 0)) 362 + return -ENODEV; 352 363 353 364 radio = kzalloc(sizeof(struct ma901radio_device), GFP_KERNEL); 354 365 if (!radio) {