diff options
author | Dmitry Torokhov <dtor@insightbb.com> | 2006-12-08 01:07:56 -0500 |
---|---|---|
committer | Dmitry Torokhov <dtor@insightbb.com> | 2006-12-08 01:07:56 -0500 |
commit | bef986502fa398b1785a3979b1aa17cd902d3527 (patch) | |
tree | b59c1afe7b1dfcc001b86e54863f550d7ddc8c34 /drivers/usb/input | |
parent | 4bdbd2807deeccc0793d57fb5120d7a53f2c0b3c (diff) | |
parent | c99767974ebd2a719d849fdeaaa1674456f5283f (diff) |
Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:
drivers/usb/input/hid.h
Diffstat (limited to 'drivers/usb/input')
-rw-r--r-- | drivers/usb/input/Kconfig | 6 | ||||
-rw-r--r-- | drivers/usb/input/acecad.c | 2 | ||||
-rw-r--r-- | drivers/usb/input/aiptek.c | 2 | ||||
-rw-r--r-- | drivers/usb/input/ati_remote.c | 23 | ||||
-rw-r--r-- | drivers/usb/input/ati_remote2.c | 3 | ||||
-rw-r--r-- | drivers/usb/input/hid-core.c | 107 | ||||
-rw-r--r-- | drivers/usb/input/hid-input.c | 17 | ||||
-rw-r--r-- | drivers/usb/input/hid.h | 4 | ||||
-rw-r--r-- | drivers/usb/input/keyspan_remote.c | 2 | ||||
-rw-r--r-- | drivers/usb/input/mtouchusb.c | 2 | ||||
-rw-r--r-- | drivers/usb/input/powermate.c | 4 | ||||
-rw-r--r-- | drivers/usb/input/touchkitusb.c | 2 | ||||
-rw-r--r-- | drivers/usb/input/usbkbd.c | 18 | ||||
-rw-r--r-- | drivers/usb/input/usbmouse.c | 8 | ||||
-rw-r--r-- | drivers/usb/input/usbtouchscreen.c | 98 | ||||
-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/xpad.c | 2 | ||||
-rw-r--r-- | drivers/usb/input/yealink.c | 12 |
19 files changed, 222 insertions, 93 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/acecad.c b/drivers/usb/input/acecad.c index 0096373b5f98..909138e5aa04 100644 --- a/drivers/usb/input/acecad.c +++ b/drivers/usb/input/acecad.c | |||
@@ -152,7 +152,7 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_ | |||
152 | if (!acecad || !input_dev) | 152 | if (!acecad || !input_dev) |
153 | goto fail1; | 153 | goto fail1; |
154 | 154 | ||
155 | acecad->data = usb_buffer_alloc(dev, 8, SLAB_KERNEL, &acecad->data_dma); | 155 | acecad->data = usb_buffer_alloc(dev, 8, GFP_KERNEL, &acecad->data_dma); |
156 | if (!acecad->data) | 156 | if (!acecad->data) |
157 | goto fail1; | 157 | goto fail1; |
158 | 158 | ||
diff --git a/drivers/usb/input/aiptek.c b/drivers/usb/input/aiptek.c index bf428184608f..9f52429ce654 100644 --- a/drivers/usb/input/aiptek.c +++ b/drivers/usb/input/aiptek.c | |||
@@ -1988,7 +1988,7 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
1988 | goto fail1; | 1988 | goto fail1; |
1989 | 1989 | ||
1990 | aiptek->data = usb_buffer_alloc(usbdev, AIPTEK_PACKET_LENGTH, | 1990 | aiptek->data = usb_buffer_alloc(usbdev, AIPTEK_PACKET_LENGTH, |
1991 | SLAB_ATOMIC, &aiptek->data_dma); | 1991 | GFP_ATOMIC, &aiptek->data_dma); |
1992 | if (!aiptek->data) | 1992 | if (!aiptek->data) |
1993 | goto fail1; | 1993 | goto fail1; |
1994 | 1994 | ||
diff --git a/drivers/usb/input/ati_remote.c b/drivers/usb/input/ati_remote.c index f659f3028ad2..b724e36f7b92 100644 --- a/drivers/usb/input/ati_remote.c +++ b/drivers/usb/input/ati_remote.c | |||
@@ -592,7 +592,7 @@ static void ati_remote_irq_in(struct urb *urb) | |||
592 | __FUNCTION__, urb->status); | 592 | __FUNCTION__, urb->status); |
593 | } | 593 | } |
594 | 594 | ||
595 | retval = usb_submit_urb(urb, SLAB_ATOMIC); | 595 | retval = usb_submit_urb(urb, GFP_ATOMIC); |
596 | if (retval) | 596 | if (retval) |
597 | dev_err(&ati_remote->interface->dev, "%s: usb_submit_urb()=%d\n", | 597 | dev_err(&ati_remote->interface->dev, "%s: usb_submit_urb()=%d\n", |
598 | __FUNCTION__, retval); | 598 | __FUNCTION__, retval); |
@@ -604,12 +604,12 @@ static void ati_remote_irq_in(struct urb *urb) | |||
604 | static int ati_remote_alloc_buffers(struct usb_device *udev, | 604 | static int ati_remote_alloc_buffers(struct usb_device *udev, |
605 | struct ati_remote *ati_remote) | 605 | struct ati_remote *ati_remote) |
606 | { | 606 | { |
607 | ati_remote->inbuf = usb_buffer_alloc(udev, DATA_BUFSIZE, SLAB_ATOMIC, | 607 | ati_remote->inbuf = usb_buffer_alloc(udev, DATA_BUFSIZE, GFP_ATOMIC, |
608 | &ati_remote->inbuf_dma); | 608 | &ati_remote->inbuf_dma); |
609 | if (!ati_remote->inbuf) | 609 | if (!ati_remote->inbuf) |
610 | return -1; | 610 | return -1; |
611 | 611 | ||
612 | ati_remote->outbuf = usb_buffer_alloc(udev, DATA_BUFSIZE, SLAB_ATOMIC, | 612 | ati_remote->outbuf = usb_buffer_alloc(udev, DATA_BUFSIZE, GFP_ATOMIC, |
613 | &ati_remote->outbuf_dma); | 613 | &ati_remote->outbuf_dma); |
614 | if (!ati_remote->outbuf) | 614 | if (!ati_remote->outbuf) |
615 | return -1; | 615 | return -1; |
@@ -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 6095d9cedb7e..0811c39bd14f 100644 --- a/drivers/usb/input/hid-core.c +++ b/drivers/usb/input/hid-core.c | |||
@@ -968,20 +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(void *_hid) | 972 | static void hid_reset(struct work_struct *work) |
973 | { | 973 | { |
974 | struct hid_device *hid = (struct hid_device *) _hid; | 974 | struct hid_device *hid = |
975 | int rc_lock, rc; | 975 | container_of(work, struct hid_device, reset_work); |
976 | 976 | int rc_lock, rc = 0; | |
977 | dev_dbg(&hid->intf->dev, "resetting device\n"); | 977 | |
978 | rc = rc_lock = usb_lock_device_for_reset(hid->dev, hid->intf); | 978 | if (test_bit(HID_CLEAR_HALT, &hid->iofl)) { |
979 | if (rc_lock >= 0) { | 979 | dev_dbg(&hid->intf->dev, "clear halt\n"); |
980 | rc = usb_reset_composite_device(hid->dev, hid->intf); | 980 | rc = usb_clear_halt(hid->dev, hid->urbin->pipe); |
981 | if (rc_lock) | 981 | clear_bit(HID_CLEAR_HALT, &hid->iofl); |
982 | usb_unlock_device(hid->dev); | 982 | hid_start_in(hid); |
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); | ||
983 | } | 994 | } |
984 | clear_bit(HID_RESET_PENDING, &hid->iofl); | ||
985 | 995 | ||
986 | switch (rc) { | 996 | switch (rc) { |
987 | case 0: | 997 | case 0: |
@@ -1023,9 +1033,8 @@ static void hid_io_error(struct hid_device *hid) | |||
1023 | 1033 | ||
1024 | /* Retries failed, so do a port reset */ | 1034 | /* Retries failed, so do a port reset */ |
1025 | if (!test_and_set_bit(HID_RESET_PENDING, &hid->iofl)) { | 1035 | if (!test_and_set_bit(HID_RESET_PENDING, &hid->iofl)) { |
1026 | if (schedule_work(&hid->reset_work)) | 1036 | schedule_work(&hid->reset_work); |
1027 | goto done; | 1037 | goto done; |
1028 | clear_bit(HID_RESET_PENDING, &hid->iofl); | ||
1029 | } | 1038 | } |
1030 | } | 1039 | } |
1031 | 1040 | ||
@@ -1049,6 +1058,11 @@ static void hid_irq_in(struct urb *urb) | |||
1049 | hid->retry_delay = 0; | 1058 | hid->retry_delay = 0; |
1050 | hid_input_report(HID_INPUT_REPORT, urb, 1); | 1059 | hid_input_report(HID_INPUT_REPORT, urb, 1); |
1051 | 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; | ||
1052 | case -ECONNRESET: /* unlink */ | 1066 | case -ECONNRESET: /* unlink */ |
1053 | case -ENOENT: | 1067 | case -ENOENT: |
1054 | case -ESHUTDOWN: /* unplug */ | 1068 | case -ESHUTDOWN: /* unplug */ |
@@ -1065,7 +1079,7 @@ static void hid_irq_in(struct urb *urb) | |||
1065 | warn("input irq status %d received", urb->status); | 1079 | warn("input irq status %d received", urb->status); |
1066 | } | 1080 | } |
1067 | 1081 | ||
1068 | status = usb_submit_urb(urb, SLAB_ATOMIC); | 1082 | status = usb_submit_urb(urb, GFP_ATOMIC); |
1069 | if (status) { | 1083 | if (status) { |
1070 | clear_bit(HID_IN_RUNNING, &hid->iofl); | 1084 | clear_bit(HID_IN_RUNNING, &hid->iofl); |
1071 | if (status != -EPERM) { | 1085 | if (status != -EPERM) { |
@@ -1627,6 +1641,19 @@ void hid_init_reports(struct hid_device *hid) | |||
1627 | 1641 | ||
1628 | #define USB_VENDOR_ID_APPLE 0x05ac | 1642 | #define USB_VENDOR_ID_APPLE 0x05ac |
1629 | #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 | ||
1630 | 1657 | ||
1631 | #define USB_VENDOR_ID_CHERRY 0x046a | 1658 | #define USB_VENDOR_ID_CHERRY 0x046a |
1632 | #define USB_DEVICE_ID_CHERRY_CYMOTION 0x0023 | 1659 | #define USB_DEVICE_ID_CHERRY_CYMOTION 0x0023 |
@@ -1797,16 +1824,19 @@ static const struct hid_blacklist { | |||
1797 | 1824 | ||
1798 | { USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION, HID_QUIRK_CYMOTION }, | 1825 | { USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION, HID_QUIRK_CYMOTION }, |
1799 | 1826 | ||
1800 | { USB_VENDOR_ID_APPLE, 0x020E, HID_QUIRK_POWERBOOK_HAS_FN }, | 1827 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ANSI, HID_QUIRK_POWERBOOK_HAS_FN }, |
1801 | { USB_VENDOR_ID_APPLE, 0x020F, HID_QUIRK_POWERBOOK_HAS_FN }, | 1828 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ISO, HID_QUIRK_POWERBOOK_HAS_FN }, |
1802 | { USB_VENDOR_ID_APPLE, 0x0214, HID_QUIRK_POWERBOOK_HAS_FN }, | 1829 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ANSI, HID_QUIRK_POWERBOOK_HAS_FN }, |
1803 | { USB_VENDOR_ID_APPLE, 0x0215, HID_QUIRK_POWERBOOK_HAS_FN }, | 1830 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ISO, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_POWERBOOK_ISO_KEYBOARD}, |
1804 | { USB_VENDOR_ID_APPLE, 0x0216, HID_QUIRK_POWERBOOK_HAS_FN }, | 1831 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_JIS, HID_QUIRK_POWERBOOK_HAS_FN }, |
1805 | { USB_VENDOR_ID_APPLE, 0x0217, HID_QUIRK_POWERBOOK_HAS_FN }, | 1832 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ANSI, HID_QUIRK_POWERBOOK_HAS_FN }, |
1806 | { USB_VENDOR_ID_APPLE, 0x0218, HID_QUIRK_POWERBOOK_HAS_FN }, | 1833 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ISO, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_POWERBOOK_ISO_KEYBOARD}, |
1807 | { USB_VENDOR_ID_APPLE, 0x0219, HID_QUIRK_POWERBOOK_HAS_FN }, | 1834 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_JIS, HID_QUIRK_POWERBOOK_HAS_FN }, |
1808 | { USB_VENDOR_ID_APPLE, 0x030A, HID_QUIRK_POWERBOOK_HAS_FN }, | 1835 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ANSI, HID_QUIRK_POWERBOOK_HAS_FN }, |
1809 | { USB_VENDOR_ID_APPLE, 0x030B, HID_QUIRK_POWERBOOK_HAS_FN }, | 1836 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ISO, HID_QUIRK_POWERBOOK_HAS_FN }, |
1837 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_JIS, HID_QUIRK_POWERBOOK_HAS_FN }, | ||
1838 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY, HID_QUIRK_POWERBOOK_HAS_FN }, | ||
1839 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY, HID_QUIRK_POWERBOOK_HAS_FN }, | ||
1810 | 1840 | ||
1811 | { USB_VENDOR_ID_PANJIT, 0x0001, HID_QUIRK_IGNORE }, | 1841 | { USB_VENDOR_ID_PANJIT, 0x0001, HID_QUIRK_IGNORE }, |
1812 | { USB_VENDOR_ID_PANJIT, 0x0002, HID_QUIRK_IGNORE }, | 1842 | { USB_VENDOR_ID_PANJIT, 0x0002, HID_QUIRK_IGNORE }, |
@@ -1839,13 +1869,13 @@ static void hid_find_max_report(struct hid_device *hid, unsigned int type, int * | |||
1839 | 1869 | ||
1840 | static int hid_alloc_buffers(struct usb_device *dev, struct hid_device *hid) | 1870 | static int hid_alloc_buffers(struct usb_device *dev, struct hid_device *hid) |
1841 | { | 1871 | { |
1842 | if (!(hid->inbuf = usb_buffer_alloc(dev, hid->bufsize, SLAB_ATOMIC, &hid->inbuf_dma))) | 1872 | if (!(hid->inbuf = usb_buffer_alloc(dev, hid->bufsize, GFP_ATOMIC, &hid->inbuf_dma))) |
1843 | return -1; | 1873 | return -1; |
1844 | if (!(hid->outbuf = usb_buffer_alloc(dev, hid->bufsize, SLAB_ATOMIC, &hid->outbuf_dma))) | 1874 | if (!(hid->outbuf = usb_buffer_alloc(dev, hid->bufsize, GFP_ATOMIC, &hid->outbuf_dma))) |
1845 | return -1; | 1875 | return -1; |
1846 | if (!(hid->cr = usb_buffer_alloc(dev, sizeof(*(hid->cr)), SLAB_ATOMIC, &hid->cr_dma))) | 1876 | if (!(hid->cr = usb_buffer_alloc(dev, sizeof(*(hid->cr)), GFP_ATOMIC, &hid->cr_dma))) |
1847 | return -1; | 1877 | return -1; |
1848 | if (!(hid->ctrlbuf = usb_buffer_alloc(dev, hid->bufsize, SLAB_ATOMIC, &hid->ctrlbuf_dma))) | 1878 | if (!(hid->ctrlbuf = usb_buffer_alloc(dev, hid->bufsize, GFP_ATOMIC, &hid->ctrlbuf_dma))) |
1849 | return -1; | 1879 | return -1; |
1850 | 1880 | ||
1851 | return 0; | 1881 | return 0; |
@@ -1989,7 +2019,7 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) | |||
1989 | if (hid->collection->usage == HID_GD_MOUSE && hid_mousepoll_interval > 0) | 2019 | if (hid->collection->usage == HID_GD_MOUSE && hid_mousepoll_interval > 0) |
1990 | interval = hid_mousepoll_interval; | 2020 | interval = hid_mousepoll_interval; |
1991 | 2021 | ||
1992 | if (endpoint->bEndpointAddress & USB_DIR_IN) { | 2022 | if (usb_endpoint_dir_in(endpoint)) { |
1993 | if (hid->urbin) | 2023 | if (hid->urbin) |
1994 | continue; | 2024 | continue; |
1995 | if (!(hid->urbin = usb_alloc_urb(0, GFP_KERNEL))) | 2025 | if (!(hid->urbin = usb_alloc_urb(0, GFP_KERNEL))) |
@@ -2019,7 +2049,7 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) | |||
2019 | 2049 | ||
2020 | init_waitqueue_head(&hid->wait); | 2050 | init_waitqueue_head(&hid->wait); |
2021 | 2051 | ||
2022 | INIT_WORK(&hid->reset_work, hid_reset, hid); | 2052 | INIT_WORK(&hid->reset_work, hid_reset); |
2023 | setup_timer(&hid->io_retry, hid_retry_timeout, (unsigned long) hid); | 2053 | setup_timer(&hid->io_retry, hid_retry_timeout, (unsigned long) hid); |
2024 | 2054 | ||
2025 | spin_lock_init(&hid->inlock); | 2055 | spin_lock_init(&hid->inlock); |
@@ -2071,13 +2101,9 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) | |||
2071 | return hid; | 2101 | return hid; |
2072 | 2102 | ||
2073 | fail: | 2103 | fail: |
2074 | 2104 | usb_free_urb(hid->urbin); | |
2075 | if (hid->urbin) | 2105 | usb_free_urb(hid->urbout); |
2076 | usb_free_urb(hid->urbin); | 2106 | usb_free_urb(hid->urbctrl); |
2077 | if (hid->urbout) | ||
2078 | usb_free_urb(hid->urbout); | ||
2079 | if (hid->urbctrl) | ||
2080 | usb_free_urb(hid->urbctrl); | ||
2081 | hid_free_buffers(dev, hid); | 2107 | hid_free_buffers(dev, hid); |
2082 | hid_free_device(hid); | 2108 | hid_free_device(hid); |
2083 | 2109 | ||
@@ -2108,8 +2134,7 @@ static void hid_disconnect(struct usb_interface *intf) | |||
2108 | 2134 | ||
2109 | usb_free_urb(hid->urbin); | 2135 | usb_free_urb(hid->urbin); |
2110 | usb_free_urb(hid->urbctrl); | 2136 | usb_free_urb(hid->urbctrl); |
2111 | if (hid->urbout) | 2137 | usb_free_urb(hid->urbout); |
2112 | usb_free_urb(hid->urbout); | ||
2113 | 2138 | ||
2114 | hid_free_buffers(hid->dev, hid); | 2139 | hid_free_buffers(hid->dev, hid); |
2115 | hid_free_device(hid); | 2140 | hid_free_device(hid); |
diff --git a/drivers/usb/input/hid-input.c b/drivers/usb/input/hid-input.c index c8ce65c70a42..3a7e5fbff025 100644 --- a/drivers/usb/input/hid-input.c +++ b/drivers/usb/input/hid-input.c | |||
@@ -121,6 +121,12 @@ static struct hidinput_key_translation powerbook_numlock_keys[] = { | |||
121 | { } | 121 | { } |
122 | }; | 122 | }; |
123 | 123 | ||
124 | static struct hidinput_key_translation powerbook_iso_keyboard[] = { | ||
125 | { KEY_GRAVE, KEY_102ND }, | ||
126 | { KEY_102ND, KEY_GRAVE }, | ||
127 | { } | ||
128 | }; | ||
129 | |||
124 | static int usbhid_pb_fnmode = 1; | 130 | static int usbhid_pb_fnmode = 1; |
125 | module_param_named(pb_fnmode, usbhid_pb_fnmode, int, 0644); | 131 | module_param_named(pb_fnmode, usbhid_pb_fnmode, int, 0644); |
126 | MODULE_PARM_DESC(pb_fnmode, | 132 | MODULE_PARM_DESC(pb_fnmode, |
@@ -195,6 +201,14 @@ static int hidinput_pb_event(struct hid_device *hid, struct input_dev *input, | |||
195 | } | 201 | } |
196 | } | 202 | } |
197 | 203 | ||
204 | if (hid->quirks & HID_QUIRK_POWERBOOK_ISO_KEYBOARD) { | ||
205 | trans = find_translation(powerbook_iso_keyboard, usage->code); | ||
206 | if (trans) { | ||
207 | input_event(input, usage->type, trans->to, value); | ||
208 | return 1; | ||
209 | } | ||
210 | } | ||
211 | |||
198 | return 0; | 212 | return 0; |
199 | } | 213 | } |
200 | 214 | ||
@@ -210,6 +224,9 @@ static void hidinput_pb_setup(struct input_dev *input) | |||
210 | 224 | ||
211 | for (trans = powerbook_numlock_keys; trans->from; trans++) | 225 | for (trans = powerbook_numlock_keys; trans->from; trans++) |
212 | set_bit(trans->to, input->keybit); | 226 | set_bit(trans->to, input->keybit); |
227 | |||
228 | for (trans = powerbook_iso_keyboard; trans->from; trans++) | ||
229 | set_bit(trans->to, input->keybit); | ||
213 | } | 230 | } |
214 | #else | 231 | #else |
215 | static inline int hidinput_pb_event(struct hid_device *hid, struct input_dev *input, | 232 | static inline int hidinput_pb_event(struct hid_device *hid, struct input_dev *input, |
diff --git a/drivers/usb/input/hid.h b/drivers/usb/input/hid.h index 8aa9ec08e8ab..76ad68d9edfd 100644 --- a/drivers/usb/input/hid.h +++ b/drivers/usb/input/hid.h | |||
@@ -260,7 +260,8 @@ struct hid_item { | |||
260 | #define HID_QUIRK_POWERBOOK_HAS_FN 0x00001000 | 260 | #define HID_QUIRK_POWERBOOK_HAS_FN 0x00001000 |
261 | #define HID_QUIRK_POWERBOOK_FN_ON 0x00002000 | 261 | #define HID_QUIRK_POWERBOOK_FN_ON 0x00002000 |
262 | #define HID_QUIRK_INVERT_HWHEEL 0x00004000 | 262 | #define HID_QUIRK_INVERT_HWHEEL 0x00004000 |
263 | #define HID_QUIRK_BAD_RELATIVE_KEYS 0x00008000 | 263 | #define HID_QUIRK_POWERBOOK_ISO_KEYBOARD 0x00008000 |
264 | #define HID_QUIRK_BAD_RELATIVE_KEYS 0x00010000 | ||
264 | 265 | ||
265 | /* | 266 | /* |
266 | * This is the global environment of the parser. This information is | 267 | * This is the global environment of the parser. This information is |
@@ -385,6 +386,7 @@ struct hid_control_fifo { | |||
385 | #define HID_IN_RUNNING 3 | 386 | #define HID_IN_RUNNING 3 |
386 | #define HID_RESET_PENDING 4 | 387 | #define HID_RESET_PENDING 4 |
387 | #define HID_SUSPENDED 5 | 388 | #define HID_SUSPENDED 5 |
389 | #define HID_CLEAR_HALT 6 | ||
388 | 390 | ||
389 | struct hid_input { | 391 | struct hid_input { |
390 | struct list_head list; | 392 | struct list_head list; |
diff --git a/drivers/usb/input/keyspan_remote.c b/drivers/usb/input/keyspan_remote.c index 50aa8108a50b..98bd323369c7 100644 --- a/drivers/usb/input/keyspan_remote.c +++ b/drivers/usb/input/keyspan_remote.c | |||
@@ -456,7 +456,7 @@ static int keyspan_probe(struct usb_interface *interface, const struct usb_devic | |||
456 | remote->in_endpoint = endpoint; | 456 | remote->in_endpoint = endpoint; |
457 | remote->toggle = -1; /* Set to -1 so we will always not match the toggle from the first remote message. */ | 457 | remote->toggle = -1; /* Set to -1 so we will always not match the toggle from the first remote message. */ |
458 | 458 | ||
459 | remote->in_buffer = usb_buffer_alloc(udev, RECV_SIZE, SLAB_ATOMIC, &remote->in_dma); | 459 | remote->in_buffer = usb_buffer_alloc(udev, RECV_SIZE, GFP_ATOMIC, &remote->in_dma); |
460 | if (!remote->in_buffer) { | 460 | if (!remote->in_buffer) { |
461 | retval = -ENOMEM; | 461 | retval = -ENOMEM; |
462 | goto fail1; | 462 | goto fail1; |
diff --git a/drivers/usb/input/mtouchusb.c b/drivers/usb/input/mtouchusb.c index 79a85d46cb13..92c4e07da4c8 100644 --- a/drivers/usb/input/mtouchusb.c +++ b/drivers/usb/input/mtouchusb.c | |||
@@ -164,7 +164,7 @@ static int mtouchusb_alloc_buffers(struct usb_device *udev, struct mtouch_usb *m | |||
164 | dbg("%s - called", __FUNCTION__); | 164 | dbg("%s - called", __FUNCTION__); |
165 | 165 | ||
166 | mtouch->data = usb_buffer_alloc(udev, MTOUCHUSB_REPORT_DATA_SIZE, | 166 | mtouch->data = usb_buffer_alloc(udev, MTOUCHUSB_REPORT_DATA_SIZE, |
167 | SLAB_ATOMIC, &mtouch->data_dma); | 167 | GFP_ATOMIC, &mtouch->data_dma); |
168 | 168 | ||
169 | if (!mtouch->data) | 169 | if (!mtouch->data) |
170 | return -1; | 170 | return -1; |
diff --git a/drivers/usb/input/powermate.c b/drivers/usb/input/powermate.c index 0bf91778c40d..fea97e5437f8 100644 --- a/drivers/usb/input/powermate.c +++ b/drivers/usb/input/powermate.c | |||
@@ -277,12 +277,12 @@ static int powermate_input_event(struct input_dev *dev, unsigned int type, unsig | |||
277 | static int powermate_alloc_buffers(struct usb_device *udev, struct powermate_device *pm) | 277 | static int powermate_alloc_buffers(struct usb_device *udev, struct powermate_device *pm) |
278 | { | 278 | { |
279 | pm->data = usb_buffer_alloc(udev, POWERMATE_PAYLOAD_SIZE_MAX, | 279 | pm->data = usb_buffer_alloc(udev, POWERMATE_PAYLOAD_SIZE_MAX, |
280 | SLAB_ATOMIC, &pm->data_dma); | 280 | GFP_ATOMIC, &pm->data_dma); |
281 | if (!pm->data) | 281 | if (!pm->data) |
282 | return -1; | 282 | return -1; |
283 | 283 | ||
284 | pm->configcr = usb_buffer_alloc(udev, sizeof(*(pm->configcr)), | 284 | pm->configcr = usb_buffer_alloc(udev, sizeof(*(pm->configcr)), |
285 | SLAB_ATOMIC, &pm->configcr_dma); | 285 | GFP_ATOMIC, &pm->configcr_dma); |
286 | if (!pm->configcr) | 286 | if (!pm->configcr) |
287 | return -1; | 287 | return -1; |
288 | 288 | ||
diff --git a/drivers/usb/input/touchkitusb.c b/drivers/usb/input/touchkitusb.c index 05c0d1ca39ab..2a314b065922 100644 --- a/drivers/usb/input/touchkitusb.c +++ b/drivers/usb/input/touchkitusb.c | |||
@@ -248,7 +248,7 @@ static int touchkit_alloc_buffers(struct usb_device *udev, | |||
248 | struct touchkit_usb *touchkit) | 248 | struct touchkit_usb *touchkit) |
249 | { | 249 | { |
250 | touchkit->data = usb_buffer_alloc(udev, TOUCHKIT_REPORT_DATA_SIZE, | 250 | touchkit->data = usb_buffer_alloc(udev, TOUCHKIT_REPORT_DATA_SIZE, |
251 | SLAB_ATOMIC, &touchkit->data_dma); | 251 | GFP_ATOMIC, &touchkit->data_dma); |
252 | 252 | ||
253 | if (!touchkit->data) | 253 | if (!touchkit->data) |
254 | return -1; | 254 | return -1; |
diff --git a/drivers/usb/input/usbkbd.c b/drivers/usb/input/usbkbd.c index c73285cf8558..8505824848f6 100644 --- a/drivers/usb/input/usbkbd.c +++ b/drivers/usb/input/usbkbd.c | |||
@@ -122,7 +122,7 @@ static void usb_kbd_irq(struct urb *urb) | |||
122 | memcpy(kbd->old, kbd->new, 8); | 122 | memcpy(kbd->old, kbd->new, 8); |
123 | 123 | ||
124 | resubmit: | 124 | resubmit: |
125 | i = usb_submit_urb (urb, SLAB_ATOMIC); | 125 | i = usb_submit_urb (urb, GFP_ATOMIC); |
126 | if (i) | 126 | if (i) |
127 | err ("can't resubmit intr, %s-%s/input0, status %d", | 127 | err ("can't resubmit intr, %s-%s/input0, status %d", |
128 | kbd->usbdev->bus->bus_name, | 128 | kbd->usbdev->bus->bus_name, |
@@ -196,11 +196,11 @@ static int usb_kbd_alloc_mem(struct usb_device *dev, struct usb_kbd *kbd) | |||
196 | return -1; | 196 | return -1; |
197 | if (!(kbd->led = usb_alloc_urb(0, GFP_KERNEL))) | 197 | if (!(kbd->led = usb_alloc_urb(0, GFP_KERNEL))) |
198 | return -1; | 198 | return -1; |
199 | if (!(kbd->new = usb_buffer_alloc(dev, 8, SLAB_ATOMIC, &kbd->new_dma))) | 199 | if (!(kbd->new = usb_buffer_alloc(dev, 8, GFP_ATOMIC, &kbd->new_dma))) |
200 | return -1; | 200 | return -1; |
201 | if (!(kbd->cr = usb_buffer_alloc(dev, sizeof(struct usb_ctrlrequest), SLAB_ATOMIC, &kbd->cr_dma))) | 201 | if (!(kbd->cr = usb_buffer_alloc(dev, sizeof(struct usb_ctrlrequest), GFP_ATOMIC, &kbd->cr_dma))) |
202 | return -1; | 202 | return -1; |
203 | if (!(kbd->leds = usb_buffer_alloc(dev, 1, SLAB_ATOMIC, &kbd->leds_dma))) | 203 | if (!(kbd->leds = usb_buffer_alloc(dev, 1, GFP_ATOMIC, &kbd->leds_dma))) |
204 | return -1; | 204 | return -1; |
205 | 205 | ||
206 | return 0; | 206 | return 0; |
@@ -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..64a33e420cfb 100644 --- a/drivers/usb/input/usbmouse.c +++ b/drivers/usb/input/usbmouse.c | |||
@@ -86,7 +86,7 @@ static void usb_mouse_irq(struct urb *urb) | |||
86 | 86 | ||
87 | input_sync(dev); | 87 | input_sync(dev); |
88 | resubmit: | 88 | resubmit: |
89 | status = usb_submit_urb (urb, SLAB_ATOMIC); | 89 | status = usb_submit_urb (urb, GFP_ATOMIC); |
90 | if (status) | 90 | if (status) |
91 | err ("can't resubmit intr, %s-%s/input0, status %d", | 91 | err ("can't resubmit intr, %s-%s/input0, status %d", |
92 | mouse->usbdev->bus->bus_name, | 92 | mouse->usbdev->bus->bus_name, |
@@ -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); |
@@ -139,7 +137,7 @@ static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_i | |||
139 | if (!mouse || !input_dev) | 137 | if (!mouse || !input_dev) |
140 | goto fail1; | 138 | goto fail1; |
141 | 139 | ||
142 | mouse->data = usb_buffer_alloc(dev, 8, SLAB_ATOMIC, &mouse->data_dma); | 140 | mouse->data = usb_buffer_alloc(dev, 8, GFP_ATOMIC, &mouse->data_dma); |
143 | if (!mouse->data) | 141 | if (!mouse->data) |
144 | goto fail1; | 142 | goto fail1; |
145 | 143 | ||
diff --git a/drivers/usb/input/usbtouchscreen.c b/drivers/usb/input/usbtouchscreen.c index 933ceddf3dee..7f3c57da9bc0 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 | ||
@@ -586,7 +680,7 @@ static int usbtouch_probe(struct usb_interface *intf, | |||
586 | type->process_pkt = usbtouch_process_pkt; | 680 | type->process_pkt = usbtouch_process_pkt; |
587 | 681 | ||
588 | usbtouch->data = usb_buffer_alloc(udev, type->rept_size, | 682 | usbtouch->data = usb_buffer_alloc(udev, type->rept_size, |
589 | SLAB_KERNEL, &usbtouch->data_dma); | 683 | GFP_KERNEL, &usbtouch->data_dma); |
590 | if (!usbtouch->data) | 684 | if (!usbtouch->data) |
591 | goto out_free; | 685 | goto out_free; |
592 | 686 | ||
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/xpad.c b/drivers/usb/input/xpad.c index df97e5c803f9..e4bc76ebc835 100644 --- a/drivers/usb/input/xpad.c +++ b/drivers/usb/input/xpad.c | |||
@@ -325,7 +325,7 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id | |||
325 | goto fail1; | 325 | goto fail1; |
326 | 326 | ||
327 | xpad->idata = usb_buffer_alloc(udev, XPAD_PKT_LEN, | 327 | xpad->idata = usb_buffer_alloc(udev, XPAD_PKT_LEN, |
328 | SLAB_ATOMIC, &xpad->idata_dma); | 328 | GFP_ATOMIC, &xpad->idata_dma); |
329 | if (!xpad->idata) | 329 | if (!xpad->idata) |
330 | goto fail1; | 330 | goto fail1; |
331 | 331 | ||
diff --git a/drivers/usb/input/yealink.c b/drivers/usb/input/yealink.c index 905bf6398257..caff8e6d7448 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) |
@@ -876,17 +874,17 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
876 | 874 | ||
877 | /* allocate usb buffers */ | 875 | /* allocate usb buffers */ |
878 | yld->irq_data = usb_buffer_alloc(udev, USB_PKT_LEN, | 876 | yld->irq_data = usb_buffer_alloc(udev, USB_PKT_LEN, |
879 | SLAB_ATOMIC, &yld->irq_dma); | 877 | GFP_ATOMIC, &yld->irq_dma); |
880 | if (yld->irq_data == NULL) | 878 | if (yld->irq_data == NULL) |
881 | return usb_cleanup(yld, -ENOMEM); | 879 | return usb_cleanup(yld, -ENOMEM); |
882 | 880 | ||
883 | yld->ctl_data = usb_buffer_alloc(udev, USB_PKT_LEN, | 881 | yld->ctl_data = usb_buffer_alloc(udev, USB_PKT_LEN, |
884 | SLAB_ATOMIC, &yld->ctl_dma); | 882 | GFP_ATOMIC, &yld->ctl_dma); |
885 | if (!yld->ctl_data) | 883 | if (!yld->ctl_data) |
886 | return usb_cleanup(yld, -ENOMEM); | 884 | return usb_cleanup(yld, -ENOMEM); |
887 | 885 | ||
888 | yld->ctl_req = usb_buffer_alloc(udev, sizeof(*(yld->ctl_req)), | 886 | yld->ctl_req = usb_buffer_alloc(udev, sizeof(*(yld->ctl_req)), |
889 | SLAB_ATOMIC, &yld->ctl_req_dma); | 887 | GFP_ATOMIC, &yld->ctl_req_dma); |
890 | if (yld->ctl_req == NULL) | 888 | if (yld->ctl_req == NULL) |
891 | return usb_cleanup(yld, -ENOMEM); | 889 | return usb_cleanup(yld, -ENOMEM); |
892 | 890 | ||