aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-core.c8
-rw-r--r--drivers/hid/hid-ids.h3
-rw-r--r--drivers/hid/hid-lg.c13
-rw-r--r--drivers/hid/usbhid/hid-core.c12
-rw-r--r--drivers/hid/usbhid/hid-quirks.c3
-rw-r--r--drivers/hid/usbhid/hiddev.c5
6 files changed, 30 insertions, 14 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index e2e8741fdb53..80792d38d25c 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -39,8 +39,6 @@
39 * Version Information 39 * Version Information
40 */ 40 */
41 41
42#define DRIVER_VERSION "v2.6"
43#define DRIVER_AUTHOR "Andreas Gal, Vojtech Pavlik, Jiri Kosina"
44#define DRIVER_DESC "HID core driver" 42#define DRIVER_DESC "HID core driver"
45#define DRIVER_LICENSE "GPL" 43#define DRIVER_LICENSE "GPL"
46 44
@@ -1327,6 +1325,8 @@ static const struct hid_device_id hid_blacklist[] = {
1327 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOMO_WHEEL2) }, 1325 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOMO_WHEEL2) },
1328 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G25_WHEEL) }, 1326 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G25_WHEEL) },
1329 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD2) }, 1327 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD2) },
1328 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_SPACETRAVELLER) },
1329 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_SPACENAVIGATOR) },
1330 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_SIDEWINDER_GV) }, 1330 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_SIDEWINDER_GV) },
1331 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_NE4K) }, 1331 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_NE4K) },
1332 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_LK6K) }, 1332 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_LK6K) },
@@ -1621,6 +1621,7 @@ static const struct hid_device_id hid_ignore_list[] = {
1621 { HID_USB_DEVICE(USB_VENDOR_ID_KBGEAR, USB_DEVICE_ID_KBGEAR_JAMSTUDIO) }, 1621 { HID_USB_DEVICE(USB_VENDOR_ID_KBGEAR, USB_DEVICE_ID_KBGEAR_JAMSTUDIO) },
1622 { HID_USB_DEVICE(USB_VENDOR_ID_KWORLD, USB_DEVICE_ID_KWORLD_RADIO_FM700) }, 1622 { HID_USB_DEVICE(USB_VENDOR_ID_KWORLD, USB_DEVICE_ID_KWORLD_RADIO_FM700) },
1623 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_GPEN_560) }, 1623 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_GPEN_560) },
1624 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_KYE, 0x0058) },
1624 { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_CASSY) }, 1625 { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_CASSY) },
1625 { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_POCKETCASSY) }, 1626 { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_POCKETCASSY) },
1626 { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MOBILECASSY) }, 1627 { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MOBILECASSY) },
@@ -1919,5 +1920,8 @@ static void __exit hid_exit(void)
1919module_init(hid_init); 1920module_init(hid_init);
1920module_exit(hid_exit); 1921module_exit(hid_exit);
1921 1922
1923MODULE_AUTHOR("Andreas Gal");
1924MODULE_AUTHOR("Vojtech Pavlik");
1925MODULE_AUTHOR("Jiri Kosina");
1922MODULE_LICENSE(DRIVER_LICENSE); 1926MODULE_LICENSE(DRIVER_LICENSE);
1923 1927
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 0ceabbb8e019..3839340e293a 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -117,6 +117,7 @@
117#define USB_DEVICE_ID_CH_PRO_PEDALS 0x00f2 117#define USB_DEVICE_ID_CH_PRO_PEDALS 0x00f2
118#define USB_DEVICE_ID_CH_COMBATSTICK 0x00f4 118#define USB_DEVICE_ID_CH_COMBATSTICK 0x00f4
119#define USB_DEVICE_ID_CH_FLIGHT_SIM_YOKE 0x00ff 119#define USB_DEVICE_ID_CH_FLIGHT_SIM_YOKE 0x00ff
120#define USB_DEVICE_ID_CH_3AXIS_5BUTTON_STICK 0x00d3
120 121
121#define USB_VENDOR_ID_CHERRY 0x046a 122#define USB_VENDOR_ID_CHERRY 0x046a
122#define USB_DEVICE_ID_CHERRY_CYMOTION 0x0023 123#define USB_DEVICE_ID_CHERRY_CYMOTION 0x0023
@@ -305,6 +306,8 @@
305#define USB_DEVICE_ID_S510_RECEIVER_2 0xc517 306#define USB_DEVICE_ID_S510_RECEIVER_2 0xc517
306#define USB_DEVICE_ID_LOGITECH_CORDLESS_DESKTOP_LX500 0xc512 307#define USB_DEVICE_ID_LOGITECH_CORDLESS_DESKTOP_LX500 0xc512
307#define USB_DEVICE_ID_MX3000_RECEIVER 0xc513 308#define USB_DEVICE_ID_MX3000_RECEIVER 0xc513
309#define USB_DEVICE_ID_SPACETRAVELLER 0xc623
310#define USB_DEVICE_ID_SPACENAVIGATOR 0xc626
308#define USB_DEVICE_ID_DINOVO_DESKTOP 0xc704 311#define USB_DEVICE_ID_DINOVO_DESKTOP 0xc704
309#define USB_DEVICE_ID_DINOVO_EDGE 0xc714 312#define USB_DEVICE_ID_DINOVO_EDGE 0xc714
310#define USB_DEVICE_ID_DINOVO_MINI 0xc71f 313#define USB_DEVICE_ID_DINOVO_MINI 0xc71f
diff --git a/drivers/hid/hid-lg.c b/drivers/hid/hid-lg.c
index 4a489785647a..9fcd3d017ab3 100644
--- a/drivers/hid/hid-lg.c
+++ b/drivers/hid/hid-lg.c
@@ -33,6 +33,7 @@
33#define LG_NOGET 0x100 33#define LG_NOGET 0x100
34#define LG_FF 0x200 34#define LG_FF 0x200
35#define LG_FF2 0x400 35#define LG_FF2 0x400
36#define LG_RDESC_REL_ABS 0x800
36 37
37/* 38/*
38 * Certain Logitech keyboards send in report #3 keys which are far 39 * Certain Logitech keyboards send in report #3 keys which are far
@@ -51,6 +52,13 @@ static void lg_report_fixup(struct hid_device *hdev, __u8 *rdesc,
51 rdesc[84] = rdesc[89] = 0x4d; 52 rdesc[84] = rdesc[89] = 0x4d;
52 rdesc[85] = rdesc[90] = 0x10; 53 rdesc[85] = rdesc[90] = 0x10;
53 } 54 }
55 if ((quirks & LG_RDESC_REL_ABS) && rsize >= 50 &&
56 rdesc[32] == 0x81 && rdesc[33] == 0x06 &&
57 rdesc[49] == 0x81 && rdesc[50] == 0x06) {
58 dev_info(&hdev->dev, "fixing up rel/abs in Logitech "
59 "report descriptor\n");
60 rdesc[33] = rdesc[50] = 0x02;
61 }
54} 62}
55 63
56#define lg_map_key_clear(c) hid_map_usage_clear(hi, usage, bit, max, \ 64#define lg_map_key_clear(c) hid_map_usage_clear(hi, usage, bit, max, \
@@ -323,8 +331,13 @@ static const struct hid_device_id lg_devices[] = {
323 .driver_data = LG_FF }, 331 .driver_data = LG_FF },
324 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD2), 332 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD2),
325 .driver_data = LG_FF2 }, 333 .driver_data = LG_FF2 },
334 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_SPACENAVIGATOR),
335 .driver_data = LG_RDESC_REL_ABS },
336 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_SPACETRAVELLER),
337 .driver_data = LG_RDESC_REL_ABS },
326 { } 338 { }
327}; 339};
340
328MODULE_DEVICE_TABLE(hid, lg_devices); 341MODULE_DEVICE_TABLE(hid, lg_devices);
329 342
330static struct hid_driver lg_driver = { 343static struct hid_driver lg_driver = {
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index 03bd703255a3..0258289f3b3e 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -41,8 +41,6 @@
41 * Version Information 41 * Version Information
42 */ 42 */
43 43
44#define DRIVER_VERSION "v2.6"
45#define DRIVER_AUTHOR "Andreas Gal, Vojtech Pavlik, Jiri Kosina"
46#define DRIVER_DESC "USB HID core driver" 44#define DRIVER_DESC "USB HID core driver"
47#define DRIVER_LICENSE "GPL" 45#define DRIVER_LICENSE "GPL"
48 46
@@ -998,7 +996,8 @@ static int usbhid_start(struct hid_device *hid)
998 usbhid->urbctrl->transfer_dma = usbhid->ctrlbuf_dma; 996 usbhid->urbctrl->transfer_dma = usbhid->ctrlbuf_dma;
999 usbhid->urbctrl->transfer_flags |= (URB_NO_TRANSFER_DMA_MAP | URB_NO_SETUP_DMA_MAP); 997 usbhid->urbctrl->transfer_flags |= (URB_NO_TRANSFER_DMA_MAP | URB_NO_SETUP_DMA_MAP);
1000 998
1001 usbhid_init_reports(hid); 999 if (!(hid->quirks & HID_QUIRK_NO_INIT_REPORTS))
1000 usbhid_init_reports(hid);
1002 1001
1003 set_bit(HID_STARTED, &usbhid->iofl); 1002 set_bit(HID_STARTED, &usbhid->iofl);
1004 1003
@@ -1395,8 +1394,7 @@ static int __init hid_init(void)
1395 retval = usb_register(&hid_driver); 1394 retval = usb_register(&hid_driver);
1396 if (retval) 1395 if (retval)
1397 goto usb_register_fail; 1396 goto usb_register_fail;
1398 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" 1397 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_DESC "\n");
1399 DRIVER_DESC "\n");
1400 1398
1401 return 0; 1399 return 0;
1402usb_register_fail: 1400usb_register_fail:
@@ -1423,6 +1421,8 @@ static void __exit hid_exit(void)
1423module_init(hid_init); 1421module_init(hid_init);
1424module_exit(hid_exit); 1422module_exit(hid_exit);
1425 1423
1426MODULE_AUTHOR(DRIVER_AUTHOR); 1424MODULE_AUTHOR("Andreas Gal");
1425MODULE_AUTHOR("Vojtech Pavlik");
1426MODULE_AUTHOR("Jiri Kosina");
1427MODULE_DESCRIPTION(DRIVER_DESC); 1427MODULE_DESCRIPTION(DRIVER_DESC);
1428MODULE_LICENSE(DRIVER_LICENSE); 1428MODULE_LICENSE(DRIVER_LICENSE);
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
index e9875625dcf0..38773dc2821b 100644
--- a/drivers/hid/usbhid/hid-quirks.c
+++ b/drivers/hid/usbhid/hid-quirks.c
@@ -54,6 +54,7 @@ static const struct hid_blacklist {
54 { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_COMBATSTICK, HID_QUIRK_NOGET }, 54 { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_COMBATSTICK, HID_QUIRK_NOGET },
55 { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_FLIGHT_SIM_YOKE, HID_QUIRK_NOGET }, 55 { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_FLIGHT_SIM_YOKE, HID_QUIRK_NOGET },
56 { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_PRO_PEDALS, HID_QUIRK_NOGET }, 56 { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_PRO_PEDALS, HID_QUIRK_NOGET },
57 { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_3AXIS_5BUTTON_STICK, HID_QUIRK_NOGET },
57 { USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET }, 58 { USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET },
58 { USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET }, 59 { USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET },
59 { USB_VENDOR_ID_SUN, USB_DEVICE_ID_RARITAN_KVM_DONGLE, HID_QUIRK_NOGET }, 60 { USB_VENDOR_ID_SUN, USB_DEVICE_ID_RARITAN_KVM_DONGLE, HID_QUIRK_NOGET },
@@ -281,7 +282,7 @@ u32 usbhid_lookup_quirk(const u16 idVendor, const u16 idProduct)
281 if (idVendor == USB_VENDOR_ID_NCR && 282 if (idVendor == USB_VENDOR_ID_NCR &&
282 idProduct >= USB_DEVICE_ID_NCR_FIRST && 283 idProduct >= USB_DEVICE_ID_NCR_FIRST &&
283 idProduct <= USB_DEVICE_ID_NCR_LAST) 284 idProduct <= USB_DEVICE_ID_NCR_LAST)
284 return HID_QUIRK_NOGET; 285 return HID_QUIRK_NO_INIT_REPORTS;
285 286
286 down_read(&dquirks_rwsem); 287 down_read(&dquirks_rwsem);
287 bl_entry = usbhid_exists_dquirk(idVendor, idProduct); 288 bl_entry = usbhid_exists_dquirk(idVendor, idProduct);
diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c
index 8b6ee247bfe4..867e08433e4b 100644
--- a/drivers/hid/usbhid/hiddev.c
+++ b/drivers/hid/usbhid/hiddev.c
@@ -450,7 +450,6 @@ static noinline int hiddev_ioctl_usage(struct hiddev *hiddev, unsigned int cmd,
450 uref_multi = kmalloc(sizeof(struct hiddev_usage_ref_multi), GFP_KERNEL); 450 uref_multi = kmalloc(sizeof(struct hiddev_usage_ref_multi), GFP_KERNEL);
451 if (!uref_multi) 451 if (!uref_multi)
452 return -ENOMEM; 452 return -ENOMEM;
453 lock_kernel();
454 uref = &uref_multi->uref; 453 uref = &uref_multi->uref;
455 if (cmd == HIDIOCGUSAGES || cmd == HIDIOCSUSAGES) { 454 if (cmd == HIDIOCGUSAGES || cmd == HIDIOCSUSAGES) {
456 if (copy_from_user(uref_multi, user_arg, 455 if (copy_from_user(uref_multi, user_arg,
@@ -528,7 +527,6 @@ static noinline int hiddev_ioctl_usage(struct hiddev *hiddev, unsigned int cmd,
528 527
529 case HIDIOCGCOLLECTIONINDEX: 528 case HIDIOCGCOLLECTIONINDEX:
530 i = field->usage[uref->usage_index].collection_index; 529 i = field->usage[uref->usage_index].collection_index;
531 unlock_kernel();
532 kfree(uref_multi); 530 kfree(uref_multi);
533 return i; 531 return i;
534 case HIDIOCGUSAGES: 532 case HIDIOCGUSAGES:
@@ -547,15 +545,12 @@ static noinline int hiddev_ioctl_usage(struct hiddev *hiddev, unsigned int cmd,
547 } 545 }
548 546
549goodreturn: 547goodreturn:
550 unlock_kernel();
551 kfree(uref_multi); 548 kfree(uref_multi);
552 return 0; 549 return 0;
553fault: 550fault:
554 unlock_kernel();
555 kfree(uref_multi); 551 kfree(uref_multi);
556 return -EFAULT; 552 return -EFAULT;
557inval: 553inval:
558 unlock_kernel();
559 kfree(uref_multi); 554 kfree(uref_multi);
560 return -EINVAL; 555 return -EINVAL;
561 } 556 }