aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-11-27 23:41:54 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-27 23:41:54 -0500
commitba33fef0f62a97e1faf285a5ee2bcad85622f4fd (patch)
tree20cfba3b21a8edaffc118958cc0a1d7f746ac3cb /drivers/hid
parentb7fe6bf7f40e73400a4da959d1ba14e29961c6de (diff)
parent80897aa787ecd58eabb29deab7cbec9249c9b7e6 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
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
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/Kconfig1
-rw-r--r--drivers/hid/hid-appleir.c3
-rw-r--r--drivers/hid/hid-core.c2
-rw-r--r--drivers/hid/hid-ids.h5
-rw-r--r--drivers/hid/hid-kye.c13
-rw-r--r--drivers/hid/hid-multitouch.c6
-rw-r--r--drivers/hid/hid-sony.c53
-rw-r--r--drivers/hid/hid-wiimote-core.c5
-rw-r--r--drivers/hid/uhid.c2
9 files changed, 72 insertions, 18 deletions
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index 329fbb9b5976..34e2d39d4ce8 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -460,6 +460,7 @@ config HID_MULTITOUCH
460 - Stantum multitouch panels 460 - Stantum multitouch panels
461 - Touch International Panels 461 - Touch International Panels
462 - Unitec Panels 462 - Unitec Panels
463 - Wistron optical touch panels
463 - XAT optical touch panels 464 - XAT optical touch panels
464 - Xiroku optical touch panels 465 - Xiroku optical touch panels
465 - Zytronic touch panels 466 - Zytronic touch panels
diff --git a/drivers/hid/hid-appleir.c b/drivers/hid/hid-appleir.c
index a42e6a394c5e..0e6a42d37eb6 100644
--- a/drivers/hid/hid-appleir.c
+++ b/drivers/hid/hid-appleir.c
@@ -297,6 +297,9 @@ static int appleir_probe(struct hid_device *hid, const struct hid_device_id *id)
297 297
298 appleir->hid = hid; 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 spin_lock_init(&appleir->lock); 303 spin_lock_init(&appleir->lock);
301 setup_timer(&appleir->key_up_timer, 304 setup_timer(&appleir->key_up_timer,
302 key_up_tick, (unsigned long) appleir); 305 key_up_tick, (unsigned long) appleir);
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 8c10f2742233..253fe23ef7fe 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1723,6 +1723,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
1723 { HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) }, 1723 { HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) },
1724 { HID_USB_DEVICE(USB_VENDOR_ID_KEYTOUCH, USB_DEVICE_ID_KEYTOUCH_IEC) }, 1724 { HID_USB_DEVICE(USB_VENDOR_ID_KEYTOUCH, USB_DEVICE_ID_KEYTOUCH_IEC) },
1725 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE) }, 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 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_GENIUS_GX_IMPERATOR) }, 1727 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_GENIUS_GX_IMPERATOR) },
1727 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_ERGO_525V) }, 1728 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_ERGO_525V) },
1728 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_I405X) }, 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[] = {
1879 1880
1880 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_BT) }, 1881 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_BT) },
1881 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE) }, 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 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE2) }, 1883 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE2) },
1884 { } 1884 { }
1885}; 1885};
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 76559629568c..f9304cb37154 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -489,6 +489,7 @@
489#define USB_VENDOR_ID_KYE 0x0458 489#define USB_VENDOR_ID_KYE 0x0458
490#define USB_DEVICE_ID_KYE_ERGO_525V 0x0087 490#define USB_DEVICE_ID_KYE_ERGO_525V 0x0087
491#define USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE 0x0138 491#define USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE 0x0138
492#define USB_DEVICE_ID_GENIUS_MANTICORE 0x0153
492#define USB_DEVICE_ID_GENIUS_GX_IMPERATOR 0x4018 493#define USB_DEVICE_ID_GENIUS_GX_IMPERATOR 0x4018
493#define USB_DEVICE_ID_KYE_GPEN_560 0x5003 494#define USB_DEVICE_ID_KYE_GPEN_560 0x5003
494#define USB_DEVICE_ID_KYE_EASYPEN_I405X 0x5010 495#define USB_DEVICE_ID_KYE_EASYPEN_I405X 0x5010
@@ -640,7 +641,6 @@
640#define USB_DEVICE_ID_NEXTWINDOW_TOUCHSCREEN 0x0003 641#define USB_DEVICE_ID_NEXTWINDOW_TOUCHSCREEN 0x0003
641 642
642#define USB_VENDOR_ID_NINTENDO 0x057e 643#define USB_VENDOR_ID_NINTENDO 0x057e
643#define USB_VENDOR_ID_NINTENDO2 0x054c
644#define USB_DEVICE_ID_NINTENDO_WIIMOTE 0x0306 644#define USB_DEVICE_ID_NINTENDO_WIIMOTE 0x0306
645#define USB_DEVICE_ID_NINTENDO_WIIMOTE2 0x0330 645#define USB_DEVICE_ID_NINTENDO_WIIMOTE2 0x0330
646 646
@@ -902,6 +902,9 @@
902#define USB_DEVICE_ID_SUPER_DUAL_BOX_PRO 0x8802 902#define USB_DEVICE_ID_SUPER_DUAL_BOX_PRO 0x8802
903#define USB_DEVICE_ID_SUPER_JOY_BOX_5_PRO 0x8804 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#define USB_VENDOR_ID_X_TENSIONS 0x1ae7 908#define USB_VENDOR_ID_X_TENSIONS 0x1ae7
906#define USB_DEVICE_ID_SPEEDLINK_VAD_CEZANNE 0x9001 909#define USB_DEVICE_ID_SPEEDLINK_VAD_CEZANNE 0x9001
907 910
diff --git a/drivers/hid/hid-kye.c b/drivers/hid/hid-kye.c
index 73845120295e..ecb5ca669e97 100644
--- a/drivers/hid/hid-kye.c
+++ b/drivers/hid/hid-kye.c
@@ -341,6 +341,9 @@ static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc,
341 case USB_DEVICE_ID_GENIUS_GX_IMPERATOR: 341 case USB_DEVICE_ID_GENIUS_GX_IMPERATOR:
342 rdesc = kye_consumer_control_fixup(hdev, rdesc, rsize, 83, 342 rdesc = kye_consumer_control_fixup(hdev, rdesc, rsize, 83,
343 "Genius Gx Imperator Keyboard"); 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 break; 347 break;
345 } 348 }
346 return rdesc; 349 return rdesc;
@@ -418,6 +421,14 @@ static int kye_probe(struct hid_device *hdev, const struct hid_device_id *id)
418 goto enabling_err; 421 goto enabling_err;
419 } 422 }
420 break; 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 return 0; 434 return 0;
@@ -439,6 +450,8 @@ static const struct hid_device_id kye_devices[] = {
439 USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE) }, 450 USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE) },
440 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, 451 { HID_USB_DEVICE(USB_VENDOR_ID_KYE,
441 USB_DEVICE_ID_GENIUS_GX_IMPERATOR) }, 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};
444MODULE_DEVICE_TABLE(hid, kye_devices); 457MODULE_DEVICE_TABLE(hid, kye_devices);
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index a2cedb8ae1c0..d83b1e8b505b 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -1335,6 +1335,12 @@ static const struct hid_device_id mt_devices[] = {
1335 { .driver_data = MT_CLS_NSMU, 1335 { .driver_data = MT_CLS_NSMU,
1336 MT_USB_DEVICE(USB_VENDOR_ID_UNITEC, 1336 MT_USB_DEVICE(USB_VENDOR_ID_UNITEC,
1337 USB_DEVICE_ID_UNITEC_USB_TOUCH_0A19) }, 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 /* XAT */ 1344 /* XAT */
1339 { .driver_data = MT_CLS_NSMU, 1345 { .driver_data = MT_CLS_NSMU,
1340 MT_USB_DEVICE(USB_VENDOR_ID_XAT, 1346 MT_USB_DEVICE(USB_VENDOR_ID_XAT,
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index da551d113762..098af2f84b8c 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -225,6 +225,13 @@ static const unsigned int buzz_keymap[] = {
225struct sony_sc { 225struct sony_sc {
226 unsigned long quirks; 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 void *extra; 235 void *extra;
229}; 236};
230 237
@@ -615,9 +622,9 @@ static void buzz_remove(struct hid_device *hdev)
615} 622}
616 623
617#ifdef CONFIG_SONY_FF 624#ifdef CONFIG_SONY_FF
618static int sony_play_effect(struct input_dev *dev, void *data, 625static void sony_rumble_worker(struct work_struct *work)
619 struct ff_effect *effect)
620{ 626{
627 struct sony_sc *sc = container_of(work, struct sony_sc, rumble_worker);
621 unsigned char buf[] = { 628 unsigned char buf[] = {
622 0x01, 629 0x01,
623 0x00, 0xff, 0x00, 0xff, 0x00, 630 0x00, 0xff, 0x00, 0xff, 0x00,
@@ -628,21 +635,28 @@ static int sony_play_effect(struct input_dev *dev, void *data,
628 0xff, 0x27, 0x10, 0x00, 0x32, 635 0xff, 0x27, 0x10, 0x00, 0x32,
629 0x00, 0x00, 0x00, 0x00, 0x00 636 0x00, 0x00, 0x00, 0x00, 0x00
630 }; 637 };
631 __u8 left; 638
632 __u8 right; 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
646static int sony_play_effect(struct input_dev *dev, void *data,
647 struct ff_effect *effect)
648{
633 struct hid_device *hid = input_get_drvdata(dev); 649 struct hid_device *hid = input_get_drvdata(dev);
650 struct sony_sc *sc = hid_get_drvdata(hid);
634 651
635 if (effect->type != FF_RUMBLE) 652 if (effect->type != FF_RUMBLE)
636 return 0; 653 return 0;
637 654
638 left = effect->u.rumble.strong_magnitude / 256; 655 sc->left = effect->u.rumble.strong_magnitude / 256;
639 right = effect->u.rumble.weak_magnitude ? 1 : 0; 656 sc->right = effect->u.rumble.weak_magnitude ? 1 : 0;
640
641 buf[3] = right;
642 buf[5] = left;
643 657
644 return hid->hid_output_raw_report(hid, buf, sizeof(buf), 658 schedule_work(&sc->rumble_worker);
645 HID_OUTPUT_REPORT); 659 return 0;
646} 660}
647 661
648static int sony_init_ff(struct hid_device *hdev) 662static int sony_init_ff(struct hid_device *hdev)
@@ -650,16 +664,31 @@ static int sony_init_ff(struct hid_device *hdev)
650 struct hid_input *hidinput = list_entry(hdev->inputs.next, 664 struct hid_input *hidinput = list_entry(hdev->inputs.next,
651 struct hid_input, list); 665 struct hid_input, list);
652 struct input_dev *input_dev = hidinput->input; 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 input_set_capability(input_dev, EV_FF, FF_RUMBLE); 672 input_set_capability(input_dev, EV_FF, FF_RUMBLE);
655 return input_ff_create_memless(input_dev, NULL, sony_play_effect); 673 return input_ff_create_memless(input_dev, NULL, sony_play_effect);
656} 674}
657 675
676static 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#else 683#else
659static int sony_init_ff(struct hid_device *hdev) 684static int sony_init_ff(struct hid_device *hdev)
660{ 685{
661 return 0; 686 return 0;
662} 687}
688
689static void sony_destroy_ff(struct hid_device *hdev)
690{
691}
663#endif 692#endif
664 693
665static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) 694static 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)
728 if (sc->quirks & BUZZ_CONTROLLER) 757 if (sc->quirks & BUZZ_CONTROLLER)
729 buzz_remove(hdev); 758 buzz_remove(hdev);
730 759
760 sony_destroy_ff(hdev);
761
731 hid_hw_stop(hdev); 762 hid_hw_stop(hdev);
732} 763}
733 764
diff --git a/drivers/hid/hid-wiimote-core.c b/drivers/hid/hid-wiimote-core.c
index 1446f526ee8b..abb20db2b443 100644
--- a/drivers/hid/hid-wiimote-core.c
+++ b/drivers/hid/hid-wiimote-core.c
@@ -834,8 +834,7 @@ static void wiimote_init_set_type(struct wiimote_data *wdata,
834 goto done; 834 goto done;
835 } 835 }
836 836
837 if (vendor == USB_VENDOR_ID_NINTENDO || 837 if (vendor == USB_VENDOR_ID_NINTENDO) {
838 vendor == USB_VENDOR_ID_NINTENDO2) {
839 if (product == USB_DEVICE_ID_NINTENDO_WIIMOTE) { 838 if (product == USB_DEVICE_ID_NINTENDO_WIIMOTE) {
840 devtype = WIIMOTE_DEV_GEN10; 839 devtype = WIIMOTE_DEV_GEN10;
841 goto done; 840 goto done;
@@ -1856,8 +1855,6 @@ static void wiimote_hid_remove(struct hid_device *hdev)
1856static const struct hid_device_id wiimote_hid_devices[] = { 1855static const struct hid_device_id wiimote_hid_devices[] = {
1857 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, 1856 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO,
1858 USB_DEVICE_ID_NINTENDO_WIIMOTE) }, 1857 USB_DEVICE_ID_NINTENDO_WIIMOTE) },
1859 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO2,
1860 USB_DEVICE_ID_NINTENDO_WIIMOTE) },
1861 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, 1858 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO,
1862 USB_DEVICE_ID_NINTENDO_WIIMOTE2) }, 1859 USB_DEVICE_ID_NINTENDO_WIIMOTE2) },
1863 { } 1860 { }
diff --git a/drivers/hid/uhid.c b/drivers/hid/uhid.c
index 93b00d76374c..cedc6da93c19 100644
--- a/drivers/hid/uhid.c
+++ b/drivers/hid/uhid.c
@@ -287,7 +287,7 @@ static int uhid_event_from_user(const char __user *buffer, size_t len,
287 */ 287 */
288 struct uhid_create_req_compat *compat; 288 struct uhid_create_req_compat *compat;
289 289
290 compat = kmalloc(sizeof(*compat), GFP_KERNEL); 290 compat = kzalloc(sizeof(*compat), GFP_KERNEL);
291 if (!compat) 291 if (!compat)
292 return -ENOMEM; 292 return -ENOMEM;
293 293