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

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
HID: don't grab devices with no input
HID: fix radio-mr800 hidquirks
HID: fix kworld fm700 radio hidquirks
HID: fix start/stop cycle in usbhid driver
HID: use single threaded work queue for hid_compat
HID: map macbook keys for "Expose" and "Dashboard"
HID: support for new unibody macbooks
HID: fix locking in hidraw_open()

+58 -25
+9 -2
drivers/hid/hid-apple.c
··· 55 56 static struct apple_key_translation apple_fn_keys[] = { 57 { KEY_BACKSPACE, KEY_DELETE }, 58 { KEY_F1, KEY_BRIGHTNESSDOWN, APPLE_FLAG_FKEY }, 59 { KEY_F2, KEY_BRIGHTNESSUP, APPLE_FLAG_FKEY }, 60 - { KEY_F3, KEY_FN_F5, APPLE_FLAG_FKEY }, /* Exposé */ 61 - { KEY_F4, KEY_FN_F4, APPLE_FLAG_FKEY }, /* Dashboard */ 62 { KEY_F5, KEY_KBDILLUMDOWN, APPLE_FLAG_FKEY }, 63 { KEY_F6, KEY_KBDILLUMUP, APPLE_FLAG_FKEY }, 64 { KEY_F7, KEY_PREVIOUSSONG, APPLE_FLAG_FKEY }, ··· 418 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ISO), 419 .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, 420 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_JIS), 421 .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, 422 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY), 423 .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
··· 55 56 static struct apple_key_translation apple_fn_keys[] = { 57 { KEY_BACKSPACE, KEY_DELETE }, 58 + { KEY_ENTER, KEY_INSERT }, 59 { KEY_F1, KEY_BRIGHTNESSDOWN, APPLE_FLAG_FKEY }, 60 { KEY_F2, KEY_BRIGHTNESSUP, APPLE_FLAG_FKEY }, 61 + { KEY_F3, KEY_SCALE, APPLE_FLAG_FKEY }, 62 + { KEY_F4, KEY_DASHBOARD, APPLE_FLAG_FKEY }, 63 { KEY_F5, KEY_KBDILLUMDOWN, APPLE_FLAG_FKEY }, 64 { KEY_F6, KEY_KBDILLUMUP, APPLE_FLAG_FKEY }, 65 { KEY_F7, KEY_PREVIOUSSONG, APPLE_FLAG_FKEY }, ··· 417 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ISO), 418 .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, 419 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_JIS), 420 + .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, 421 + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI), 422 + .driver_data = APPLE_HAS_FN }, 423 + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ISO), 424 + .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, 425 + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_JIS), 426 .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, 427 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY), 428 .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
+9 -3
drivers/hid/hid-core.c
··· 1250 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI) }, 1251 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ISO) }, 1252 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_JIS) }, 1253 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) }, 1254 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) }, 1255 - { HID_USB_DEVICE(USB_VENDOR_ID_AVERMEDIA, USB_DEVICE_ID_AVER_FM_MR800) }, 1256 { HID_USB_DEVICE(USB_VENDOR_ID_BELKIN, USB_DEVICE_ID_FLIP_KVM) }, 1257 { HID_USB_DEVICE(USB_VENDOR_ID_BRIGHT, USB_DEVICE_ID_BRIGHT_ABNT2) }, 1258 { HID_USB_DEVICE(USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION) }, ··· 1267 { HID_USB_DEVICE(USB_VENDOR_ID_EZKEY, USB_DEVICE_ID_BTC_8193) }, 1268 { HID_USB_DEVICE(USB_VENDOR_ID_GENERIC_13BA, USB_DEVICE_ID_GENERIC_13BA_KBD_MOUSE) }, 1269 { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE) }, 1270 - { HID_USB_DEVICE(USB_VENDOR_ID_KWORLD, USB_DEVICE_ID_KWORLD_RADIO_FM700) }, 1271 { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_2) }, 1272 { HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD) }, 1273 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_MX3000_RECEIVER) }, ··· 1410 { HID_USB_DEVICE(USB_VENDOR_ID_ALCOR, USB_DEVICE_ID_ALCOR_USBRS232) }, 1411 { HID_USB_DEVICE(USB_VENDOR_ID_ASUS, USB_DEVICE_ID_ASUS_LCM)}, 1412 { HID_USB_DEVICE(USB_VENDOR_ID_ASUS, USB_DEVICE_ID_ASUS_LCM2)}, 1413 { HID_USB_DEVICE(USB_VENDOR_ID_BERKSHIRE, USB_DEVICE_ID_BERKSHIRE_PCWD) }, 1414 { HID_USB_DEVICE(USB_VENDOR_ID_CIDC, 0x0103) }, 1415 { HID_USB_DEVICE(USB_VENDOR_ID_CYGNAL, USB_DEVICE_ID_CYGNAL_RADIO_SI470X) }, ··· 1488 { HID_USB_DEVICE(USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1007) }, 1489 { HID_USB_DEVICE(USB_VENDOR_ID_IMATION, USB_DEVICE_ID_DISC_STAKKA) }, 1490 { HID_USB_DEVICE(USB_VENDOR_ID_KBGEAR, USB_DEVICE_ID_KBGEAR_JAMSTUDIO) }, 1491 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_GPEN_560) }, 1492 { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_CASSY) }, 1493 { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_POCKETCASSY) }, ··· 1576 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI) }, 1577 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ISO) }, 1578 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_JIS) }, 1579 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) }, 1580 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) }, 1581 { } ··· 1736 goto err_bus; 1737 1738 #ifdef CONFIG_HID_COMPAT 1739 - hid_compat_wq = create_workqueue("hid_compat"); 1740 if (!hid_compat_wq) { 1741 hidraw_exit(); 1742 goto err;
··· 1250 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI) }, 1251 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ISO) }, 1252 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_JIS) }, 1253 + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI) }, 1254 + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ISO) }, 1255 + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_JIS) }, 1256 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) }, 1257 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) }, 1258 { HID_USB_DEVICE(USB_VENDOR_ID_BELKIN, USB_DEVICE_ID_FLIP_KVM) }, 1259 { HID_USB_DEVICE(USB_VENDOR_ID_BRIGHT, USB_DEVICE_ID_BRIGHT_ABNT2) }, 1260 { HID_USB_DEVICE(USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION) }, ··· 1265 { HID_USB_DEVICE(USB_VENDOR_ID_EZKEY, USB_DEVICE_ID_BTC_8193) }, 1266 { HID_USB_DEVICE(USB_VENDOR_ID_GENERIC_13BA, USB_DEVICE_ID_GENERIC_13BA_KBD_MOUSE) }, 1267 { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE) }, 1268 { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_2) }, 1269 { HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD) }, 1270 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_MX3000_RECEIVER) }, ··· 1409 { HID_USB_DEVICE(USB_VENDOR_ID_ALCOR, USB_DEVICE_ID_ALCOR_USBRS232) }, 1410 { HID_USB_DEVICE(USB_VENDOR_ID_ASUS, USB_DEVICE_ID_ASUS_LCM)}, 1411 { HID_USB_DEVICE(USB_VENDOR_ID_ASUS, USB_DEVICE_ID_ASUS_LCM2)}, 1412 + { HID_USB_DEVICE(USB_VENDOR_ID_AVERMEDIA, USB_DEVICE_ID_AVER_FM_MR800) }, 1413 { HID_USB_DEVICE(USB_VENDOR_ID_BERKSHIRE, USB_DEVICE_ID_BERKSHIRE_PCWD) }, 1414 { HID_USB_DEVICE(USB_VENDOR_ID_CIDC, 0x0103) }, 1415 { HID_USB_DEVICE(USB_VENDOR_ID_CYGNAL, USB_DEVICE_ID_CYGNAL_RADIO_SI470X) }, ··· 1486 { HID_USB_DEVICE(USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1007) }, 1487 { HID_USB_DEVICE(USB_VENDOR_ID_IMATION, USB_DEVICE_ID_DISC_STAKKA) }, 1488 { HID_USB_DEVICE(USB_VENDOR_ID_KBGEAR, USB_DEVICE_ID_KBGEAR_JAMSTUDIO) }, 1489 + { HID_USB_DEVICE(USB_VENDOR_ID_KWORLD, USB_DEVICE_ID_KWORLD_RADIO_FM700) }, 1490 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_GPEN_560) }, 1491 { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_CASSY) }, 1492 { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_POCKETCASSY) }, ··· 1573 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI) }, 1574 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ISO) }, 1575 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_JIS) }, 1576 + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI) }, 1577 + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ISO) }, 1578 + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_JIS) }, 1579 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) }, 1580 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) }, 1581 { } ··· 1730 goto err_bus; 1731 1732 #ifdef CONFIG_HID_COMPAT 1733 + hid_compat_wq = create_singlethread_workqueue("hid_compat"); 1734 if (!hid_compat_wq) { 1735 hidraw_exit(); 1736 goto err;
+3
drivers/hid/hid-ids.h
··· 82 #define USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI 0x0230 83 #define USB_DEVICE_ID_APPLE_WELLSPRING2_ISO 0x0231 84 #define USB_DEVICE_ID_APPLE_WELLSPRING2_JIS 0x0232 85 #define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY 0x030a 86 #define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY 0x030b 87 #define USB_DEVICE_ID_APPLE_ATV_IRCONTROL 0x8241
··· 82 #define USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI 0x0230 83 #define USB_DEVICE_ID_APPLE_WELLSPRING2_ISO 0x0231 84 #define USB_DEVICE_ID_APPLE_WELLSPRING2_JIS 0x0232 85 + #define USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI 0x0236 86 + #define USB_DEVICE_ID_APPLE_WELLSPRING3_ISO 0x0237 87 + #define USB_DEVICE_ID_APPLE_WELLSPRING3_JIS 0x0238 88 #define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY 0x030a 89 #define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY 0x030b 90 #define USB_DEVICE_ID_APPLE_ATV_IRCONTROL 0x8241
+16 -14
drivers/hid/hidraw.c
··· 38 static struct cdev hidraw_cdev; 39 static struct class *hidraw_class; 40 static struct hidraw *hidraw_table[HIDRAW_MAX_DEVICES]; 41 - static DEFINE_SPINLOCK(minors_lock); 42 43 static ssize_t hidraw_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos) 44 { ··· 159 struct hidraw_list *list; 160 int err = 0; 161 162 - lock_kernel(); 163 if (!(list = kzalloc(sizeof(struct hidraw_list), GFP_KERNEL))) { 164 err = -ENOMEM; 165 goto out; 166 } 167 168 - spin_lock(&minors_lock); 169 if (!hidraw_table[minor]) { 170 printk(KERN_EMERG "hidraw device with minor %d doesn't exist\n", 171 minor); ··· 180 file->private_data = list; 181 182 dev = hidraw_table[minor]; 183 - if (!dev->open++) 184 - dev->hid->ll_driver->open(dev->hid); 185 186 out_unlock: 187 - spin_unlock(&minors_lock); 188 - out: 189 unlock_kernel(); 190 return err; 191 192 } ··· 313 314 result = -EINVAL; 315 316 - spin_lock(&minors_lock); 317 318 for (minor = 0; minor < HIDRAW_MAX_DEVICES; minor++) { 319 if (hidraw_table[minor]) ··· 323 break; 324 } 325 326 - spin_unlock(&minors_lock); 327 - 328 if (result) { 329 kfree(dev); 330 goto out; 331 } ··· 333 NULL, "%s%d", "hidraw", minor); 334 335 if (IS_ERR(dev->dev)) { 336 - spin_lock(&minors_lock); 337 hidraw_table[minor] = NULL; 338 - spin_unlock(&minors_lock); 339 result = PTR_ERR(dev->dev); 340 kfree(dev); 341 goto out; 342 } 343 344 init_waitqueue_head(&dev->wait); 345 INIT_LIST_HEAD(&dev->list); 346 ··· 362 363 hidraw->exist = 0; 364 365 - spin_lock(&minors_lock); 366 hidraw_table[hidraw->minor] = NULL; 367 - spin_unlock(&minors_lock); 368 369 device_destroy(hidraw_class, MKDEV(hidraw_major, hidraw->minor)); 370
··· 38 static struct cdev hidraw_cdev; 39 static struct class *hidraw_class; 40 static struct hidraw *hidraw_table[HIDRAW_MAX_DEVICES]; 41 + static DEFINE_MUTEX(minors_lock); 42 43 static ssize_t hidraw_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos) 44 { ··· 159 struct hidraw_list *list; 160 int err = 0; 161 162 if (!(list = kzalloc(sizeof(struct hidraw_list), GFP_KERNEL))) { 163 err = -ENOMEM; 164 goto out; 165 } 166 167 + lock_kernel(); 168 + mutex_lock(&minors_lock); 169 if (!hidraw_table[minor]) { 170 printk(KERN_EMERG "hidraw device with minor %d doesn't exist\n", 171 minor); ··· 180 file->private_data = list; 181 182 dev = hidraw_table[minor]; 183 + if (!dev->open++) { 184 + err = dev->hid->ll_driver->open(dev->hid); 185 + if (err < 0) 186 + dev->open--; 187 + } 188 189 out_unlock: 190 + mutex_unlock(&minors_lock); 191 unlock_kernel(); 192 + out: 193 return err; 194 195 } ··· 310 311 result = -EINVAL; 312 313 + mutex_lock(&minors_lock); 314 315 for (minor = 0; minor < HIDRAW_MAX_DEVICES; minor++) { 316 if (hidraw_table[minor]) ··· 320 break; 321 } 322 323 if (result) { 324 + mutex_unlock(&minors_lock); 325 kfree(dev); 326 goto out; 327 } ··· 331 NULL, "%s%d", "hidraw", minor); 332 333 if (IS_ERR(dev->dev)) { 334 hidraw_table[minor] = NULL; 335 + mutex_unlock(&minors_lock); 336 result = PTR_ERR(dev->dev); 337 kfree(dev); 338 goto out; 339 } 340 341 + mutex_unlock(&minors_lock); 342 init_waitqueue_head(&dev->wait); 343 INIT_LIST_HEAD(&dev->list); 344 ··· 360 361 hidraw->exist = 0; 362 363 + mutex_lock(&minors_lock); 364 hidraw_table[hidraw->minor] = NULL; 365 + mutex_unlock(&minors_lock); 366 367 device_destroy(hidraw_class, MKDEV(hidraw_major, hidraw->minor)); 368
+19 -6
drivers/hid/usbhid/hid-core.c
··· 781 unsigned int n, insize = 0; 782 int ret; 783 784 usbhid->bufsize = HID_MIN_BUFFER_SIZE; 785 hid_find_max_report(hid, HID_INPUT_REPORT, &usbhid->bufsize); 786 hid_find_max_report(hid, HID_OUTPUT_REPORT, &usbhid->bufsize); ··· 849 } 850 } 851 852 - if (!usbhid->urbin) { 853 - err_hid("couldn't find an input interrupt endpoint"); 854 - ret = -ENODEV; 855 - goto fail; 856 - } 857 - 858 init_waitqueue_head(&usbhid->wait); 859 INIT_WORK(&usbhid->reset_work, hid_reset); 860 setup_timer(&usbhid->io_retry, hid_retry_timeout, (unsigned long) hid); ··· 884 usb_free_urb(usbhid->urbin); 885 usb_free_urb(usbhid->urbout); 886 usb_free_urb(usbhid->urbctrl); 887 hid_free_buffers(dev, hid); 888 mutex_unlock(&usbhid->setup); 889 return ret; ··· 923 usb_free_urb(usbhid->urbin); 924 usb_free_urb(usbhid->urbctrl); 925 usb_free_urb(usbhid->urbout); 926 927 hid_free_buffers(hid_to_usb_dev(hid), hid); 928 mutex_unlock(&usbhid->setup); ··· 942 943 static int hid_probe(struct usb_interface *intf, const struct usb_device_id *id) 944 { 945 struct usb_device *dev = interface_to_usbdev(intf); 946 struct usbhid_device *usbhid; 947 struct hid_device *hid; 948 size_t len; 949 int ret; 950 951 dbg_hid("HID probe called for ifnum %d\n", 952 intf->altsetting->desc.bInterfaceNumber); 953 954 hid = hid_allocate_device(); 955 if (IS_ERR(hid))
··· 781 unsigned int n, insize = 0; 782 int ret; 783 784 + clear_bit(HID_DISCONNECTED, &usbhid->iofl); 785 + 786 usbhid->bufsize = HID_MIN_BUFFER_SIZE; 787 hid_find_max_report(hid, HID_INPUT_REPORT, &usbhid->bufsize); 788 hid_find_max_report(hid, HID_OUTPUT_REPORT, &usbhid->bufsize); ··· 847 } 848 } 849 850 init_waitqueue_head(&usbhid->wait); 851 INIT_WORK(&usbhid->reset_work, hid_reset); 852 setup_timer(&usbhid->io_retry, hid_retry_timeout, (unsigned long) hid); ··· 888 usb_free_urb(usbhid->urbin); 889 usb_free_urb(usbhid->urbout); 890 usb_free_urb(usbhid->urbctrl); 891 + usbhid->urbin = NULL; 892 + usbhid->urbout = NULL; 893 + usbhid->urbctrl = NULL; 894 hid_free_buffers(dev, hid); 895 mutex_unlock(&usbhid->setup); 896 return ret; ··· 924 usb_free_urb(usbhid->urbin); 925 usb_free_urb(usbhid->urbctrl); 926 usb_free_urb(usbhid->urbout); 927 + usbhid->urbin = NULL; /* don't mess up next start */ 928 + usbhid->urbctrl = NULL; 929 + usbhid->urbout = NULL; 930 931 hid_free_buffers(hid_to_usb_dev(hid), hid); 932 mutex_unlock(&usbhid->setup); ··· 940 941 static int hid_probe(struct usb_interface *intf, const struct usb_device_id *id) 942 { 943 + struct usb_host_interface *interface = intf->cur_altsetting; 944 struct usb_device *dev = interface_to_usbdev(intf); 945 struct usbhid_device *usbhid; 946 struct hid_device *hid; 947 + unsigned int n, has_in = 0; 948 size_t len; 949 int ret; 950 951 dbg_hid("HID probe called for ifnum %d\n", 952 intf->altsetting->desc.bInterfaceNumber); 953 + 954 + for (n = 0; n < interface->desc.bNumEndpoints; n++) 955 + if (usb_endpoint_is_int_in(&interface->endpoint[n].desc)) 956 + has_in++; 957 + if (!has_in) { 958 + dev_err(&intf->dev, "couldn't find an input interrupt " 959 + "endpoint\n"); 960 + return -ENODEV; 961 + } 962 963 hid = hid_allocate_device(); 964 if (IS_ERR(hid))
+2
include/linux/input.h
··· 238 #define KEY_KPEQUAL 117 239 #define KEY_KPPLUSMINUS 118 240 #define KEY_PAUSE 119 241 242 #define KEY_KPCOMMA 121 243 #define KEY_HANGEUL 122 ··· 323 #define KEY_PAUSECD 201 324 #define KEY_PROG3 202 325 #define KEY_PROG4 203 326 #define KEY_SUSPEND 205 327 #define KEY_CLOSE 206 /* AC Close */ 328 #define KEY_PLAY 207
··· 238 #define KEY_KPEQUAL 117 239 #define KEY_KPPLUSMINUS 118 240 #define KEY_PAUSE 119 241 + #define KEY_SCALE 120 /* AL Compiz Scale (Expose) */ 242 243 #define KEY_KPCOMMA 121 244 #define KEY_HANGEUL 122 ··· 322 #define KEY_PAUSECD 201 323 #define KEY_PROG3 202 324 #define KEY_PROG4 203 325 + #define KEY_DASHBOARD 204 /* AL Dashboard */ 326 #define KEY_SUSPEND 205 327 #define KEY_CLOSE 206 /* AC Close */ 328 #define KEY_PLAY 207