Pull HID fixes from Jiri Kosina: - fix compat ioctl leak in uhid, by David Herrmann - fix scheduling in atomic context (causing actual lockups in real world) in hid-sony driver, by Sven Eckelmann - revert patch introducing VID/PID conflict, by Jiri Kosina - support from various new device IDs by Benjamin Tissoires and KaiChung Cheng * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: HID: uhid: fix leak for 64/32 UHID_CREATE HID: kye: fix unresponsive keyboard HID: kye: Add report fixup for Genius Manticore Keyboard HID: multicouh: add PID VID to support 1 new Wistron optical touch device HID: appleir: force input to be set Revert "HID: wiimote: add LEGO-wiimote VID" HID: sony: Send FF commands in non-atomic context
Unified · Split
| @@ -460,6 +460,7 @@ config HID_MULTITOUCH · 459 unmodified lines | ||
| 460 | 460 | - Stantum multitouch panels |
| 461 | 461 | - Touch International Panels |
| 462 | 462 | - Unitec Panels |
| 463 | + - Wistron optical touch panels | |
| 463 | 464 | - XAT optical touch panels |
| 464 | 465 | - Xiroku optical touch panels |
| 465 | 466 | - Zytronic touch panels |
| @@ -297,6 +297,9 @@ static int appleir_probe(struct hid_device *hid, const struct hid_device_id *id) · 296 unmodified lines | ||
| 297 | 297 | |
| 298 | 298 | appleir->hid = hid; |
| 299 | 299 | |
| 300 | + /* force input as some remotes bypass the input registration */ | |
| 301 | + hid->quirks |= HID_QUIRK_HIDINPUT_FORCE; | |
| 302 | + | |
| 300 | 303 | spin_lock_init(&appleir->lock); |
| 301 | 304 | setup_timer(&appleir->key_up_timer, |
| 302 | 305 | key_up_tick, (unsigned long) appleir); |
| @@ -1723,6 +1723,7 @@ static const struct hid_device_id hid_have_special_driver[] = { · 1722 unmodified lines | ||
| 1723 | 1723 | { HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) }, |
| 1724 | 1724 | { HID_USB_DEVICE(USB_VENDOR_ID_KEYTOUCH, USB_DEVICE_ID_KEYTOUCH_IEC) }, |
| 1725 | 1725 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE) }, |
| 1726 | + { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_GENIUS_MANTICORE) }, | |
| 1726 | 1727 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_GENIUS_GX_IMPERATOR) }, |
| 1727 | 1728 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_ERGO_525V) }, |
| 1728 | 1729 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_I405X) }, |
| @@ -1879,7 +1880,6 @@ static const struct hid_device_id hid_have_special_driver[] = { · 150 unmodified lines | ||
| 1879 | 1880 | |
| 1880 | 1881 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_BT) }, |
| 1881 | 1882 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE) }, |
| 1882 | − { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO2, USB_DEVICE_ID_NINTENDO_WIIMOTE) }, | |
| 1883 | 1883 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE2) }, |
| 1884 | 1884 | { } |
| 1885 | 1885 | }; |
| @@ -489,6 +489,7 @@ · 488 unmodified lines | ||
| 489 | 489 | #define USB_VENDOR_ID_KYE 0x0458 |
| 490 | 490 | #define USB_DEVICE_ID_KYE_ERGO_525V 0x0087 |
| 491 | 491 | #define USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE 0x0138 |
| 492 | +#define USB_DEVICE_ID_GENIUS_MANTICORE 0x0153 | |
| 492 | 493 | #define USB_DEVICE_ID_GENIUS_GX_IMPERATOR 0x4018 |
| 493 | 494 | #define USB_DEVICE_ID_KYE_GPEN_560 0x5003 |
| 494 | 495 | #define USB_DEVICE_ID_KYE_EASYPEN_I405X 0x5010 |
| @@ -640,7 +641,6 @@ · 145 unmodified lines | ||
| 640 | 641 | #define USB_DEVICE_ID_NEXTWINDOW_TOUCHSCREEN 0x0003 |
| 641 | 642 | |
| 642 | 643 | #define USB_VENDOR_ID_NINTENDO 0x057e |
| 643 | −#define USB_VENDOR_ID_NINTENDO2 0x054c | |
| 644 | 644 | #define USB_DEVICE_ID_NINTENDO_WIIMOTE 0x0306 |
| 645 | 645 | #define USB_DEVICE_ID_NINTENDO_WIIMOTE2 0x0330 |
| 646 | 646 | |
| @@ -902,6 +902,9 @@ · 255 unmodified lines | ||
| 902 | 902 | #define USB_DEVICE_ID_SUPER_DUAL_BOX_PRO 0x8802 |
| 903 | 903 | #define USB_DEVICE_ID_SUPER_JOY_BOX_5_PRO 0x8804 |
| 904 | 904 | |
| 905 | +#define USB_VENDOR_ID_WISTRON 0x0fb8 | |
| 906 | +#define USB_DEVICE_ID_WISTRON_OPTICAL_TOUCH 0x1109 | |
| 907 | + | |
| 905 | 908 | #define USB_VENDOR_ID_X_TENSIONS 0x1ae7 |
| 906 | 909 | #define USB_DEVICE_ID_SPEEDLINK_VAD_CEZANNE 0x9001 |
| 907 | 910 | |
| @@ -341,6 +341,9 @@ static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc, · 340 unmodified lines | ||
| 341 | 341 | case USB_DEVICE_ID_GENIUS_GX_IMPERATOR: |
| 342 | 342 | rdesc = kye_consumer_control_fixup(hdev, rdesc, rsize, 83, |
| 343 | 343 | "Genius Gx Imperator Keyboard"); |
| 344 | + case USB_DEVICE_ID_GENIUS_MANTICORE: | |
| 345 | + rdesc = kye_consumer_control_fixup(hdev, rdesc, rsize, 104, | |
| 346 | + "Genius Manticore Keyboard"); | |
| 344 | 347 | break; |
| 345 | 348 | } |
| 346 | 349 | return rdesc; |
| @@ -418,6 +421,14 @@ static int kye_probe(struct hid_device *hdev, const struct hid_device_id *id) · 71 unmodified lines | ||
| 418 | 421 | goto enabling_err; |
| 419 | 422 | } |
| 420 | 423 | break; |
| 424 | + case USB_DEVICE_ID_GENIUS_MANTICORE: | |
| 425 | + /* | |
| 426 | + * The manticore keyboard needs to have all the interfaces | |
| 427 | + * opened at least once to be fully functional. | |
| 428 | + */ | |
| 429 | + if (hid_hw_open(hdev)) | |
| 430 | + hid_hw_close(hdev); | |
| 431 | + break; | |
| 421 | 432 | } |
| 422 | 433 | |
| 423 | 434 | return 0; |
| @@ -439,6 +450,8 @@ static const struct hid_device_id kye_devices[] = { · 15 unmodified lines | ||
| 439 | 450 | USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE) }, |
| 440 | 451 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, |
| 441 | 452 | USB_DEVICE_ID_GENIUS_GX_IMPERATOR) }, |
| 453 | + { HID_USB_DEVICE(USB_VENDOR_ID_KYE, | |
| 454 | + USB_DEVICE_ID_GENIUS_MANTICORE) }, | |
| 442 | 455 | { } |
| 443 | 456 | }; |
| 444 | 457 | MODULE_DEVICE_TABLE(hid, kye_devices); |
| @@ -1335,6 +1335,12 @@ static const struct hid_device_id mt_devices[] = { · 1334 unmodified lines | ||
| 1335 | 1335 | { .driver_data = MT_CLS_NSMU, |
| 1336 | 1336 | MT_USB_DEVICE(USB_VENDOR_ID_UNITEC, |
| 1337 | 1337 | USB_DEVICE_ID_UNITEC_USB_TOUCH_0A19) }, |
| 1338 | + | |
| 1339 | + /* Wistron panels */ | |
| 1340 | + { .driver_data = MT_CLS_NSMU, | |
| 1341 | + MT_USB_DEVICE(USB_VENDOR_ID_WISTRON, | |
| 1342 | + USB_DEVICE_ID_WISTRON_OPTICAL_TOUCH) }, | |
| 1343 | + | |
| 1338 | 1344 | /* XAT */ |
| 1339 | 1345 | { .driver_data = MT_CLS_NSMU, |
| 1340 | 1346 | MT_USB_DEVICE(USB_VENDOR_ID_XAT, |
| @@ -225,6 +225,13 @@ static const unsigned int buzz_keymap[] = { · 224 unmodified lines | ||
| 225 | 225 | struct sony_sc { |
| 226 | 226 | unsigned long quirks; |
| 227 | 227 | |
| 228 | +#ifdef CONFIG_SONY_FF | |
| 229 | + struct work_struct rumble_worker; | |
| 230 | + struct hid_device *hdev; | |
| 231 | + __u8 left; | |
| 232 | + __u8 right; | |
| 233 | +#endif | |
| 234 | + | |
| 228 | 235 | void *extra; |
| 229 | 236 | }; |
| 230 | 237 | |
| @@ -615,9 +622,9 @@ static void buzz_remove(struct hid_device *hdev) · 384 unmodified lines | ||
| 615 | 622 | } |
| 616 | 623 | |
| 617 | 624 | #ifdef CONFIG_SONY_FF |
| 618 | −static int sony_play_effect(struct input_dev *dev, void *data, | |
| 619 | − struct ff_effect *effect) | |
| 625 | +static void sony_rumble_worker(struct work_struct *work) | |
| 620 | 626 | { |
| 627 | + struct sony_sc *sc = container_of(work, struct sony_sc, rumble_worker); | |
| 621 | 628 | unsigned char buf[] = { |
| 622 | 629 | 0x01, |
| 623 | 630 | 0x00, 0xff, 0x00, 0xff, 0x00, |
| @@ -628,21 +635,28 @@ static int sony_play_effect(struct input_dev *dev, void *data, · 4 unmodified lines | ||
| 628 | 635 | 0xff, 0x27, 0x10, 0x00, 0x32, |
| 629 | 636 | 0x00, 0x00, 0x00, 0x00, 0x00 |
| 630 | 637 | }; |
| 631 | − __u8 left; | |
| 632 | − __u8 right; | |
| 638 | + | |
| 639 | + buf[3] = sc->right; | |
| 640 | + buf[5] = sc->left; | |
| 641 | + | |
| 642 | + sc->hdev->hid_output_raw_report(sc->hdev, buf, sizeof(buf), | |
| 643 | + HID_OUTPUT_REPORT); | |
| 644 | +} | |
| 645 | + | |
| 646 | +static int sony_play_effect(struct input_dev *dev, void *data, | |
| 647 | + struct ff_effect *effect) | |
| 648 | +{ | |
| 633 | 649 | struct hid_device *hid = input_get_drvdata(dev); |
| 650 | + struct sony_sc *sc = hid_get_drvdata(hid); | |
| 634 | 651 | |
| 635 | 652 | if (effect->type != FF_RUMBLE) |
| 636 | 653 | return 0; |
| 637 | 654 | |
| 638 | − left = effect->u.rumble.strong_magnitude / 256; | |
| 639 | − right = effect->u.rumble.weak_magnitude ? 1 : 0; | |
| 640 | − | |
| 641 | − buf[3] = right; | |
| 642 | − buf[5] = left; | |
| 655 | + sc->left = effect->u.rumble.strong_magnitude / 256; | |
| 656 | + sc->right = effect->u.rumble.weak_magnitude ? 1 : 0; | |
| 643 | 657 | |
| 644 | − return hid->hid_output_raw_report(hid, buf, sizeof(buf), | |
| 645 | − HID_OUTPUT_REPORT); | |
| 658 | + schedule_work(&sc->rumble_worker); | |
| 659 | + return 0; | |
| 646 | 660 | } |
| 647 | 661 | |
| 648 | 662 | static int sony_init_ff(struct hid_device *hdev) |
| @@ -650,16 +664,31 @@ static int sony_init_ff(struct hid_device *hdev) · 1 unmodified line | ||
| 650 | 664 | struct hid_input *hidinput = list_entry(hdev->inputs.next, |
| 651 | 665 | struct hid_input, list); |
| 652 | 666 | struct input_dev *input_dev = hidinput->input; |
| 667 | + struct sony_sc *sc = hid_get_drvdata(hdev); | |
| 668 | + | |
| 669 | + sc->hdev = hdev; | |
| 670 | + INIT_WORK(&sc->rumble_worker, sony_rumble_worker); | |
| 653 | 671 | |
| 654 | 672 | input_set_capability(input_dev, EV_FF, FF_RUMBLE); |
| 655 | 673 | return input_ff_create_memless(input_dev, NULL, sony_play_effect); |
| 656 | 674 | } |
| 657 | 675 | |
| 676 | +static void sony_destroy_ff(struct hid_device *hdev) | |
| 677 | +{ | |
| 678 | + struct sony_sc *sc = hid_get_drvdata(hdev); | |
| 679 | + | |
| 680 | + cancel_work_sync(&sc->rumble_worker); | |
| 681 | +} | |
| 682 | + | |
| 658 | 683 | #else |
| 659 | 684 | static int sony_init_ff(struct hid_device *hdev) |
| 660 | 685 | { |
| 661 | 686 | return 0; |
| 662 | 687 | } |
| 688 | + | |
| 689 | +static void sony_destroy_ff(struct hid_device *hdev) | |
| 690 | +{ | |
| 691 | +} | |
| 663 | 692 | #endif |
| 664 | 693 | |
| 665 | 694 | static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) |
| @@ -728,6 +757,8 @@ static void sony_remove(struct hid_device *hdev) · 62 unmodified lines | ||
| 728 | 757 | if (sc->quirks & BUZZ_CONTROLLER) |
| 729 | 758 | buzz_remove(hdev); |
| 730 | 759 | |
| 760 | + sony_destroy_ff(hdev); | |
| 761 | + | |
| 731 | 762 | hid_hw_stop(hdev); |
| 732 | 763 | } |
| 733 | 764 | |
| @@ -834,8 +834,7 @@ static void wiimote_init_set_type(struct wiimote_data *wdata, · 833 unmodified lines | ||
| 834 | 834 | goto done; |
| 835 | 835 | } |
| 836 | 836 | |
| 837 | − if (vendor == USB_VENDOR_ID_NINTENDO || | |
| 838 | − vendor == USB_VENDOR_ID_NINTENDO2) { | |
| 837 | + if (vendor == USB_VENDOR_ID_NINTENDO) { | |
| 839 | 838 | if (product == USB_DEVICE_ID_NINTENDO_WIIMOTE) { |
| 840 | 839 | devtype = WIIMOTE_DEV_GEN10; |
| 841 | 840 | goto done; |
| @@ -1856,8 +1855,6 @@ static void wiimote_hid_remove(struct hid_device *hdev) · 1014 unmodified lines | ||
| 1856 | 1855 | static const struct hid_device_id wiimote_hid_devices[] = { |
| 1857 | 1856 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, |
| 1858 | 1857 | USB_DEVICE_ID_NINTENDO_WIIMOTE) }, |
| 1859 | − { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO2, | |
| 1860 | − USB_DEVICE_ID_NINTENDO_WIIMOTE) }, | |
| 1861 | 1858 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, |
| 1862 | 1859 | USB_DEVICE_ID_NINTENDO_WIIMOTE2) }, |
| 1863 | 1860 | { } |
| @@ -287,7 +287,7 @@ static int uhid_event_from_user(const char __user *buffer, size_t len, · 286 unmodified lines | ||
| 287 | 287 | */ |
| 288 | 288 | struct uhid_create_req_compat *compat; |
| 289 | 289 | |
| 290 | − compat = kmalloc(sizeof(*compat), GFP_KERNEL); | |
| 290 | + compat = kzalloc(sizeof(*compat), GFP_KERNEL); | |
| 291 | 291 | if (!compat) |
| 292 | 292 | return -ENOMEM; |
| 293 | 293 | |