diff options
Diffstat (limited to 'drivers/usb/input')
-rw-r--r-- | drivers/usb/input/Kconfig | 6 | ||||
-rw-r--r-- | drivers/usb/input/ati_remote.c | 17 | ||||
-rw-r--r-- | drivers/usb/input/ati_remote2.c | 3 | ||||
-rw-r--r-- | drivers/usb/input/hid-core.c | 91 | ||||
-rw-r--r-- | drivers/usb/input/hid.h | 1 | ||||
-rw-r--r-- | drivers/usb/input/usbkbd.c | 10 | ||||
-rw-r--r-- | drivers/usb/input/usbmouse.c | 4 | ||||
-rw-r--r-- | drivers/usb/input/usbtouchscreen.c | 96 | ||||
-rw-r--r-- | drivers/usb/input/wacom.h | 1 | ||||
-rw-r--r-- | drivers/usb/input/wacom_sys.c | 2 | ||||
-rw-r--r-- | drivers/usb/input/yealink.c | 6 |
11 files changed, 173 insertions, 64 deletions
diff --git a/drivers/usb/input/Kconfig b/drivers/usb/input/Kconfig index 20db36448ab3..661af7aa6236 100644 --- a/drivers/usb/input/Kconfig +++ b/drivers/usb/input/Kconfig | |||
@@ -221,6 +221,7 @@ config USB_TOUCHSCREEN | |||
221 | - ITM | 221 | - ITM |
222 | - some other eTurboTouch | 222 | - some other eTurboTouch |
223 | - Gunze AHL61 | 223 | - Gunze AHL61 |
224 | - DMC TSC-10/25 | ||
224 | 225 | ||
225 | Have a look at <http://linux.chapter7.ch/touchkit/> for | 226 | Have a look at <http://linux.chapter7.ch/touchkit/> for |
226 | a usage description and the required user-space stuff. | 227 | a usage description and the required user-space stuff. |
@@ -258,6 +259,11 @@ config USB_TOUCHSCREEN_GUNZE | |||
258 | bool "Gunze AHL61 device support" if EMBEDDED | 259 | bool "Gunze AHL61 device support" if EMBEDDED |
259 | depends on USB_TOUCHSCREEN | 260 | depends on USB_TOUCHSCREEN |
260 | 261 | ||
262 | config USB_TOUCHSCREEN_DMC_TSC10 | ||
263 | default y | ||
264 | bool "DMC TSC-10/25 device support" if EMBEDDED | ||
265 | depends on USB_TOUCHSCREEN | ||
266 | |||
261 | config USB_YEALINK | 267 | config USB_YEALINK |
262 | tristate "Yealink usb-p1k voip phone" | 268 | tristate "Yealink usb-p1k voip phone" |
263 | depends on USB && INPUT && EXPERIMENTAL | 269 | depends on USB && INPUT && EXPERIMENTAL |
diff --git a/drivers/usb/input/ati_remote.c b/drivers/usb/input/ati_remote.c index f659f3028ad2..ff23318dc301 100644 --- a/drivers/usb/input/ati_remote.c +++ b/drivers/usb/input/ati_remote.c | |||
@@ -630,19 +630,14 @@ static int ati_remote_alloc_buffers(struct usb_device *udev, | |||
630 | */ | 630 | */ |
631 | static void ati_remote_free_buffers(struct ati_remote *ati_remote) | 631 | static void ati_remote_free_buffers(struct ati_remote *ati_remote) |
632 | { | 632 | { |
633 | if (ati_remote->irq_urb) | 633 | usb_free_urb(ati_remote->irq_urb); |
634 | usb_free_urb(ati_remote->irq_urb); | 634 | usb_free_urb(ati_remote->out_urb); |
635 | 635 | ||
636 | if (ati_remote->out_urb) | 636 | usb_buffer_free(ati_remote->udev, DATA_BUFSIZE, |
637 | usb_free_urb(ati_remote->out_urb); | 637 | ati_remote->inbuf, ati_remote->inbuf_dma); |
638 | 638 | ||
639 | if (ati_remote->inbuf) | 639 | usb_buffer_free(ati_remote->udev, DATA_BUFSIZE, |
640 | usb_buffer_free(ati_remote->udev, DATA_BUFSIZE, | 640 | ati_remote->outbuf, ati_remote->outbuf_dma); |
641 | ati_remote->inbuf, ati_remote->inbuf_dma); | ||
642 | |||
643 | if (ati_remote->outbuf) | ||
644 | usb_buffer_free(ati_remote->udev, DATA_BUFSIZE, | ||
645 | ati_remote->inbuf, ati_remote->outbuf_dma); | ||
646 | } | 641 | } |
647 | 642 | ||
648 | static void ati_remote_input_init(struct ati_remote *ati_remote) | 643 | static void ati_remote_input_init(struct ati_remote *ati_remote) |
diff --git a/drivers/usb/input/ati_remote2.c b/drivers/usb/input/ati_remote2.c index f982a2b4a7f9..83f1f79db7c7 100644 --- a/drivers/usb/input/ati_remote2.c +++ b/drivers/usb/input/ati_remote2.c | |||
@@ -372,8 +372,7 @@ static void ati_remote2_urb_cleanup(struct ati_remote2 *ar2) | |||
372 | int i; | 372 | int i; |
373 | 373 | ||
374 | for (i = 0; i < 2; i++) { | 374 | for (i = 0; i < 2; i++) { |
375 | if (ar2->urb[i]) | 375 | usb_free_urb(ar2->urb[i]); |
376 | usb_free_urb(ar2->urb[i]); | ||
377 | 376 | ||
378 | if (ar2->buf[i]) | 377 | if (ar2->buf[i]) |
379 | usb_buffer_free(ar2->udev, 4, ar2->buf[i], ar2->buf_dma[i]); | 378 | usb_buffer_free(ar2->udev, 4, ar2->buf[i], ar2->buf_dma[i]); |
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c index ebc9e823a46e..4295bab4f1e2 100644 --- a/drivers/usb/input/hid-core.c +++ b/drivers/usb/input/hid-core.c | |||
@@ -968,21 +968,30 @@ static void hid_retry_timeout(unsigned long _hid) | |||
968 | hid_io_error(hid); | 968 | hid_io_error(hid); |
969 | } | 969 | } |
970 | 970 | ||
971 | /* Workqueue routine to reset the device */ | 971 | /* Workqueue routine to reset the device or clear a halt */ |
972 | static void hid_reset(struct work_struct *work) | 972 | static void hid_reset(struct work_struct *work) |
973 | { | 973 | { |
974 | struct hid_device *hid = | 974 | struct hid_device *hid = |
975 | container_of(work, struct hid_device, reset_work); | 975 | container_of(work, struct hid_device, reset_work); |
976 | int rc_lock, rc; | 976 | int rc_lock, rc = 0; |
977 | 977 | ||
978 | dev_dbg(&hid->intf->dev, "resetting device\n"); | 978 | if (test_bit(HID_CLEAR_HALT, &hid->iofl)) { |
979 | rc = rc_lock = usb_lock_device_for_reset(hid->dev, hid->intf); | 979 | dev_dbg(&hid->intf->dev, "clear halt\n"); |
980 | if (rc_lock >= 0) { | 980 | rc = usb_clear_halt(hid->dev, hid->urbin->pipe); |
981 | rc = usb_reset_composite_device(hid->dev, hid->intf); | 981 | clear_bit(HID_CLEAR_HALT, &hid->iofl); |
982 | if (rc_lock) | 982 | hid_start_in(hid); |
983 | usb_unlock_device(hid->dev); | 983 | } |
984 | |||
985 | else if (test_bit(HID_RESET_PENDING, &hid->iofl)) { | ||
986 | dev_dbg(&hid->intf->dev, "resetting device\n"); | ||
987 | rc = rc_lock = usb_lock_device_for_reset(hid->dev, hid->intf); | ||
988 | if (rc_lock >= 0) { | ||
989 | rc = usb_reset_composite_device(hid->dev, hid->intf); | ||
990 | if (rc_lock) | ||
991 | usb_unlock_device(hid->dev); | ||
992 | } | ||
993 | clear_bit(HID_RESET_PENDING, &hid->iofl); | ||
984 | } | 994 | } |
985 | clear_bit(HID_RESET_PENDING, &hid->iofl); | ||
986 | 995 | ||
987 | switch (rc) { | 996 | switch (rc) { |
988 | case 0: | 997 | case 0: |
@@ -1024,9 +1033,8 @@ static void hid_io_error(struct hid_device *hid) | |||
1024 | 1033 | ||
1025 | /* Retries failed, so do a port reset */ | 1034 | /* Retries failed, so do a port reset */ |
1026 | if (!test_and_set_bit(HID_RESET_PENDING, &hid->iofl)) { | 1035 | if (!test_and_set_bit(HID_RESET_PENDING, &hid->iofl)) { |
1027 | if (schedule_work(&hid->reset_work)) | 1036 | schedule_work(&hid->reset_work); |
1028 | goto done; | 1037 | goto done; |
1029 | clear_bit(HID_RESET_PENDING, &hid->iofl); | ||
1030 | } | 1038 | } |
1031 | } | 1039 | } |
1032 | 1040 | ||
@@ -1050,6 +1058,11 @@ static void hid_irq_in(struct urb *urb) | |||
1050 | hid->retry_delay = 0; | 1058 | hid->retry_delay = 0; |
1051 | hid_input_report(HID_INPUT_REPORT, urb, 1); | 1059 | hid_input_report(HID_INPUT_REPORT, urb, 1); |
1052 | break; | 1060 | break; |
1061 | case -EPIPE: /* stall */ | ||
1062 | clear_bit(HID_IN_RUNNING, &hid->iofl); | ||
1063 | set_bit(HID_CLEAR_HALT, &hid->iofl); | ||
1064 | schedule_work(&hid->reset_work); | ||
1065 | return; | ||
1053 | case -ECONNRESET: /* unlink */ | 1066 | case -ECONNRESET: /* unlink */ |
1054 | case -ENOENT: | 1067 | case -ENOENT: |
1055 | case -ESHUTDOWN: /* unplug */ | 1068 | case -ESHUTDOWN: /* unplug */ |
@@ -1628,6 +1641,19 @@ void hid_init_reports(struct hid_device *hid) | |||
1628 | 1641 | ||
1629 | #define USB_VENDOR_ID_APPLE 0x05ac | 1642 | #define USB_VENDOR_ID_APPLE 0x05ac |
1630 | #define USB_DEVICE_ID_APPLE_MIGHTYMOUSE 0x0304 | 1643 | #define USB_DEVICE_ID_APPLE_MIGHTYMOUSE 0x0304 |
1644 | #define USB_DEVICE_ID_APPLE_FOUNTAIN_ANSI 0x020e | ||
1645 | #define USB_DEVICE_ID_APPLE_FOUNTAIN_ISO 0x020f | ||
1646 | #define USB_DEVICE_ID_APPLE_GEYSER_ANSI 0x0214 | ||
1647 | #define USB_DEVICE_ID_APPLE_GEYSER_ISO 0x0215 | ||
1648 | #define USB_DEVICE_ID_APPLE_GEYSER_JIS 0x0216 | ||
1649 | #define USB_DEVICE_ID_APPLE_GEYSER3_ANSI 0x0217 | ||
1650 | #define USB_DEVICE_ID_APPLE_GEYSER3_ISO 0x0218 | ||
1651 | #define USB_DEVICE_ID_APPLE_GEYSER3_JIS 0x0219 | ||
1652 | #define USB_DEVICE_ID_APPLE_GEYSER4_ANSI 0x021a | ||
1653 | #define USB_DEVICE_ID_APPLE_GEYSER4_ISO 0x021b | ||
1654 | #define USB_DEVICE_ID_APPLE_GEYSER4_JIS 0x021c | ||
1655 | #define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY 0x030a | ||
1656 | #define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY 0x030b | ||
1631 | 1657 | ||
1632 | #define USB_VENDOR_ID_CHERRY 0x046a | 1658 | #define USB_VENDOR_ID_CHERRY 0x046a |
1633 | #define USB_DEVICE_ID_CHERRY_CYMOTION 0x0023 | 1659 | #define USB_DEVICE_ID_CHERRY_CYMOTION 0x0023 |
@@ -1795,17 +1821,19 @@ static const struct hid_blacklist { | |||
1795 | 1821 | ||
1796 | { USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION, HID_QUIRK_CYMOTION }, | 1822 | { USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION, HID_QUIRK_CYMOTION }, |
1797 | 1823 | ||
1798 | { USB_VENDOR_ID_APPLE, 0x020E, HID_QUIRK_POWERBOOK_HAS_FN }, | 1824 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ANSI, HID_QUIRK_POWERBOOK_HAS_FN }, |
1799 | { USB_VENDOR_ID_APPLE, 0x020F, HID_QUIRK_POWERBOOK_HAS_FN }, | 1825 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ISO, HID_QUIRK_POWERBOOK_HAS_FN }, |
1800 | { USB_VENDOR_ID_APPLE, 0x0214, HID_QUIRK_POWERBOOK_HAS_FN }, | 1826 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ANSI, HID_QUIRK_POWERBOOK_HAS_FN }, |
1801 | { USB_VENDOR_ID_APPLE, 0x0215, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_POWERBOOK_ISO_KEYBOARD}, | 1827 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ISO, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_POWERBOOK_ISO_KEYBOARD}, |
1802 | { USB_VENDOR_ID_APPLE, 0x0216, HID_QUIRK_POWERBOOK_HAS_FN }, | 1828 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_JIS, HID_QUIRK_POWERBOOK_HAS_FN }, |
1803 | { USB_VENDOR_ID_APPLE, 0x0217, HID_QUIRK_POWERBOOK_HAS_FN }, | 1829 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ANSI, HID_QUIRK_POWERBOOK_HAS_FN }, |
1804 | { USB_VENDOR_ID_APPLE, 0x0218, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_POWERBOOK_ISO_KEYBOARD}, | 1830 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ISO, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_POWERBOOK_ISO_KEYBOARD}, |
1805 | { USB_VENDOR_ID_APPLE, 0x0219, HID_QUIRK_POWERBOOK_HAS_FN }, | 1831 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_JIS, HID_QUIRK_POWERBOOK_HAS_FN }, |
1806 | { USB_VENDOR_ID_APPLE, 0x021B, HID_QUIRK_POWERBOOK_HAS_FN }, | 1832 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ANSI, HID_QUIRK_POWERBOOK_HAS_FN }, |
1807 | { USB_VENDOR_ID_APPLE, 0x030A, HID_QUIRK_POWERBOOK_HAS_FN }, | 1833 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ISO, HID_QUIRK_POWERBOOK_HAS_FN }, |
1808 | { USB_VENDOR_ID_APPLE, 0x030B, HID_QUIRK_POWERBOOK_HAS_FN }, | 1834 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_JIS, HID_QUIRK_POWERBOOK_HAS_FN }, |
1835 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY, HID_QUIRK_POWERBOOK_HAS_FN }, | ||
1836 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY, HID_QUIRK_POWERBOOK_HAS_FN }, | ||
1809 | 1837 | ||
1810 | { USB_VENDOR_ID_PANJIT, 0x0001, HID_QUIRK_IGNORE }, | 1838 | { USB_VENDOR_ID_PANJIT, 0x0001, HID_QUIRK_IGNORE }, |
1811 | { USB_VENDOR_ID_PANJIT, 0x0002, HID_QUIRK_IGNORE }, | 1839 | { USB_VENDOR_ID_PANJIT, 0x0002, HID_QUIRK_IGNORE }, |
@@ -1986,7 +2014,7 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) | |||
1986 | if (hid->collection->usage == HID_GD_MOUSE && hid_mousepoll_interval > 0) | 2014 | if (hid->collection->usage == HID_GD_MOUSE && hid_mousepoll_interval > 0) |
1987 | interval = hid_mousepoll_interval; | 2015 | interval = hid_mousepoll_interval; |
1988 | 2016 | ||
1989 | if (endpoint->bEndpointAddress & USB_DIR_IN) { | 2017 | if (usb_endpoint_dir_in(endpoint)) { |
1990 | if (hid->urbin) | 2018 | if (hid->urbin) |
1991 | continue; | 2019 | continue; |
1992 | if (!(hid->urbin = usb_alloc_urb(0, GFP_KERNEL))) | 2020 | if (!(hid->urbin = usb_alloc_urb(0, GFP_KERNEL))) |
@@ -2068,13 +2096,9 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) | |||
2068 | return hid; | 2096 | return hid; |
2069 | 2097 | ||
2070 | fail: | 2098 | fail: |
2071 | 2099 | usb_free_urb(hid->urbin); | |
2072 | if (hid->urbin) | 2100 | usb_free_urb(hid->urbout); |
2073 | usb_free_urb(hid->urbin); | 2101 | usb_free_urb(hid->urbctrl); |
2074 | if (hid->urbout) | ||
2075 | usb_free_urb(hid->urbout); | ||
2076 | if (hid->urbctrl) | ||
2077 | usb_free_urb(hid->urbctrl); | ||
2078 | hid_free_buffers(dev, hid); | 2102 | hid_free_buffers(dev, hid); |
2079 | hid_free_device(hid); | 2103 | hid_free_device(hid); |
2080 | 2104 | ||
@@ -2105,8 +2129,7 @@ static void hid_disconnect(struct usb_interface *intf) | |||
2105 | 2129 | ||
2106 | usb_free_urb(hid->urbin); | 2130 | usb_free_urb(hid->urbin); |
2107 | usb_free_urb(hid->urbctrl); | 2131 | usb_free_urb(hid->urbctrl); |
2108 | if (hid->urbout) | 2132 | usb_free_urb(hid->urbout); |
2109 | usb_free_urb(hid->urbout); | ||
2110 | 2133 | ||
2111 | hid_free_buffers(hid->dev, hid); | 2134 | hid_free_buffers(hid->dev, hid); |
2112 | hid_free_device(hid); | 2135 | hid_free_device(hid); |
diff --git a/drivers/usb/input/hid.h b/drivers/usb/input/hid.h index 0e76e6dcac37..2a9bf07944c0 100644 --- a/drivers/usb/input/hid.h +++ b/drivers/usb/input/hid.h | |||
@@ -385,6 +385,7 @@ struct hid_control_fifo { | |||
385 | #define HID_IN_RUNNING 3 | 385 | #define HID_IN_RUNNING 3 |
386 | #define HID_RESET_PENDING 4 | 386 | #define HID_RESET_PENDING 4 |
387 | #define HID_SUSPENDED 5 | 387 | #define HID_SUSPENDED 5 |
388 | #define HID_CLEAR_HALT 6 | ||
388 | 389 | ||
389 | struct hid_input { | 390 | struct hid_input { |
390 | struct list_head list; | 391 | struct list_head list; |
diff --git a/drivers/usb/input/usbkbd.c b/drivers/usb/input/usbkbd.c index c73285cf8558..dac88640eab6 100644 --- a/drivers/usb/input/usbkbd.c +++ b/drivers/usb/input/usbkbd.c | |||
@@ -208,10 +208,8 @@ static int usb_kbd_alloc_mem(struct usb_device *dev, struct usb_kbd *kbd) | |||
208 | 208 | ||
209 | static void usb_kbd_free_mem(struct usb_device *dev, struct usb_kbd *kbd) | 209 | static void usb_kbd_free_mem(struct usb_device *dev, struct usb_kbd *kbd) |
210 | { | 210 | { |
211 | if (kbd->irq) | 211 | usb_free_urb(kbd->irq); |
212 | usb_free_urb(kbd->irq); | 212 | usb_free_urb(kbd->led); |
213 | if (kbd->led) | ||
214 | usb_free_urb(kbd->led); | ||
215 | if (kbd->new) | 213 | if (kbd->new) |
216 | usb_buffer_free(dev, 8, kbd->new, kbd->new_dma); | 214 | usb_buffer_free(dev, 8, kbd->new, kbd->new_dma); |
217 | if (kbd->cr) | 215 | if (kbd->cr) |
@@ -236,9 +234,7 @@ static int usb_kbd_probe(struct usb_interface *iface, | |||
236 | return -ENODEV; | 234 | return -ENODEV; |
237 | 235 | ||
238 | endpoint = &interface->endpoint[0].desc; | 236 | endpoint = &interface->endpoint[0].desc; |
239 | if (!(endpoint->bEndpointAddress & USB_DIR_IN)) | 237 | if (!usb_endpoint_is_int_in(endpoint)) |
240 | return -ENODEV; | ||
241 | if ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT) | ||
242 | return -ENODEV; | 238 | return -ENODEV; |
243 | 239 | ||
244 | pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress); | 240 | pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress); |
diff --git a/drivers/usb/input/usbmouse.c b/drivers/usb/input/usbmouse.c index cbbbea332ed7..68a55642c082 100644 --- a/drivers/usb/input/usbmouse.c +++ b/drivers/usb/input/usbmouse.c | |||
@@ -126,9 +126,7 @@ static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_i | |||
126 | return -ENODEV; | 126 | return -ENODEV; |
127 | 127 | ||
128 | endpoint = &interface->endpoint[0].desc; | 128 | endpoint = &interface->endpoint[0].desc; |
129 | if (!(endpoint->bEndpointAddress & USB_DIR_IN)) | 129 | if (!usb_endpoint_is_int_in(endpoint)) |
130 | return -ENODEV; | ||
131 | if ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT) | ||
132 | return -ENODEV; | 130 | return -ENODEV; |
133 | 131 | ||
134 | pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress); | 132 | pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress); |
diff --git a/drivers/usb/input/usbtouchscreen.c b/drivers/usb/input/usbtouchscreen.c index 933ceddf3dee..49704d4ed0e2 100644 --- a/drivers/usb/input/usbtouchscreen.c +++ b/drivers/usb/input/usbtouchscreen.c | |||
@@ -8,6 +8,7 @@ | |||
8 | * - PanJit TouchSet | 8 | * - PanJit TouchSet |
9 | * - eTurboTouch | 9 | * - eTurboTouch |
10 | * - Gunze AHL61 | 10 | * - Gunze AHL61 |
11 | * - DMC TSC-10/25 | ||
11 | * | 12 | * |
12 | * Copyright (C) 2004-2006 by Daniel Ritz <daniel.ritz@gmx.ch> | 13 | * Copyright (C) 2004-2006 by Daniel Ritz <daniel.ritz@gmx.ch> |
13 | * Copyright (C) by Todd E. Johnson (mtouchusb.c) | 14 | * Copyright (C) by Todd E. Johnson (mtouchusb.c) |
@@ -30,6 +31,8 @@ | |||
30 | * - ITM parts are from itmtouch.c | 31 | * - ITM parts are from itmtouch.c |
31 | * - 3M parts are from mtouchusb.c | 32 | * - 3M parts are from mtouchusb.c |
32 | * - PanJit parts are from an unmerged driver by Lanslott Gish | 33 | * - PanJit parts are from an unmerged driver by Lanslott Gish |
34 | * - DMC TSC 10/25 are from Holger Schurig, with ideas from an unmerged | ||
35 | * driver from Marius Vollmer | ||
33 | * | 36 | * |
34 | *****************************************************************************/ | 37 | *****************************************************************************/ |
35 | 38 | ||
@@ -44,7 +47,7 @@ | |||
44 | #include <linux/usb/input.h> | 47 | #include <linux/usb/input.h> |
45 | 48 | ||
46 | 49 | ||
47 | #define DRIVER_VERSION "v0.4" | 50 | #define DRIVER_VERSION "v0.5" |
48 | #define DRIVER_AUTHOR "Daniel Ritz <daniel.ritz@gmx.ch>" | 51 | #define DRIVER_AUTHOR "Daniel Ritz <daniel.ritz@gmx.ch>" |
49 | #define DRIVER_DESC "USB Touchscreen Driver" | 52 | #define DRIVER_DESC "USB Touchscreen Driver" |
50 | 53 | ||
@@ -103,6 +106,7 @@ enum { | |||
103 | DEVTYPE_ITM, | 106 | DEVTYPE_ITM, |
104 | DEVTYPE_ETURBO, | 107 | DEVTYPE_ETURBO, |
105 | DEVTYPE_GUNZE, | 108 | DEVTYPE_GUNZE, |
109 | DEVTYPE_DMC_TSC10, | ||
106 | }; | 110 | }; |
107 | 111 | ||
108 | static struct usb_device_id usbtouch_devices[] = { | 112 | static struct usb_device_id usbtouch_devices[] = { |
@@ -139,6 +143,10 @@ static struct usb_device_id usbtouch_devices[] = { | |||
139 | {USB_DEVICE(0x0637, 0x0001), .driver_info = DEVTYPE_GUNZE}, | 143 | {USB_DEVICE(0x0637, 0x0001), .driver_info = DEVTYPE_GUNZE}, |
140 | #endif | 144 | #endif |
141 | 145 | ||
146 | #ifdef CONFIG_USB_TOUCHSCREEN_DMC_TSC10 | ||
147 | {USB_DEVICE(0x0afa, 0x03e8), .driver_info = DEVTYPE_DMC_TSC10}, | ||
148 | #endif | ||
149 | |||
142 | {} | 150 | {} |
143 | }; | 151 | }; |
144 | 152 | ||
@@ -313,6 +321,80 @@ static int gunze_read_data(unsigned char *pkt, int *x, int *y, int *touch, int * | |||
313 | #endif | 321 | #endif |
314 | 322 | ||
315 | /***************************************************************************** | 323 | /***************************************************************************** |
324 | * DMC TSC-10/25 Part | ||
325 | * | ||
326 | * Documentation about the controller and it's protocol can be found at | ||
327 | * http://www.dmccoltd.com/files/controler/tsc10usb_pi_e.pdf | ||
328 | * http://www.dmccoltd.com/files/controler/tsc25_usb_e.pdf | ||
329 | */ | ||
330 | #ifdef CONFIG_USB_TOUCHSCREEN_DMC_TSC10 | ||
331 | |||
332 | /* supported data rates. currently using 130 */ | ||
333 | #define TSC10_RATE_POINT 0x50 | ||
334 | #define TSC10_RATE_30 0x40 | ||
335 | #define TSC10_RATE_50 0x41 | ||
336 | #define TSC10_RATE_80 0x42 | ||
337 | #define TSC10_RATE_100 0x43 | ||
338 | #define TSC10_RATE_130 0x44 | ||
339 | #define TSC10_RATE_150 0x45 | ||
340 | |||
341 | /* commands */ | ||
342 | #define TSC10_CMD_RESET 0x55 | ||
343 | #define TSC10_CMD_RATE 0x05 | ||
344 | #define TSC10_CMD_DATA1 0x01 | ||
345 | |||
346 | static int dmc_tsc10_init(struct usbtouch_usb *usbtouch) | ||
347 | { | ||
348 | struct usb_device *dev = usbtouch->udev; | ||
349 | int ret; | ||
350 | unsigned char buf[2]; | ||
351 | |||
352 | /* reset */ | ||
353 | buf[0] = buf[1] = 0xFF; | ||
354 | ret = usb_control_msg(dev, usb_rcvctrlpipe (dev, 0), | ||
355 | TSC10_CMD_RESET, | ||
356 | USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | ||
357 | 0, 0, buf, 2, USB_CTRL_SET_TIMEOUT); | ||
358 | if (ret < 0) | ||
359 | return ret; | ||
360 | if (buf[0] != 0x06 || buf[1] != 0x00) | ||
361 | return -ENODEV; | ||
362 | |||
363 | /* set coordinate output rate */ | ||
364 | buf[0] = buf[1] = 0xFF; | ||
365 | ret = usb_control_msg(dev, usb_rcvctrlpipe (dev, 0), | ||
366 | TSC10_CMD_RATE, | ||
367 | USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | ||
368 | TSC10_RATE_150, 0, buf, 2, USB_CTRL_SET_TIMEOUT); | ||
369 | if (ret < 0) | ||
370 | return ret; | ||
371 | if (buf[0] != 0x06 || buf[1] != 0x00) | ||
372 | return -ENODEV; | ||
373 | |||
374 | /* start sending data */ | ||
375 | ret = usb_control_msg(dev, usb_rcvctrlpipe (dev, 0), | ||
376 | TSC10_CMD_DATA1, | ||
377 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | ||
378 | 0, 0, NULL, 0, USB_CTRL_SET_TIMEOUT); | ||
379 | if (ret < 0) | ||
380 | return ret; | ||
381 | |||
382 | return 0; | ||
383 | } | ||
384 | |||
385 | |||
386 | static int dmc_tsc10_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) | ||
387 | { | ||
388 | *x = ((pkt[2] & 0x03) << 8) | pkt[1]; | ||
389 | *y = ((pkt[4] & 0x03) << 8) | pkt[3]; | ||
390 | *touch = pkt[0] & 0x01; | ||
391 | |||
392 | return 1; | ||
393 | } | ||
394 | #endif | ||
395 | |||
396 | |||
397 | /***************************************************************************** | ||
316 | * the different device descriptors | 398 | * the different device descriptors |
317 | */ | 399 | */ |
318 | static struct usbtouch_device_info usbtouch_dev_info[] = { | 400 | static struct usbtouch_device_info usbtouch_dev_info[] = { |
@@ -389,6 +471,18 @@ static struct usbtouch_device_info usbtouch_dev_info[] = { | |||
389 | .read_data = gunze_read_data, | 471 | .read_data = gunze_read_data, |
390 | }, | 472 | }, |
391 | #endif | 473 | #endif |
474 | |||
475 | #ifdef CONFIG_USB_TOUCHSCREEN_DMC_TSC10 | ||
476 | [DEVTYPE_DMC_TSC10] = { | ||
477 | .min_xc = 0x0, | ||
478 | .max_xc = 0x03ff, | ||
479 | .min_yc = 0x0, | ||
480 | .max_yc = 0x03ff, | ||
481 | .rept_size = 5, | ||
482 | .init = dmc_tsc10_init, | ||
483 | .read_data = dmc_tsc10_read_data, | ||
484 | }, | ||
485 | #endif | ||
392 | }; | 486 | }; |
393 | 487 | ||
394 | 488 | ||
diff --git a/drivers/usb/input/wacom.h b/drivers/usb/input/wacom.h index 1cf08f02c50e..d85abfc5ab58 100644 --- a/drivers/usb/input/wacom.h +++ b/drivers/usb/input/wacom.h | |||
@@ -110,7 +110,6 @@ struct wacom_combo { | |||
110 | }; | 110 | }; |
111 | 111 | ||
112 | extern int wacom_wac_irq(struct wacom_wac * wacom_wac, void * wcombo); | 112 | extern int wacom_wac_irq(struct wacom_wac * wacom_wac, void * wcombo); |
113 | extern void wacom_sys_irq(struct urb *urb); | ||
114 | extern void wacom_report_abs(void *wcombo, unsigned int abs_type, int abs_data); | 113 | extern void wacom_report_abs(void *wcombo, unsigned int abs_type, int abs_data); |
115 | extern void wacom_report_rel(void *wcombo, unsigned int rel_type, int rel_data); | 114 | extern void wacom_report_rel(void *wcombo, unsigned int rel_type, int rel_data); |
116 | extern void wacom_report_key(void *wcombo, unsigned int key_type, int key_data); | 115 | extern void wacom_report_key(void *wcombo, unsigned int key_type, int key_data); |
diff --git a/drivers/usb/input/wacom_sys.c b/drivers/usb/input/wacom_sys.c index 3498b893b53b..e7cc20ab8155 100644 --- a/drivers/usb/input/wacom_sys.c +++ b/drivers/usb/input/wacom_sys.c | |||
@@ -42,7 +42,7 @@ static struct input_dev * get_input_dev(struct wacom_combo *wcombo) | |||
42 | return wcombo->wacom->dev; | 42 | return wcombo->wacom->dev; |
43 | } | 43 | } |
44 | 44 | ||
45 | void wacom_sys_irq(struct urb *urb) | 45 | static void wacom_sys_irq(struct urb *urb) |
46 | { | 46 | { |
47 | struct wacom *wacom = urb->context; | 47 | struct wacom *wacom = urb->context; |
48 | struct wacom_combo wcombo; | 48 | struct wacom_combo wcombo; |
diff --git a/drivers/usb/input/yealink.c b/drivers/usb/input/yealink.c index 905bf6398257..2268ca311ade 100644 --- a/drivers/usb/input/yealink.c +++ b/drivers/usb/input/yealink.c | |||
@@ -859,10 +859,8 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
859 | 859 | ||
860 | interface = intf->cur_altsetting; | 860 | interface = intf->cur_altsetting; |
861 | endpoint = &interface->endpoint[0].desc; | 861 | endpoint = &interface->endpoint[0].desc; |
862 | if (!(endpoint->bEndpointAddress & USB_DIR_IN)) | 862 | if (!usb_endpoint_is_int_in(endpoint)) |
863 | return -EIO; | 863 | return -ENODEV; |
864 | if ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT) | ||
865 | return -EIO; | ||
866 | 864 | ||
867 | yld = kzalloc(sizeof(struct yealink_dev), GFP_KERNEL); | 865 | yld = kzalloc(sizeof(struct yealink_dev), GFP_KERNEL); |
868 | if (!yld) | 866 | if (!yld) |