aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/input
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/input')
-rw-r--r--drivers/usb/input/hid-core.c9
-rw-r--r--drivers/usb/input/hiddev.c5
-rw-r--r--drivers/usb/input/touchkitusb.c3
-rw-r--r--drivers/usb/input/yealink.c48
4 files changed, 29 insertions, 36 deletions
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
index a91e72c41415..6f7a684c3e07 100644
--- a/drivers/usb/input/hid-core.c
+++ b/drivers/usb/input/hid-core.c
@@ -1307,7 +1307,7 @@ void hid_init_reports(struct hid_device *hid)
1307 } 1307 }
1308 1308
1309 if (err) 1309 if (err)
1310 warn("timeout initializing reports\n"); 1310 warn("timeout initializing reports");
1311} 1311}
1312 1312
1313#define USB_VENDOR_ID_WACOM 0x056a 1313#define USB_VENDOR_ID_WACOM 0x056a
@@ -1453,6 +1453,9 @@ void hid_init_reports(struct hid_device *hid)
1453#define USB_VENDOR_ID_CHERRY 0x046a 1453#define USB_VENDOR_ID_CHERRY 0x046a
1454#define USB_DEVICE_ID_CHERRY_CYMOTION 0x0023 1454#define USB_DEVICE_ID_CHERRY_CYMOTION 0x0023
1455 1455
1456#define USB_VENDOR_ID_HP 0x03f0
1457#define USB_DEVICE_ID_HP_USBHUB_KB 0x020c
1458
1456/* 1459/*
1457 * Alphabetically sorted blacklist by quirk type. 1460 * Alphabetically sorted blacklist by quirk type.
1458 */ 1461 */
@@ -1566,6 +1569,7 @@ static const struct hid_blacklist {
1566 { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVMC, HID_QUIRK_NOGET }, 1569 { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVMC, HID_QUIRK_NOGET },
1567 { USB_VENDOR_ID_BTC, USB_DEVICE_ID_BTC_KEYBOARD, HID_QUIRK_NOGET}, 1570 { USB_VENDOR_ID_BTC, USB_DEVICE_ID_BTC_KEYBOARD, HID_QUIRK_NOGET},
1568 { USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_USBHUB_KB, HID_QUIRK_NOGET}, 1571 { USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_USBHUB_KB, HID_QUIRK_NOGET},
1572 { USB_VENDOR_ID_HP, USB_DEVICE_ID_HP_USBHUB_KB, HID_QUIRK_NOGET },
1569 { USB_VENDOR_ID_TANGTOP, USB_DEVICE_ID_TANGTOP_USBPS2, HID_QUIRK_NOGET }, 1573 { USB_VENDOR_ID_TANGTOP, USB_DEVICE_ID_TANGTOP_USBPS2, HID_QUIRK_NOGET },
1570 1574
1571 { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_POWERMOUSE, HID_QUIRK_2WHEEL_POWERMOUSE }, 1575 { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_POWERMOUSE, HID_QUIRK_2WHEEL_POWERMOUSE },
@@ -1828,9 +1832,6 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf)
1828 hid->urbctrl->transfer_dma = hid->ctrlbuf_dma; 1832 hid->urbctrl->transfer_dma = hid->ctrlbuf_dma;
1829 hid->urbctrl->transfer_flags |= (URB_NO_TRANSFER_DMA_MAP | URB_NO_SETUP_DMA_MAP); 1833 hid->urbctrl->transfer_flags |= (URB_NO_TRANSFER_DMA_MAP | URB_NO_SETUP_DMA_MAP);
1830 1834
1831 /* May be needed for some devices */
1832 usb_clear_halt(hid->dev, hid->urbin->pipe);
1833
1834 return hid; 1835 return hid;
1835 1836
1836fail: 1837fail:
diff --git a/drivers/usb/input/hiddev.c b/drivers/usb/input/hiddev.c
index 4dff8473553d..925f5aba06f5 100644
--- a/drivers/usb/input/hiddev.c
+++ b/drivers/usb/input/hiddev.c
@@ -35,7 +35,6 @@
35#include <linux/usb.h> 35#include <linux/usb.h>
36#include "hid.h" 36#include "hid.h"
37#include <linux/hiddev.h> 37#include <linux/hiddev.h>
38#include <linux/devfs_fs_kernel.h>
39 38
40#ifdef CONFIG_USB_DYNAMIC_MINORS 39#ifdef CONFIG_USB_DYNAMIC_MINORS
41#define HIDDEV_MINOR_BASE 0 40#define HIDDEV_MINOR_BASE 0
@@ -632,7 +631,7 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
632 631
633 else if ((cmd == HIDIOCGUSAGES || cmd == HIDIOCSUSAGES) && 632 else if ((cmd == HIDIOCGUSAGES || cmd == HIDIOCSUSAGES) &&
634 (uref_multi->num_values > HID_MAX_MULTI_USAGES || 633 (uref_multi->num_values > HID_MAX_MULTI_USAGES ||
635 uref->usage_index + uref_multi->num_values >= field->report_count)) 634 uref->usage_index + uref_multi->num_values > field->report_count))
636 goto inval; 635 goto inval;
637 } 636 }
638 637
@@ -832,12 +831,10 @@ static /* const */ struct usb_driver hiddev_driver = {
832 831
833int __init hiddev_init(void) 832int __init hiddev_init(void)
834{ 833{
835 devfs_mk_dir("usb/hid");
836 return usb_register(&hiddev_driver); 834 return usb_register(&hiddev_driver);
837} 835}
838 836
839void hiddev_exit(void) 837void hiddev_exit(void)
840{ 838{
841 usb_deregister(&hiddev_driver); 839 usb_deregister(&hiddev_driver);
842 devfs_remove("usb/hid");
843} 840}
diff --git a/drivers/usb/input/touchkitusb.c b/drivers/usb/input/touchkitusb.c
index 3b3c7b4120a2..697c5e573a11 100644
--- a/drivers/usb/input/touchkitusb.c
+++ b/drivers/usb/input/touchkitusb.c
@@ -337,6 +337,9 @@ static int touchkit_probe(struct usb_interface *intf,
337 touchkit->data, TOUCHKIT_REPORT_DATA_SIZE, 337 touchkit->data, TOUCHKIT_REPORT_DATA_SIZE,
338 touchkit_irq, touchkit, endpoint->bInterval); 338 touchkit_irq, touchkit, endpoint->bInterval);
339 339
340 touchkit->irq->transfer_dma = touchkit->data_dma;
341 touchkit->irq->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
342
340 input_register_device(touchkit->input); 343 input_register_device(touchkit->input);
341 344
342 usb_set_intfdata(intf, touchkit); 345 usb_set_intfdata(intf, touchkit);
diff --git a/drivers/usb/input/yealink.c b/drivers/usb/input/yealink.c
index 1bfc105ad4d6..37d2f0ba0319 100644
--- a/drivers/usb/input/yealink.c
+++ b/drivers/usb/input/yealink.c
@@ -59,7 +59,7 @@
59#include "map_to_7segment.h" 59#include "map_to_7segment.h"
60#include "yealink.h" 60#include "yealink.h"
61 61
62#define DRIVER_VERSION "yld-20050816" 62#define DRIVER_VERSION "yld-20051230"
63#define DRIVER_AUTHOR "Henk Vergonet" 63#define DRIVER_AUTHOR "Henk Vergonet"
64#define DRIVER_DESC "Yealink phone driver" 64#define DRIVER_DESC "Yealink phone driver"
65 65
@@ -786,16 +786,25 @@ static struct attribute_group yld_attr_group = {
786 * Linux interface and usb initialisation 786 * Linux interface and usb initialisation
787 ******************************************************************************/ 787 ******************************************************************************/
788 788
789static const struct yld_device { 789struct driver_info {
790 u16 idVendor;
791 u16 idProduct;
792 char *name; 790 char *name;
793} yld_device[] = {
794 { 0x6993, 0xb001, "Yealink usb-p1k" },
795}; 791};
796 792
797static struct usb_device_id usb_table [] = { 793static const struct driver_info info_P1K = {
798 { USB_INTERFACE_INFO(USB_CLASS_HID, 0, 0) }, 794 .name = "Yealink usb-p1k",
795};
796
797static const struct usb_device_id usb_table [] = {
798 {
799 .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
800 USB_DEVICE_ID_MATCH_INT_INFO,
801 .idVendor = 0x6993,
802 .idProduct = 0xb001,
803 .bInterfaceClass = USB_CLASS_HID,
804 .bInterfaceSubClass = 0,
805 .bInterfaceProtocol = 0,
806 .driver_info = (kernel_ulong_t)&info_P1K
807 },
799 { } 808 { }
800}; 809};
801 810
@@ -842,33 +851,16 @@ static void usb_disconnect(struct usb_interface *intf)
842 usb_cleanup(yld, 0); 851 usb_cleanup(yld, 0);
843} 852}
844 853
845static int usb_match(struct usb_device *udev)
846{
847 int i;
848 u16 idVendor = le16_to_cpu(udev->descriptor.idVendor);
849 u16 idProduct = le16_to_cpu(udev->descriptor.idProduct);
850
851 for (i = 0; i < ARRAY_SIZE(yld_device); i++) {
852 if ((idVendor == yld_device[i].idVendor) &&
853 (idProduct == yld_device[i].idProduct))
854 return i;
855 }
856 return -ENODEV;
857}
858
859static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id) 854static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
860{ 855{
861 struct usb_device *udev = interface_to_usbdev (intf); 856 struct usb_device *udev = interface_to_usbdev (intf);
857 struct driver_info *nfo = (struct driver_info *)id->driver_info;
862 struct usb_host_interface *interface; 858 struct usb_host_interface *interface;
863 struct usb_endpoint_descriptor *endpoint; 859 struct usb_endpoint_descriptor *endpoint;
864 struct yealink_dev *yld; 860 struct yealink_dev *yld;
865 struct input_dev *input_dev; 861 struct input_dev *input_dev;
866 int ret, pipe, i; 862 int ret, pipe, i;
867 863
868 i = usb_match(udev);
869 if (i < 0)
870 return -ENODEV;
871
872 interface = intf->cur_altsetting; 864 interface = intf->cur_altsetting;
873 endpoint = &interface->endpoint[0].desc; 865 endpoint = &interface->endpoint[0].desc;
874 if (!(endpoint->bEndpointAddress & USB_DIR_IN)) 866 if (!(endpoint->bEndpointAddress & USB_DIR_IN))
@@ -915,7 +907,7 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
915 pipe = usb_rcvintpipe(udev, endpoint->bEndpointAddress); 907 pipe = usb_rcvintpipe(udev, endpoint->bEndpointAddress);
916 ret = usb_maxpacket(udev, pipe, usb_pipeout(pipe)); 908 ret = usb_maxpacket(udev, pipe, usb_pipeout(pipe));
917 if (ret != USB_PKT_LEN) 909 if (ret != USB_PKT_LEN)
918 err("invalid payload size %d, expected %d", ret, USB_PKT_LEN); 910 err("invalid payload size %d, expected %zd", ret, USB_PKT_LEN);
919 911
920 /* initialise irq urb */ 912 /* initialise irq urb */
921 usb_fill_int_urb(yld->urb_irq, udev, pipe, yld->irq_data, 913 usb_fill_int_urb(yld->urb_irq, udev, pipe, yld->irq_data,
@@ -948,7 +940,7 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
948 strlcat(yld->phys, "/input0", sizeof(yld->phys)); 940 strlcat(yld->phys, "/input0", sizeof(yld->phys));
949 941
950 /* register settings for the input device */ 942 /* register settings for the input device */
951 input_dev->name = yld_device[i].name; 943 input_dev->name = nfo->name;
952 input_dev->phys = yld->phys; 944 input_dev->phys = yld->phys;
953 usb_to_input_id(udev, &input_dev->id); 945 usb_to_input_id(udev, &input_dev->id);
954 input_dev->cdev.dev = &intf->dev; 946 input_dev->cdev.dev = &intf->dev;