diff options
Diffstat (limited to 'drivers/usb')
38 files changed, 679 insertions, 209 deletions
diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig index cd329dd7fb86..85dacc92545a 100644 --- a/drivers/usb/Kconfig +++ b/drivers/usb/Kconfig | |||
@@ -20,6 +20,7 @@ config USB_ARCH_HAS_OHCI | |||
20 | default y if SA1111 | 20 | default y if SA1111 |
21 | default y if ARCH_OMAP | 21 | default y if ARCH_OMAP |
22 | default y if ARCH_LH7A404 | 22 | default y if ARCH_LH7A404 |
23 | default y if ARCH_S3C2410 | ||
23 | default y if PXA27x | 24 | default y if PXA27x |
24 | # PPC: | 25 | # PPC: |
25 | default y if STB03xxx | 26 | default y if STB03xxx |
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index adff5a77e31f..16ecad30e29c 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -980,6 +980,9 @@ static struct usb_device_id acm_ids[] = { | |||
980 | { USB_DEVICE(0x0870, 0x0001), /* Metricom GS Modem */ | 980 | { USB_DEVICE(0x0870, 0x0001), /* Metricom GS Modem */ |
981 | .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ | 981 | .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ |
982 | }, | 982 | }, |
983 | { USB_DEVICE(0x0482, 0x0203), /* KYOCERA AH-K3001V */ | ||
984 | .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ | ||
985 | }, | ||
983 | /* control interfaces with various AT-command sets */ | 986 | /* control interfaces with various AT-command sets */ |
984 | { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM, | 987 | { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM, |
985 | USB_CDC_ACM_PROTO_AT_V25TER) }, | 988 | USB_CDC_ACM_PROTO_AT_V25TER) }, |
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 787c27a63c51..f86bf1454e21 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c | |||
@@ -569,8 +569,11 @@ static int proc_control(struct dev_state *ps, void __user *arg) | |||
569 | free_page((unsigned long)tbuf); | 569 | free_page((unsigned long)tbuf); |
570 | return -EINVAL; | 570 | return -EINVAL; |
571 | } | 571 | } |
572 | snoop(&dev->dev, "control read: bRequest=%02x bRrequestType=%02x wValue=%04x wIndex=%04x\n", | 572 | snoop(&dev->dev, "control read: bRequest=%02x " |
573 | ctrl.bRequest, ctrl.bRequestType, ctrl.wValue, ctrl.wIndex); | 573 | "bRrequestType=%02x wValue=%04x " |
574 | "wIndex=%04x wLength=%04x\n", | ||
575 | ctrl.bRequest, ctrl.bRequestType, ctrl.wValue, | ||
576 | ctrl.wIndex, ctrl.wLength); | ||
574 | 577 | ||
575 | usb_unlock_device(dev); | 578 | usb_unlock_device(dev); |
576 | i = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), ctrl.bRequest, ctrl.bRequestType, | 579 | i = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), ctrl.bRequest, ctrl.bRequestType, |
@@ -579,11 +582,11 @@ static int proc_control(struct dev_state *ps, void __user *arg) | |||
579 | if ((i > 0) && ctrl.wLength) { | 582 | if ((i > 0) && ctrl.wLength) { |
580 | if (usbfs_snoop) { | 583 | if (usbfs_snoop) { |
581 | dev_info(&dev->dev, "control read: data "); | 584 | dev_info(&dev->dev, "control read: data "); |
582 | for (j = 0; j < ctrl.wLength; ++j) | 585 | for (j = 0; j < i; ++j) |
583 | printk ("%02x ", (unsigned char)(tbuf)[j]); | 586 | printk ("%02x ", (unsigned char)(tbuf)[j]); |
584 | printk("\n"); | 587 | printk("\n"); |
585 | } | 588 | } |
586 | if (copy_to_user(ctrl.data, tbuf, ctrl.wLength)) { | 589 | if (copy_to_user(ctrl.data, tbuf, i)) { |
587 | free_page((unsigned long)tbuf); | 590 | free_page((unsigned long)tbuf); |
588 | return -EFAULT; | 591 | return -EFAULT; |
589 | } | 592 | } |
@@ -595,8 +598,11 @@ static int proc_control(struct dev_state *ps, void __user *arg) | |||
595 | return -EFAULT; | 598 | return -EFAULT; |
596 | } | 599 | } |
597 | } | 600 | } |
598 | snoop(&dev->dev, "control write: bRequest=%02x bRrequestType=%02x wValue=%04x wIndex=%04x\n", | 601 | snoop(&dev->dev, "control write: bRequest=%02x " |
599 | ctrl.bRequest, ctrl.bRequestType, ctrl.wValue, ctrl.wIndex); | 602 | "bRrequestType=%02x wValue=%04x " |
603 | "wIndex=%04x wLength=%04x\n", | ||
604 | ctrl.bRequest, ctrl.bRequestType, ctrl.wValue, | ||
605 | ctrl.wIndex, ctrl.wLength); | ||
600 | if (usbfs_snoop) { | 606 | if (usbfs_snoop) { |
601 | dev_info(&dev->dev, "control write: data: "); | 607 | dev_info(&dev->dev, "control write: data: "); |
602 | for (j = 0; j < ctrl.wLength; ++j) | 608 | for (j = 0; j < ctrl.wLength; ++j) |
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 8616356f55e8..79422a3b07bc 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
@@ -939,9 +939,9 @@ long usb_calc_bus_time (int speed, int is_input, int isoc, int bytecount) | |||
939 | case USB_SPEED_HIGH: /* ISOC or INTR */ | 939 | case USB_SPEED_HIGH: /* ISOC or INTR */ |
940 | // FIXME adjust for input vs output | 940 | // FIXME adjust for input vs output |
941 | if (isoc) | 941 | if (isoc) |
942 | tmp = HS_USECS (bytecount); | 942 | tmp = HS_NSECS_ISO (bytecount); |
943 | else | 943 | else |
944 | tmp = HS_USECS_ISO (bytecount); | 944 | tmp = HS_NSECS (bytecount); |
945 | return tmp; | 945 | return tmp; |
946 | default: | 946 | default: |
947 | pr_debug ("%s: bogus device speed!\n", usbcore_name); | 947 | pr_debug ("%s: bogus device speed!\n", usbcore_name); |
diff --git a/drivers/usb/core/hcd.h b/drivers/usb/core/hcd.h index 67db4a999b93..28055f95645b 100644 --- a/drivers/usb/core/hcd.h +++ b/drivers/usb/core/hcd.h | |||
@@ -334,17 +334,19 @@ extern void usb_release_bandwidth (struct usb_device *dev, struct urb *urb, | |||
334 | extern int usb_check_bandwidth (struct usb_device *dev, struct urb *urb); | 334 | extern int usb_check_bandwidth (struct usb_device *dev, struct urb *urb); |
335 | 335 | ||
336 | /* | 336 | /* |
337 | * Ceiling microseconds (typical) for that many bytes at high speed | 337 | * Ceiling [nano/micro]seconds (typical) for that many bytes at high speed |
338 | * ISO is a bit less, no ACK ... from USB 2.0 spec, 5.11.3 (and needed | 338 | * ISO is a bit less, no ACK ... from USB 2.0 spec, 5.11.3 (and needed |
339 | * to preallocate bandwidth) | 339 | * to preallocate bandwidth) |
340 | */ | 340 | */ |
341 | #define USB2_HOST_DELAY 5 /* nsec, guess */ | 341 | #define USB2_HOST_DELAY 5 /* nsec, guess */ |
342 | #define HS_USECS(bytes) NS_TO_US ( ((55 * 8 * 2083)/1000) \ | 342 | #define HS_NSECS(bytes) ( ((55 * 8 * 2083)/1000) \ |
343 | + ((2083UL * (3167 + BitTime (bytes)))/1000) \ | 343 | + ((2083UL * (3167 + BitTime (bytes)))/1000) \ |
344 | + USB2_HOST_DELAY) | 344 | + USB2_HOST_DELAY) |
345 | #define HS_USECS_ISO(bytes) NS_TO_US ( ((38 * 8 * 2083)/1000) \ | 345 | #define HS_NSECS_ISO(bytes) ( ((38 * 8 * 2083)/1000) \ |
346 | + ((2083UL * (3167 + BitTime (bytes)))/1000) \ | 346 | + ((2083UL * (3167 + BitTime (bytes)))/1000) \ |
347 | + USB2_HOST_DELAY) | 347 | + USB2_HOST_DELAY) |
348 | #define HS_USECS(bytes) NS_TO_US (HS_NSECS(bytes)) | ||
349 | #define HS_USECS_ISO(bytes) NS_TO_US (HS_NSECS_ISO(bytes)) | ||
348 | 350 | ||
349 | extern long usb_calc_bus_time (int speed, int is_input, | 351 | extern long usb_calc_bus_time (int speed, int is_input, |
350 | int isoc, int bytecount); | 352 | int isoc, int bytecount); |
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index a428ef479bd7..88d1b376f67c 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c | |||
@@ -985,8 +985,10 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0) | |||
985 | for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) { | 985 | for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) { |
986 | struct usb_interface *interface; | 986 | struct usb_interface *interface; |
987 | 987 | ||
988 | /* remove this interface */ | 988 | /* remove this interface if it has been registered */ |
989 | interface = dev->actconfig->interface[i]; | 989 | interface = dev->actconfig->interface[i]; |
990 | if (!klist_node_attached(&interface->dev.knode_bus)) | ||
991 | continue; | ||
990 | dev_dbg (&dev->dev, "unregistering interface %s\n", | 992 | dev_dbg (&dev->dev, "unregistering interface %s\n", |
991 | interface->dev.bus_id); | 993 | interface->dev.bus_id); |
992 | usb_remove_sysfs_intf_files(interface); | 994 | usb_remove_sysfs_intf_files(interface); |
@@ -1439,7 +1441,7 @@ free_interfaces: | |||
1439 | } | 1441 | } |
1440 | } | 1442 | } |
1441 | 1443 | ||
1442 | return ret; | 1444 | return 0; |
1443 | } | 1445 | } |
1444 | 1446 | ||
1445 | // synchronous request completion model | 1447 | // synchronous request completion model |
diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c index 50cb01831075..b01efb6b36f6 100644 --- a/drivers/usb/host/ehci-dbg.c +++ b/drivers/usb/host/ehci-dbg.c | |||
@@ -527,7 +527,7 @@ show_periodic (struct class_device *class_dev, char *buf) | |||
527 | p.qh->period, | 527 | p.qh->period, |
528 | le32_to_cpup (&p.qh->hw_info2) | 528 | le32_to_cpup (&p.qh->hw_info2) |
529 | /* uframe masks */ | 529 | /* uframe masks */ |
530 | & 0xffff, | 530 | & (QH_CMASK | QH_SMASK), |
531 | p.qh); | 531 | p.qh); |
532 | size -= temp; | 532 | size -= temp; |
533 | next += temp; | 533 | next += temp; |
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c index d74b2d68a50e..20df01a79b2e 100644 --- a/drivers/usb/host/ehci-q.c +++ b/drivers/usb/host/ehci-q.c | |||
@@ -222,7 +222,7 @@ __acquires(ehci->lock) | |||
222 | struct ehci_qh *qh = (struct ehci_qh *) urb->hcpriv; | 222 | struct ehci_qh *qh = (struct ehci_qh *) urb->hcpriv; |
223 | 223 | ||
224 | /* S-mask in a QH means it's an interrupt urb */ | 224 | /* S-mask in a QH means it's an interrupt urb */ |
225 | if ((qh->hw_info2 & __constant_cpu_to_le32 (0x00ff)) != 0) { | 225 | if ((qh->hw_info2 & __constant_cpu_to_le32 (QH_SMASK)) != 0) { |
226 | 226 | ||
227 | /* ... update hc-wide periodic stats (for usbfs) */ | 227 | /* ... update hc-wide periodic stats (for usbfs) */ |
228 | ehci_to_hcd(ehci)->self.bandwidth_int_reqs--; | 228 | ehci_to_hcd(ehci)->self.bandwidth_int_reqs--; |
@@ -428,7 +428,8 @@ halt: | |||
428 | /* should be rare for periodic transfers, | 428 | /* should be rare for periodic transfers, |
429 | * except maybe high bandwidth ... | 429 | * except maybe high bandwidth ... |
430 | */ | 430 | */ |
431 | if (qh->period) { | 431 | if ((__constant_cpu_to_le32 (QH_SMASK) |
432 | & qh->hw_info2) != 0) { | ||
432 | intr_deschedule (ehci, qh); | 433 | intr_deschedule (ehci, qh); |
433 | (void) qh_schedule (ehci, qh); | 434 | (void) qh_schedule (ehci, qh); |
434 | } else | 435 | } else |
@@ -657,8 +658,8 @@ qh_make ( | |||
657 | * For control/bulk requests, the HC or TT handles these. | 658 | * For control/bulk requests, the HC or TT handles these. |
658 | */ | 659 | */ |
659 | if (type == PIPE_INTERRUPT) { | 660 | if (type == PIPE_INTERRUPT) { |
660 | qh->usecs = usb_calc_bus_time (USB_SPEED_HIGH, is_input, 0, | 661 | qh->usecs = NS_TO_US (usb_calc_bus_time (USB_SPEED_HIGH, is_input, 0, |
661 | hb_mult (maxp) * max_packet (maxp)); | 662 | hb_mult (maxp) * max_packet (maxp))); |
662 | qh->start = NO_FRAME; | 663 | qh->start = NO_FRAME; |
663 | 664 | ||
664 | if (urb->dev->speed == USB_SPEED_HIGH) { | 665 | if (urb->dev->speed == USB_SPEED_HIGH) { |
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index 9af4f64532a9..b56f25864ed6 100644 --- a/drivers/usb/host/ehci-sched.c +++ b/drivers/usb/host/ehci-sched.c | |||
@@ -301,7 +301,7 @@ static int qh_link_periodic (struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
301 | 301 | ||
302 | dev_dbg (&qh->dev->dev, | 302 | dev_dbg (&qh->dev->dev, |
303 | "link qh%d-%04x/%p start %d [%d/%d us]\n", | 303 | "link qh%d-%04x/%p start %d [%d/%d us]\n", |
304 | period, le32_to_cpup (&qh->hw_info2) & 0xffff, | 304 | period, le32_to_cpup (&qh->hw_info2) & (QH_CMASK | QH_SMASK), |
305 | qh, qh->start, qh->usecs, qh->c_usecs); | 305 | qh, qh->start, qh->usecs, qh->c_usecs); |
306 | 306 | ||
307 | /* high bandwidth, or otherwise every microframe */ | 307 | /* high bandwidth, or otherwise every microframe */ |
@@ -385,7 +385,8 @@ static void qh_unlink_periodic (struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
385 | 385 | ||
386 | dev_dbg (&qh->dev->dev, | 386 | dev_dbg (&qh->dev->dev, |
387 | "unlink qh%d-%04x/%p start %d [%d/%d us]\n", | 387 | "unlink qh%d-%04x/%p start %d [%d/%d us]\n", |
388 | qh->period, le32_to_cpup (&qh->hw_info2) & 0xffff, | 388 | qh->period, |
389 | le32_to_cpup (&qh->hw_info2) & (QH_CMASK | QH_SMASK), | ||
389 | qh, qh->start, qh->usecs, qh->c_usecs); | 390 | qh, qh->start, qh->usecs, qh->c_usecs); |
390 | 391 | ||
391 | /* qh->qh_next still "live" to HC */ | 392 | /* qh->qh_next still "live" to HC */ |
@@ -411,7 +412,7 @@ static void intr_deschedule (struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
411 | * active high speed queues may need bigger delays... | 412 | * active high speed queues may need bigger delays... |
412 | */ | 413 | */ |
413 | if (list_empty (&qh->qtd_list) | 414 | if (list_empty (&qh->qtd_list) |
414 | || (__constant_cpu_to_le32 (0x0ff << 8) | 415 | || (__constant_cpu_to_le32 (QH_CMASK) |
415 | & qh->hw_info2) != 0) | 416 | & qh->hw_info2) != 0) |
416 | wait = 2; | 417 | wait = 2; |
417 | else | 418 | else |
@@ -533,7 +534,7 @@ static int qh_schedule (struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
533 | 534 | ||
534 | /* reuse the previous schedule slots, if we can */ | 535 | /* reuse the previous schedule slots, if we can */ |
535 | if (frame < qh->period) { | 536 | if (frame < qh->period) { |
536 | uframe = ffs (le32_to_cpup (&qh->hw_info2) & 0x00ff); | 537 | uframe = ffs (le32_to_cpup (&qh->hw_info2) & QH_SMASK); |
537 | status = check_intr_schedule (ehci, frame, --uframe, | 538 | status = check_intr_schedule (ehci, frame, --uframe, |
538 | qh, &c_mask); | 539 | qh, &c_mask); |
539 | } else { | 540 | } else { |
@@ -569,10 +570,10 @@ static int qh_schedule (struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
569 | qh->start = frame; | 570 | qh->start = frame; |
570 | 571 | ||
571 | /* reset S-frame and (maybe) C-frame masks */ | 572 | /* reset S-frame and (maybe) C-frame masks */ |
572 | qh->hw_info2 &= __constant_cpu_to_le32 (~0xffff); | 573 | qh->hw_info2 &= __constant_cpu_to_le32(~(QH_CMASK | QH_SMASK)); |
573 | qh->hw_info2 |= qh->period | 574 | qh->hw_info2 |= qh->period |
574 | ? cpu_to_le32 (1 << uframe) | 575 | ? cpu_to_le32 (1 << uframe) |
575 | : __constant_cpu_to_le32 (0xff); | 576 | : __constant_cpu_to_le32 (QH_SMASK); |
576 | qh->hw_info2 |= c_mask; | 577 | qh->hw_info2 |= c_mask; |
577 | } else | 578 | } else |
578 | ehci_dbg (ehci, "reused qh %p schedule\n", qh); | 579 | ehci_dbg (ehci, "reused qh %p schedule\n", qh); |
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index 4df498231752..a7542157534c 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h | |||
@@ -385,6 +385,11 @@ struct ehci_qh { | |||
385 | __le32 hw_info1; /* see EHCI 3.6.2 */ | 385 | __le32 hw_info1; /* see EHCI 3.6.2 */ |
386 | #define QH_HEAD 0x00008000 | 386 | #define QH_HEAD 0x00008000 |
387 | __le32 hw_info2; /* see EHCI 3.6.2 */ | 387 | __le32 hw_info2; /* see EHCI 3.6.2 */ |
388 | #define QH_SMASK 0x000000ff | ||
389 | #define QH_CMASK 0x0000ff00 | ||
390 | #define QH_HUBADDR 0x007f0000 | ||
391 | #define QH_HUBPORT 0x3f800000 | ||
392 | #define QH_MULT 0xc0000000 | ||
388 | __le32 hw_current; /* qtd list - see EHCI 3.6.4 */ | 393 | __le32 hw_current; /* qtd list - see EHCI 3.6.4 */ |
389 | 394 | ||
390 | /* qtd overlay (hardware parts of a struct ehci_qtd) */ | 395 | /* qtd overlay (hardware parts of a struct ehci_qtd) */ |
diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c index 50b1970fe6b6..76cb496c5836 100644 --- a/drivers/usb/host/isp116x-hcd.c +++ b/drivers/usb/host/isp116x-hcd.c | |||
@@ -229,9 +229,11 @@ static void preproc_atl_queue(struct isp116x *isp116x) | |||
229 | struct isp116x_ep *ep; | 229 | struct isp116x_ep *ep; |
230 | struct urb *urb; | 230 | struct urb *urb; |
231 | struct ptd *ptd; | 231 | struct ptd *ptd; |
232 | u16 toggle = 0, dir = PTD_DIR_SETUP, len; | 232 | u16 len; |
233 | 233 | ||
234 | for (ep = isp116x->atl_active; ep; ep = ep->active) { | 234 | for (ep = isp116x->atl_active; ep; ep = ep->active) { |
235 | u16 toggle = 0, dir = PTD_DIR_SETUP; | ||
236 | |||
235 | BUG_ON(list_empty(&ep->hep->urb_list)); | 237 | BUG_ON(list_empty(&ep->hep->urb_list)); |
236 | urb = container_of(ep->hep->urb_list.next, | 238 | urb = container_of(ep->hep->urb_list.next, |
237 | struct urb, urb_list); | 239 | struct urb, urb_list); |
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index 68decab280dd..56b43f2a0e52 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c | |||
@@ -887,6 +887,10 @@ MODULE_LICENSE ("GPL"); | |||
887 | #include "ohci-sa1111.c" | 887 | #include "ohci-sa1111.c" |
888 | #endif | 888 | #endif |
889 | 889 | ||
890 | #ifdef CONFIG_ARCH_S3C2410 | ||
891 | #include "ohci-s3c2410.c" | ||
892 | #endif | ||
893 | |||
890 | #ifdef CONFIG_ARCH_OMAP | 894 | #ifdef CONFIG_ARCH_OMAP |
891 | #include "ohci-omap.c" | 895 | #include "ohci-omap.c" |
892 | #endif | 896 | #endif |
@@ -909,6 +913,7 @@ MODULE_LICENSE ("GPL"); | |||
909 | 913 | ||
910 | #if !(defined(CONFIG_PCI) \ | 914 | #if !(defined(CONFIG_PCI) \ |
911 | || defined(CONFIG_SA1111) \ | 915 | || defined(CONFIG_SA1111) \ |
916 | || defined(CONFIG_ARCH_S3C2410) \ | ||
912 | || defined(CONFIG_ARCH_OMAP) \ | 917 | || defined(CONFIG_ARCH_OMAP) \ |
913 | || defined (CONFIG_ARCH_LH7A404) \ | 918 | || defined (CONFIG_ARCH_LH7A404) \ |
914 | || defined (CONFIG_PXA27x) \ | 919 | || defined (CONFIG_PXA27x) \ |
diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c new file mode 100644 index 000000000000..e9401662503c --- /dev/null +++ b/drivers/usb/host/ohci-s3c2410.c | |||
@@ -0,0 +1,496 @@ | |||
1 | /* | ||
2 | * OHCI HCD (Host Controller Driver) for USB. | ||
3 | * | ||
4 | * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at> | ||
5 | * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net> | ||
6 | * (C) Copyright 2002 Hewlett-Packard Company | ||
7 | * | ||
8 | * USB Bus Glue for Samsung S3C2410 | ||
9 | * | ||
10 | * Written by Christopher Hoover <ch@hpl.hp.com> | ||
11 | * Based on fragments of previous driver by Rusell King et al. | ||
12 | * | ||
13 | * Modified for S3C2410 from ohci-sa1111.c, ohci-omap.c and ohci-lh7a40.c | ||
14 | * by Ben Dooks, <ben@simtec.co.uk> | ||
15 | * Copyright (C) 2004 Simtec Electronics | ||
16 | * | ||
17 | * Thanks to basprog@mail.ru for updates to newer kernels | ||
18 | * | ||
19 | * This file is licenced under the GPL. | ||
20 | */ | ||
21 | |||
22 | #include <asm/hardware.h> | ||
23 | #include <asm/mach-types.h> | ||
24 | #include <asm/hardware/clock.h> | ||
25 | #include <asm/arch/usb-control.h> | ||
26 | |||
27 | #define valid_port(idx) ((idx) == 1 || (idx) == 2) | ||
28 | |||
29 | /* clock device associated with the hcd */ | ||
30 | |||
31 | static struct clk *clk; | ||
32 | |||
33 | /* forward definitions */ | ||
34 | |||
35 | static void s3c2410_hcd_oc(struct s3c2410_hcd_info *info, int port_oc); | ||
36 | |||
37 | /* conversion functions */ | ||
38 | |||
39 | struct s3c2410_hcd_info *to_s3c2410_info(struct usb_hcd *hcd) | ||
40 | { | ||
41 | return hcd->self.controller->platform_data; | ||
42 | } | ||
43 | |||
44 | static void s3c2410_start_hc(struct platform_device *dev, struct usb_hcd *hcd) | ||
45 | { | ||
46 | struct s3c2410_hcd_info *info = dev->dev.platform_data; | ||
47 | |||
48 | dev_dbg(&dev->dev, "s3c2410_start_hc:\n"); | ||
49 | clk_enable(clk); | ||
50 | |||
51 | if (info != NULL) { | ||
52 | info->hcd = hcd; | ||
53 | info->report_oc = s3c2410_hcd_oc; | ||
54 | |||
55 | if (info->enable_oc != NULL) { | ||
56 | (info->enable_oc)(info, 1); | ||
57 | } | ||
58 | } | ||
59 | } | ||
60 | |||
61 | static void s3c2410_stop_hc(struct platform_device *dev) | ||
62 | { | ||
63 | struct s3c2410_hcd_info *info = dev->dev.platform_data; | ||
64 | |||
65 | dev_dbg(&dev->dev, "s3c2410_stop_hc:\n"); | ||
66 | |||
67 | if (info != NULL) { | ||
68 | info->report_oc = NULL; | ||
69 | info->hcd = NULL; | ||
70 | |||
71 | if (info->enable_oc != NULL) { | ||
72 | (info->enable_oc)(info, 0); | ||
73 | } | ||
74 | } | ||
75 | |||
76 | clk_disable(clk); | ||
77 | } | ||
78 | |||
79 | /* ohci_s3c2410_hub_status_data | ||
80 | * | ||
81 | * update the status data from the hub with anything that | ||
82 | * has been detected by our system | ||
83 | */ | ||
84 | |||
85 | static int | ||
86 | ohci_s3c2410_hub_status_data (struct usb_hcd *hcd, char *buf) | ||
87 | { | ||
88 | struct s3c2410_hcd_info *info = to_s3c2410_info(hcd); | ||
89 | struct s3c2410_hcd_port *port; | ||
90 | int orig; | ||
91 | int portno; | ||
92 | |||
93 | orig = ohci_hub_status_data (hcd, buf); | ||
94 | |||
95 | if (info == NULL) | ||
96 | return orig; | ||
97 | |||
98 | port = &info->port[0]; | ||
99 | |||
100 | /* mark any changed port as changed */ | ||
101 | |||
102 | for (portno = 0; portno < 2; port++, portno++) { | ||
103 | if (port->oc_changed == 1 && | ||
104 | port->flags & S3C_HCDFLG_USED) { | ||
105 | dev_dbg(hcd->self.controller, | ||
106 | "oc change on port %d\n", portno); | ||
107 | |||
108 | if (orig < 1) | ||
109 | orig = 1; | ||
110 | |||
111 | buf[0] |= 1<<(portno+1); | ||
112 | } | ||
113 | } | ||
114 | |||
115 | return orig; | ||
116 | } | ||
117 | |||
118 | /* s3c2410_usb_set_power | ||
119 | * | ||
120 | * configure the power on a port, by calling the platform device | ||
121 | * routine registered with the platform device | ||
122 | */ | ||
123 | |||
124 | static void s3c2410_usb_set_power(struct s3c2410_hcd_info *info, | ||
125 | int port, int to) | ||
126 | { | ||
127 | if (info == NULL) | ||
128 | return; | ||
129 | |||
130 | if (info->power_control != NULL) { | ||
131 | info->port[port-1].power = to; | ||
132 | (info->power_control)(port, to); | ||
133 | } | ||
134 | } | ||
135 | |||
136 | /* ohci_s3c2410_hub_control | ||
137 | * | ||
138 | * look at control requests to the hub, and see if we need | ||
139 | * to take any action or over-ride the results from the | ||
140 | * request. | ||
141 | */ | ||
142 | |||
143 | static int ohci_s3c2410_hub_control ( | ||
144 | struct usb_hcd *hcd, | ||
145 | u16 typeReq, | ||
146 | u16 wValue, | ||
147 | u16 wIndex, | ||
148 | char *buf, | ||
149 | u16 wLength) | ||
150 | { | ||
151 | struct s3c2410_hcd_info *info = to_s3c2410_info(hcd); | ||
152 | struct usb_hub_descriptor *desc; | ||
153 | int ret = -EINVAL; | ||
154 | u32 *data = (u32 *)buf; | ||
155 | |||
156 | dev_dbg(hcd->self.controller, | ||
157 | "s3c2410_hub_control(%p,0x%04x,0x%04x,0x%04x,%p,%04x)\n", | ||
158 | hcd, typeReq, wValue, wIndex, buf, wLength); | ||
159 | |||
160 | /* if we are only an humble host without any special capabilites | ||
161 | * process the request straight away and exit */ | ||
162 | |||
163 | if (info == NULL) { | ||
164 | ret = ohci_hub_control(hcd, typeReq, wValue, | ||
165 | wIndex, buf, wLength); | ||
166 | goto out; | ||
167 | } | ||
168 | |||
169 | /* check the request to see if it needs handling */ | ||
170 | |||
171 | switch (typeReq) { | ||
172 | case SetPortFeature: | ||
173 | if (wValue == USB_PORT_FEAT_POWER) { | ||
174 | dev_dbg(hcd->self.controller, "SetPortFeat: POWER\n"); | ||
175 | s3c2410_usb_set_power(info, wIndex, 1); | ||
176 | goto out; | ||
177 | } | ||
178 | break; | ||
179 | |||
180 | case ClearPortFeature: | ||
181 | switch (wValue) { | ||
182 | case USB_PORT_FEAT_C_OVER_CURRENT: | ||
183 | dev_dbg(hcd->self.controller, | ||
184 | "ClearPortFeature: C_OVER_CURRENT\n"); | ||
185 | |||
186 | if (valid_port(wIndex)) { | ||
187 | info->port[wIndex-1].oc_changed = 0; | ||
188 | info->port[wIndex-1].oc_status = 0; | ||
189 | } | ||
190 | |||
191 | goto out; | ||
192 | |||
193 | case USB_PORT_FEAT_OVER_CURRENT: | ||
194 | dev_dbg(hcd->self.controller, | ||
195 | "ClearPortFeature: OVER_CURRENT\n"); | ||
196 | |||
197 | if (valid_port(wIndex)) { | ||
198 | info->port[wIndex-1].oc_status = 0; | ||
199 | } | ||
200 | |||
201 | goto out; | ||
202 | |||
203 | case USB_PORT_FEAT_POWER: | ||
204 | dev_dbg(hcd->self.controller, | ||
205 | "ClearPortFeature: POWER\n"); | ||
206 | |||
207 | if (valid_port(wIndex)) { | ||
208 | s3c2410_usb_set_power(info, wIndex, 0); | ||
209 | return 0; | ||
210 | } | ||
211 | } | ||
212 | break; | ||
213 | } | ||
214 | |||
215 | ret = ohci_hub_control(hcd, typeReq, wValue, wIndex, buf, wLength); | ||
216 | if (ret) | ||
217 | goto out; | ||
218 | |||
219 | switch (typeReq) { | ||
220 | case GetHubDescriptor: | ||
221 | |||
222 | /* update the hub's descriptor */ | ||
223 | |||
224 | desc = (struct usb_hub_descriptor *)buf; | ||
225 | |||
226 | if (info->power_control == NULL) | ||
227 | return ret; | ||
228 | |||
229 | dev_dbg(hcd->self.controller, "wHubCharacteristics 0x%04x\n", | ||
230 | desc->wHubCharacteristics); | ||
231 | |||
232 | /* remove the old configurations for power-switching, and | ||
233 | * over-current protection, and insert our new configuration | ||
234 | */ | ||
235 | |||
236 | desc->wHubCharacteristics &= ~cpu_to_le16(HUB_CHAR_LPSM); | ||
237 | desc->wHubCharacteristics |= cpu_to_le16(0x0001); | ||
238 | |||
239 | if (info->enable_oc) { | ||
240 | desc->wHubCharacteristics &= ~cpu_to_le16(HUB_CHAR_OCPM); | ||
241 | desc->wHubCharacteristics |= cpu_to_le16(0x0008|0x0001); | ||
242 | } | ||
243 | |||
244 | dev_dbg(hcd->self.controller, "wHubCharacteristics after 0x%04x\n", | ||
245 | desc->wHubCharacteristics); | ||
246 | |||
247 | return ret; | ||
248 | |||
249 | case GetPortStatus: | ||
250 | /* check port status */ | ||
251 | |||
252 | dev_dbg(hcd->self.controller, "GetPortStatus(%d)\n", wIndex); | ||
253 | |||
254 | if (valid_port(wIndex)) { | ||
255 | if (info->port[wIndex-1].oc_changed) { | ||
256 | *data |= cpu_to_le32(RH_PS_OCIC); | ||
257 | } | ||
258 | |||
259 | if (info->port[wIndex-1].oc_status) { | ||
260 | *data |= cpu_to_le32(RH_PS_POCI); | ||
261 | } | ||
262 | } | ||
263 | } | ||
264 | |||
265 | out: | ||
266 | return ret; | ||
267 | } | ||
268 | |||
269 | /* s3c2410_hcd_oc | ||
270 | * | ||
271 | * handle an over-current report | ||
272 | */ | ||
273 | |||
274 | static void s3c2410_hcd_oc(struct s3c2410_hcd_info *info, int port_oc) | ||
275 | { | ||
276 | struct s3c2410_hcd_port *port; | ||
277 | struct usb_hcd *hcd; | ||
278 | unsigned long flags; | ||
279 | int portno; | ||
280 | |||
281 | if (info == NULL) | ||
282 | return; | ||
283 | |||
284 | port = &info->port[0]; | ||
285 | hcd = info->hcd; | ||
286 | |||
287 | local_irq_save(flags); | ||
288 | |||
289 | for (portno = 0; portno < 2; port++, portno++) { | ||
290 | if (port_oc & (1<<portno) && | ||
291 | port->flags & S3C_HCDFLG_USED) { | ||
292 | port->oc_status = 1; | ||
293 | port->oc_changed = 1; | ||
294 | |||
295 | /* ok, once over-current is detected, | ||
296 | the port needs to be powered down */ | ||
297 | s3c2410_usb_set_power(info, portno+1, 0); | ||
298 | } | ||
299 | } | ||
300 | |||
301 | local_irq_restore(flags); | ||
302 | } | ||
303 | |||
304 | /* may be called without controller electrically present */ | ||
305 | /* may be called with controller, bus, and devices active */ | ||
306 | |||
307 | /* | ||
308 | * usb_hcd_s3c2410_remove - shutdown processing for HCD | ||
309 | * @dev: USB Host Controller being removed | ||
310 | * Context: !in_interrupt() | ||
311 | * | ||
312 | * Reverses the effect of usb_hcd_3c2410_probe(), first invoking | ||
313 | * the HCD's stop() method. It is always called from a thread | ||
314 | * context, normally "rmmod", "apmd", or something similar. | ||
315 | * | ||
316 | */ | ||
317 | |||
318 | void usb_hcd_s3c2410_remove (struct usb_hcd *hcd, struct platform_device *dev) | ||
319 | { | ||
320 | usb_remove_hcd(hcd); | ||
321 | s3c2410_stop_hc(dev); | ||
322 | iounmap(hcd->regs); | ||
323 | release_mem_region(hcd->rsrc_start, hcd->rsrc_len); | ||
324 | usb_put_hcd(hcd); | ||
325 | } | ||
326 | |||
327 | /** | ||
328 | * usb_hcd_s3c2410_probe - initialize S3C2410-based HCDs | ||
329 | * Context: !in_interrupt() | ||
330 | * | ||
331 | * Allocates basic resources for this USB host controller, and | ||
332 | * then invokes the start() method for the HCD associated with it | ||
333 | * through the hotplug entry's driver_data. | ||
334 | * | ||
335 | */ | ||
336 | int usb_hcd_s3c2410_probe (const struct hc_driver *driver, | ||
337 | struct platform_device *dev) | ||
338 | { | ||
339 | struct usb_hcd *hcd = NULL; | ||
340 | int retval; | ||
341 | |||
342 | s3c2410_usb_set_power(dev->dev.platform_data, 0, 1); | ||
343 | s3c2410_usb_set_power(dev->dev.platform_data, 1, 1); | ||
344 | |||
345 | hcd = usb_create_hcd(driver, &dev->dev, "s3c24xx"); | ||
346 | if (hcd == NULL) | ||
347 | return -ENOMEM; | ||
348 | |||
349 | hcd->rsrc_start = dev->resource[0].start; | ||
350 | hcd->rsrc_len = dev->resource[0].end - dev->resource[0].start + 1; | ||
351 | |||
352 | if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) { | ||
353 | dev_err(&dev->dev, "request_mem_region failed"); | ||
354 | retval = -EBUSY; | ||
355 | goto err0; | ||
356 | } | ||
357 | |||
358 | clk = clk_get(NULL, "usb-host"); | ||
359 | if (IS_ERR(clk)) { | ||
360 | dev_err(&dev->dev, "cannot get usb-host clock\n"); | ||
361 | retval = -ENOENT; | ||
362 | goto err1; | ||
363 | } | ||
364 | |||
365 | clk_use(clk); | ||
366 | s3c2410_start_hc(dev, hcd); | ||
367 | |||
368 | hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len); | ||
369 | if (!hcd->regs) { | ||
370 | dev_err(&dev->dev, "ioremap failed\n"); | ||
371 | retval = -ENOMEM; | ||
372 | goto err2; | ||
373 | } | ||
374 | |||
375 | ohci_hcd_init(hcd_to_ohci(hcd)); | ||
376 | |||
377 | retval = usb_add_hcd(hcd, dev->resource[1].start, SA_INTERRUPT); | ||
378 | if (retval != 0) | ||
379 | goto err2; | ||
380 | |||
381 | return 0; | ||
382 | |||
383 | err2: | ||
384 | s3c2410_stop_hc(dev); | ||
385 | iounmap(hcd->regs); | ||
386 | clk_unuse(clk); | ||
387 | clk_put(clk); | ||
388 | |||
389 | err1: | ||
390 | release_mem_region(hcd->rsrc_start, hcd->rsrc_len); | ||
391 | |||
392 | err0: | ||
393 | usb_put_hcd(hcd); | ||
394 | return retval; | ||
395 | } | ||
396 | |||
397 | /*-------------------------------------------------------------------------*/ | ||
398 | |||
399 | static int | ||
400 | ohci_s3c2410_start (struct usb_hcd *hcd) | ||
401 | { | ||
402 | struct ohci_hcd *ohci = hcd_to_ohci (hcd); | ||
403 | int ret; | ||
404 | |||
405 | if ((ret = ohci_init(ohci)) < 0) | ||
406 | return ret; | ||
407 | |||
408 | if ((ret = ohci_run (ohci)) < 0) { | ||
409 | err ("can't start %s", hcd->self.bus_name); | ||
410 | ohci_stop (hcd); | ||
411 | return ret; | ||
412 | } | ||
413 | |||
414 | return 0; | ||
415 | } | ||
416 | |||
417 | |||
418 | static const struct hc_driver ohci_s3c2410_hc_driver = { | ||
419 | .description = hcd_name, | ||
420 | .product_desc = "S3C24XX OHCI", | ||
421 | .hcd_priv_size = sizeof(struct ohci_hcd), | ||
422 | |||
423 | /* | ||
424 | * generic hardware linkage | ||
425 | */ | ||
426 | .irq = ohci_irq, | ||
427 | .flags = HCD_USB11 | HCD_MEMORY, | ||
428 | |||
429 | /* | ||
430 | * basic lifecycle operations | ||
431 | */ | ||
432 | .start = ohci_s3c2410_start, | ||
433 | .stop = ohci_stop, | ||
434 | |||
435 | /* | ||
436 | * managing i/o requests and associated device resources | ||
437 | */ | ||
438 | .urb_enqueue = ohci_urb_enqueue, | ||
439 | .urb_dequeue = ohci_urb_dequeue, | ||
440 | .endpoint_disable = ohci_endpoint_disable, | ||
441 | |||
442 | /* | ||
443 | * scheduling support | ||
444 | */ | ||
445 | .get_frame_number = ohci_get_frame, | ||
446 | |||
447 | /* | ||
448 | * root hub support | ||
449 | */ | ||
450 | .hub_status_data = ohci_s3c2410_hub_status_data, | ||
451 | .hub_control = ohci_s3c2410_hub_control, | ||
452 | |||
453 | #if defined(CONFIG_USB_SUSPEND) && 0 | ||
454 | .hub_suspend = ohci_hub_suspend, | ||
455 | .hub_resume = ohci_hub_resume, | ||
456 | #endif | ||
457 | }; | ||
458 | |||
459 | /* device driver */ | ||
460 | |||
461 | static int ohci_hcd_s3c2410_drv_probe(struct device *dev) | ||
462 | { | ||
463 | struct platform_device *pdev = to_platform_device(dev); | ||
464 | return usb_hcd_s3c2410_probe(&ohci_s3c2410_hc_driver, pdev); | ||
465 | } | ||
466 | |||
467 | static int ohci_hcd_s3c2410_drv_remove(struct device *dev) | ||
468 | { | ||
469 | struct platform_device *pdev = to_platform_device(dev); | ||
470 | struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
471 | |||
472 | usb_hcd_s3c2410_remove(hcd, pdev); | ||
473 | return 0; | ||
474 | } | ||
475 | |||
476 | static struct device_driver ohci_hcd_s3c2410_driver = { | ||
477 | .name = "s3c2410-ohci", | ||
478 | .bus = &platform_bus_type, | ||
479 | .probe = ohci_hcd_s3c2410_drv_probe, | ||
480 | .remove = ohci_hcd_s3c2410_drv_remove, | ||
481 | /*.suspend = ohci_hcd_s3c2410_drv_suspend, */ | ||
482 | /*.resume = ohci_hcd_s3c2410_drv_resume, */ | ||
483 | }; | ||
484 | |||
485 | static int __init ohci_hcd_s3c2410_init (void) | ||
486 | { | ||
487 | return driver_register(&ohci_hcd_s3c2410_driver); | ||
488 | } | ||
489 | |||
490 | static void __exit ohci_hcd_s3c2410_cleanup (void) | ||
491 | { | ||
492 | driver_unregister(&ohci_hcd_s3c2410_driver); | ||
493 | } | ||
494 | |||
495 | module_init (ohci_hcd_s3c2410_init); | ||
496 | module_exit (ohci_hcd_s3c2410_cleanup); | ||
diff --git a/drivers/usb/image/microtek.c b/drivers/usb/image/microtek.c index 7d21a4f5c425..c84e1486054f 100644 --- a/drivers/usb/image/microtek.c +++ b/drivers/usb/image/microtek.c | |||
@@ -361,8 +361,7 @@ int mts_scsi_queuecommand (Scsi_Cmnd *srb, mts_scsi_cmnd_callback callback ); | |||
361 | static void mts_transfer_cleanup( struct urb *transfer ); | 361 | static void mts_transfer_cleanup( struct urb *transfer ); |
362 | static void mts_do_sg(struct urb * transfer, struct pt_regs *regs); | 362 | static void mts_do_sg(struct urb * transfer, struct pt_regs *regs); |
363 | 363 | ||
364 | 364 | static inline | |
365 | inline static | ||
366 | void mts_int_submit_urb (struct urb* transfer, | 365 | void mts_int_submit_urb (struct urb* transfer, |
367 | int pipe, | 366 | int pipe, |
368 | void* data, | 367 | void* data, |
diff --git a/drivers/usb/input/acecad.c b/drivers/usb/input/acecad.c index ebcf7c955800..13532f3e3efc 100644 --- a/drivers/usb/input/acecad.c +++ b/drivers/usb/input/acecad.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/module.h> | 31 | #include <linux/module.h> |
32 | #include <linux/init.h> | 32 | #include <linux/init.h> |
33 | #include <linux/usb.h> | 33 | #include <linux/usb.h> |
34 | #include <linux/usb_input.h> | ||
34 | 35 | ||
35 | /* | 36 | /* |
36 | * Version Information | 37 | * Version Information |
@@ -87,8 +88,8 @@ static void usb_acecad_irq(struct urb *urb, struct pt_regs *regs) | |||
87 | if (prox) { | 88 | if (prox) { |
88 | int x = data[1] | (data[2] << 8); | 89 | int x = data[1] | (data[2] << 8); |
89 | int y = data[3] | (data[4] << 8); | 90 | int y = data[3] | (data[4] << 8); |
90 | /*Pressure should compute the same way for flair and 302*/ | 91 | /* Pressure should compute the same way for flair and 302 */ |
91 | int pressure = data[5] | ((int)data[6] << 8); | 92 | int pressure = data[5] | (data[6] << 8); |
92 | int touch = data[0] & 0x01; | 93 | int touch = data[0] & 0x01; |
93 | int stylus = (data[0] & 0x10) >> 4; | 94 | int stylus = (data[0] & 0x10) >> 4; |
94 | int stylus2 = (data[0] & 0x20) >> 5; | 95 | int stylus2 = (data[0] & 0x20) >> 5; |
@@ -104,9 +105,9 @@ static void usb_acecad_irq(struct urb *urb, struct pt_regs *regs) | |||
104 | input_sync(dev); | 105 | input_sync(dev); |
105 | 106 | ||
106 | resubmit: | 107 | resubmit: |
107 | status = usb_submit_urb (urb, GFP_ATOMIC); | 108 | status = usb_submit_urb(urb, GFP_ATOMIC); |
108 | if (status) | 109 | if (status) |
109 | err ("can't resubmit intr, %s-%s/input0, status %d", | 110 | err("can't resubmit intr, %s-%s/input0, status %d", |
110 | acecad->usbdev->bus->bus_name, acecad->usbdev->devpath, status); | 111 | acecad->usbdev->bus->bus_name, acecad->usbdev->devpath, status); |
111 | } | 112 | } |
112 | 113 | ||
@@ -212,10 +213,7 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_ | |||
212 | 213 | ||
213 | acecad->dev.name = acecad->name; | 214 | acecad->dev.name = acecad->name; |
214 | acecad->dev.phys = acecad->phys; | 215 | acecad->dev.phys = acecad->phys; |
215 | acecad->dev.id.bustype = BUS_USB; | 216 | usb_to_input_id(dev, &acecad->dev.id); |
216 | acecad->dev.id.vendor = le16_to_cpu(dev->descriptor.idVendor); | ||
217 | acecad->dev.id.product = le16_to_cpu(dev->descriptor.idProduct); | ||
218 | acecad->dev.id.version = le16_to_cpu(dev->descriptor.bcdDevice); | ||
219 | acecad->dev.dev = &intf->dev; | 217 | acecad->dev.dev = &intf->dev; |
220 | 218 | ||
221 | usb_fill_int_urb(acecad->irq, dev, pipe, | 219 | usb_fill_int_urb(acecad->irq, dev, pipe, |
diff --git a/drivers/usb/input/aiptek.c b/drivers/usb/input/aiptek.c index 6bb0f25e8e93..cd0cbfe20723 100644 --- a/drivers/usb/input/aiptek.c +++ b/drivers/usb/input/aiptek.c | |||
@@ -77,6 +77,7 @@ | |||
77 | #include <linux/module.h> | 77 | #include <linux/module.h> |
78 | #include <linux/init.h> | 78 | #include <linux/init.h> |
79 | #include <linux/usb.h> | 79 | #include <linux/usb.h> |
80 | #include <linux/usb_input.h> | ||
80 | #include <linux/sched.h> | 81 | #include <linux/sched.h> |
81 | #include <asm/uaccess.h> | 82 | #include <asm/uaccess.h> |
82 | #include <asm/unaligned.h> | 83 | #include <asm/unaligned.h> |
@@ -2125,10 +2126,7 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
2125 | aiptek->inputdev.absflat[ABS_WHEEL] = 0; | 2126 | aiptek->inputdev.absflat[ABS_WHEEL] = 0; |
2126 | aiptek->inputdev.name = "Aiptek"; | 2127 | aiptek->inputdev.name = "Aiptek"; |
2127 | aiptek->inputdev.phys = aiptek->features.usbPath; | 2128 | aiptek->inputdev.phys = aiptek->features.usbPath; |
2128 | aiptek->inputdev.id.bustype = BUS_USB; | 2129 | usb_to_input_id(usbdev, &aiptek->inputdev.id); |
2129 | aiptek->inputdev.id.vendor = le16_to_cpu(usbdev->descriptor.idVendor); | ||
2130 | aiptek->inputdev.id.product = le16_to_cpu(usbdev->descriptor.idProduct); | ||
2131 | aiptek->inputdev.id.version = le16_to_cpu(usbdev->descriptor.bcdDevice); | ||
2132 | aiptek->inputdev.dev = &intf->dev; | 2130 | aiptek->inputdev.dev = &intf->dev; |
2133 | 2131 | ||
2134 | aiptek->usbdev = usbdev; | 2132 | aiptek->usbdev = usbdev; |
diff --git a/drivers/usb/input/ati_remote.c b/drivers/usb/input/ati_remote.c index 654ac454744d..fd99681ee483 100644 --- a/drivers/usb/input/ati_remote.c +++ b/drivers/usb/input/ati_remote.c | |||
@@ -94,6 +94,7 @@ | |||
94 | #include <linux/moduleparam.h> | 94 | #include <linux/moduleparam.h> |
95 | #include <linux/input.h> | 95 | #include <linux/input.h> |
96 | #include <linux/usb.h> | 96 | #include <linux/usb.h> |
97 | #include <linux/usb_input.h> | ||
97 | #include <linux/wait.h> | 98 | #include <linux/wait.h> |
98 | 99 | ||
99 | /* | 100 | /* |
@@ -635,11 +636,8 @@ static void ati_remote_input_init(struct ati_remote *ati_remote) | |||
635 | idev->name = ati_remote->name; | 636 | idev->name = ati_remote->name; |
636 | idev->phys = ati_remote->phys; | 637 | idev->phys = ati_remote->phys; |
637 | 638 | ||
638 | idev->id.bustype = BUS_USB; | 639 | usb_to_input_id(ati_remote->udev, &idev->id); |
639 | idev->id.vendor = le16_to_cpu(ati_remote->udev->descriptor.idVendor); | 640 | idev->dev = &ati_remote->udev->dev; |
640 | idev->id.product = le16_to_cpu(ati_remote->udev->descriptor.idProduct); | ||
641 | idev->id.version = le16_to_cpu(ati_remote->udev->descriptor.bcdDevice); | ||
642 | idev->dev = &(ati_remote->udev->dev); | ||
643 | } | 641 | } |
644 | 642 | ||
645 | static int ati_remote_initialize(struct ati_remote *ati_remote) | 643 | static int ati_remote_initialize(struct ati_remote *ati_remote) |
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c index 2350e7a5ad70..b2cb2b35892e 100644 --- a/drivers/usb/input/hid-core.c +++ b/drivers/usb/input/hid-core.c | |||
@@ -789,12 +789,12 @@ static __inline__ int search(__s32 *array, __s32 value, unsigned n) | |||
789 | return -1; | 789 | return -1; |
790 | } | 790 | } |
791 | 791 | ||
792 | static void hid_process_event(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value, struct pt_regs *regs) | 792 | static void hid_process_event(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value, int interrupt, struct pt_regs *regs) |
793 | { | 793 | { |
794 | hid_dump_input(usage, value); | 794 | hid_dump_input(usage, value); |
795 | if (hid->claimed & HID_CLAIMED_INPUT) | 795 | if (hid->claimed & HID_CLAIMED_INPUT) |
796 | hidinput_hid_event(hid, field, usage, value, regs); | 796 | hidinput_hid_event(hid, field, usage, value, regs); |
797 | if (hid->claimed & HID_CLAIMED_HIDDEV) | 797 | if (hid->claimed & HID_CLAIMED_HIDDEV && interrupt) |
798 | hiddev_hid_event(hid, field, usage, value, regs); | 798 | hiddev_hid_event(hid, field, usage, value, regs); |
799 | } | 799 | } |
800 | 800 | ||
@@ -804,7 +804,7 @@ static void hid_process_event(struct hid_device *hid, struct hid_field *field, s | |||
804 | * reporting to the layer). | 804 | * reporting to the layer). |
805 | */ | 805 | */ |
806 | 806 | ||
807 | static void hid_input_field(struct hid_device *hid, struct hid_field *field, __u8 *data, struct pt_regs *regs) | 807 | static void hid_input_field(struct hid_device *hid, struct hid_field *field, __u8 *data, int interrupt, struct pt_regs *regs) |
808 | { | 808 | { |
809 | unsigned n; | 809 | unsigned n; |
810 | unsigned count = field->report_count; | 810 | unsigned count = field->report_count; |
@@ -831,19 +831,19 @@ static void hid_input_field(struct hid_device *hid, struct hid_field *field, __u | |||
831 | for (n = 0; n < count; n++) { | 831 | for (n = 0; n < count; n++) { |
832 | 832 | ||
833 | if (HID_MAIN_ITEM_VARIABLE & field->flags) { | 833 | if (HID_MAIN_ITEM_VARIABLE & field->flags) { |
834 | hid_process_event(hid, field, &field->usage[n], value[n], regs); | 834 | hid_process_event(hid, field, &field->usage[n], value[n], interrupt, regs); |
835 | continue; | 835 | continue; |
836 | } | 836 | } |
837 | 837 | ||
838 | if (field->value[n] >= min && field->value[n] <= max | 838 | if (field->value[n] >= min && field->value[n] <= max |
839 | && field->usage[field->value[n] - min].hid | 839 | && field->usage[field->value[n] - min].hid |
840 | && search(value, field->value[n], count)) | 840 | && search(value, field->value[n], count)) |
841 | hid_process_event(hid, field, &field->usage[field->value[n] - min], 0, regs); | 841 | hid_process_event(hid, field, &field->usage[field->value[n] - min], 0, interrupt, regs); |
842 | 842 | ||
843 | if (value[n] >= min && value[n] <= max | 843 | if (value[n] >= min && value[n] <= max |
844 | && field->usage[value[n] - min].hid | 844 | && field->usage[value[n] - min].hid |
845 | && search(field->value, value[n], count)) | 845 | && search(field->value, value[n], count)) |
846 | hid_process_event(hid, field, &field->usage[value[n] - min], 1, regs); | 846 | hid_process_event(hid, field, &field->usage[value[n] - min], 1, interrupt, regs); |
847 | } | 847 | } |
848 | 848 | ||
849 | memcpy(field->value, value, count * sizeof(__s32)); | 849 | memcpy(field->value, value, count * sizeof(__s32)); |
@@ -851,7 +851,7 @@ exit: | |||
851 | kfree(value); | 851 | kfree(value); |
852 | } | 852 | } |
853 | 853 | ||
854 | static int hid_input_report(int type, struct urb *urb, struct pt_regs *regs) | 854 | static int hid_input_report(int type, struct urb *urb, int interrupt, struct pt_regs *regs) |
855 | { | 855 | { |
856 | struct hid_device *hid = urb->context; | 856 | struct hid_device *hid = urb->context; |
857 | struct hid_report_enum *report_enum = hid->report_enum + type; | 857 | struct hid_report_enum *report_enum = hid->report_enum + type; |
@@ -899,7 +899,7 @@ static int hid_input_report(int type, struct urb *urb, struct pt_regs *regs) | |||
899 | hiddev_report_event(hid, report); | 899 | hiddev_report_event(hid, report); |
900 | 900 | ||
901 | for (n = 0; n < report->maxfield; n++) | 901 | for (n = 0; n < report->maxfield; n++) |
902 | hid_input_field(hid, report->field[n], data, regs); | 902 | hid_input_field(hid, report->field[n], data, interrupt, regs); |
903 | 903 | ||
904 | if (hid->claimed & HID_CLAIMED_INPUT) | 904 | if (hid->claimed & HID_CLAIMED_INPUT) |
905 | hidinput_report_event(hid, report); | 905 | hidinput_report_event(hid, report); |
@@ -918,7 +918,7 @@ static void hid_irq_in(struct urb *urb, struct pt_regs *regs) | |||
918 | 918 | ||
919 | switch (urb->status) { | 919 | switch (urb->status) { |
920 | case 0: /* success */ | 920 | case 0: /* success */ |
921 | hid_input_report(HID_INPUT_REPORT, urb, regs); | 921 | hid_input_report(HID_INPUT_REPORT, urb, 1, regs); |
922 | break; | 922 | break; |
923 | case -ECONNRESET: /* unlink */ | 923 | case -ECONNRESET: /* unlink */ |
924 | case -ENOENT: | 924 | case -ENOENT: |
@@ -1142,7 +1142,7 @@ static void hid_ctrl(struct urb *urb, struct pt_regs *regs) | |||
1142 | switch (urb->status) { | 1142 | switch (urb->status) { |
1143 | case 0: /* success */ | 1143 | case 0: /* success */ |
1144 | if (hid->ctrl[hid->ctrltail].dir == USB_DIR_IN) | 1144 | if (hid->ctrl[hid->ctrltail].dir == USB_DIR_IN) |
1145 | hid_input_report(hid->ctrl[hid->ctrltail].report->type, urb, regs); | 1145 | hid_input_report(hid->ctrl[hid->ctrltail].report->type, urb, 0, regs); |
1146 | case -ESHUTDOWN: /* unplug */ | 1146 | case -ESHUTDOWN: /* unplug */ |
1147 | case -EILSEQ: /* unplug timectrl on uhci */ | 1147 | case -EILSEQ: /* unplug timectrl on uhci */ |
1148 | unplug = 1; | 1148 | unplug = 1; |
@@ -1372,6 +1372,9 @@ void hid_init_reports(struct hid_device *hid) | |||
1372 | #define USB_VENDOR_ID_A4TECH 0x09da | 1372 | #define USB_VENDOR_ID_A4TECH 0x09da |
1373 | #define USB_DEVICE_ID_A4TECH_WCP32PU 0x0006 | 1373 | #define USB_DEVICE_ID_A4TECH_WCP32PU 0x0006 |
1374 | 1374 | ||
1375 | #define USB_VENDOR_ID_AASHIMA 0x06D6 | ||
1376 | #define USB_DEVICE_ID_AASHIMA_GAMEPAD 0x0025 | ||
1377 | |||
1375 | #define USB_VENDOR_ID_CYPRESS 0x04b4 | 1378 | #define USB_VENDOR_ID_CYPRESS 0x04b4 |
1376 | #define USB_DEVICE_ID_CYPRESS_MOUSE 0x0001 | 1379 | #define USB_DEVICE_ID_CYPRESS_MOUSE 0x0001 |
1377 | #define USB_DEVICE_ID_CYPRESS_HIDCOM 0x5500 | 1380 | #define USB_DEVICE_ID_CYPRESS_HIDCOM 0x5500 |
@@ -1548,6 +1551,7 @@ static struct hid_blacklist { | |||
1548 | { USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU, HID_QUIRK_2WHEEL_MOUSE_HACK_7 }, | 1551 | { USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU, HID_QUIRK_2WHEEL_MOUSE_HACK_7 }, |
1549 | { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_MOUSE, HID_QUIRK_2WHEEL_MOUSE_HACK_5 }, | 1552 | { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_MOUSE, HID_QUIRK_2WHEEL_MOUSE_HACK_5 }, |
1550 | 1553 | ||
1554 | { USB_VENDOR_ID_AASHIMA, USB_DEVICE_ID_AASHIMA_GAMEPAD, HID_QUIRK_BADPAD }, | ||
1551 | { USB_VENDOR_ID_ALPS, USB_DEVICE_ID_IBM_GAMEPAD, HID_QUIRK_BADPAD }, | 1555 | { USB_VENDOR_ID_ALPS, USB_DEVICE_ID_IBM_GAMEPAD, HID_QUIRK_BADPAD }, |
1552 | { USB_VENDOR_ID_CHIC, USB_DEVICE_ID_CHIC_GAMEPAD, HID_QUIRK_BADPAD }, | 1556 | { USB_VENDOR_ID_CHIC, USB_DEVICE_ID_CHIC_GAMEPAD, HID_QUIRK_BADPAD }, |
1553 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_DRIVING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, | 1557 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_DRIVING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, |
diff --git a/drivers/usb/input/hid-input.c b/drivers/usb/input/hid-input.c index 9ac1e9095334..63a4db721f7e 100644 --- a/drivers/usb/input/hid-input.c +++ b/drivers/usb/input/hid-input.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/kernel.h> | 31 | #include <linux/kernel.h> |
32 | #include <linux/input.h> | 32 | #include <linux/input.h> |
33 | #include <linux/usb.h> | 33 | #include <linux/usb.h> |
34 | #include <linux/usb_input.h> | ||
34 | 35 | ||
35 | #undef DEBUG | 36 | #undef DEBUG |
36 | 37 | ||
@@ -397,11 +398,12 @@ ignore: | |||
397 | 398 | ||
398 | void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value, struct pt_regs *regs) | 399 | void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value, struct pt_regs *regs) |
399 | { | 400 | { |
400 | struct input_dev *input = &field->hidinput->input; | 401 | struct input_dev *input; |
401 | int *quirks = &hid->quirks; | 402 | int *quirks = &hid->quirks; |
402 | 403 | ||
403 | if (!input) | 404 | if (!field->hidinput) |
404 | return; | 405 | return; |
406 | input = &field->hidinput->input; | ||
405 | 407 | ||
406 | input_regs(input, regs); | 408 | input_regs(input, regs); |
407 | 409 | ||
@@ -581,10 +583,7 @@ int hidinput_connect(struct hid_device *hid) | |||
581 | hidinput->input.name = hid->name; | 583 | hidinput->input.name = hid->name; |
582 | hidinput->input.phys = hid->phys; | 584 | hidinput->input.phys = hid->phys; |
583 | hidinput->input.uniq = hid->uniq; | 585 | hidinput->input.uniq = hid->uniq; |
584 | hidinput->input.id.bustype = BUS_USB; | 586 | usb_to_input_id(dev, &hidinput->input.id); |
585 | hidinput->input.id.vendor = le16_to_cpu(dev->descriptor.idVendor); | ||
586 | hidinput->input.id.product = le16_to_cpu(dev->descriptor.idProduct); | ||
587 | hidinput->input.id.version = le16_to_cpu(dev->descriptor.bcdDevice); | ||
588 | hidinput->input.dev = &hid->intf->dev; | 587 | hidinput->input.dev = &hid->intf->dev; |
589 | } | 588 | } |
590 | 589 | ||
diff --git a/drivers/usb/input/itmtouch.c b/drivers/usb/input/itmtouch.c index 47dec6a1b344..0dc439f10823 100644 --- a/drivers/usb/input/itmtouch.c +++ b/drivers/usb/input/itmtouch.c | |||
@@ -53,6 +53,7 @@ | |||
53 | #include <linux/module.h> | 53 | #include <linux/module.h> |
54 | #include <linux/init.h> | 54 | #include <linux/init.h> |
55 | #include <linux/usb.h> | 55 | #include <linux/usb.h> |
56 | #include <linux/usb_input.h> | ||
56 | 57 | ||
57 | /* only an 8 byte buffer necessary for a single packet */ | 58 | /* only an 8 byte buffer necessary for a single packet */ |
58 | #define ITM_BUFSIZE 8 | 59 | #define ITM_BUFSIZE 8 |
@@ -184,10 +185,7 @@ static int itmtouch_probe(struct usb_interface *intf, const struct usb_device_id | |||
184 | 185 | ||
185 | itmtouch->inputdev.name = itmtouch->name; | 186 | itmtouch->inputdev.name = itmtouch->name; |
186 | itmtouch->inputdev.phys = itmtouch->phys; | 187 | itmtouch->inputdev.phys = itmtouch->phys; |
187 | itmtouch->inputdev.id.bustype = BUS_USB; | 188 | usb_to_input_id(udev, &itmtouch->inputdev.id); |
188 | itmtouch->inputdev.id.vendor = udev->descriptor.idVendor; | ||
189 | itmtouch->inputdev.id.product = udev->descriptor.idProduct; | ||
190 | itmtouch->inputdev.id.version = udev->descriptor.bcdDevice; | ||
191 | itmtouch->inputdev.dev = &intf->dev; | 189 | itmtouch->inputdev.dev = &intf->dev; |
192 | 190 | ||
193 | if (!strlen(itmtouch->name)) | 191 | if (!strlen(itmtouch->name)) |
diff --git a/drivers/usb/input/kbtab.c b/drivers/usb/input/kbtab.c index d2f0f90a9bcd..b6f6ac8d9c2f 100644 --- a/drivers/usb/input/kbtab.c +++ b/drivers/usb/input/kbtab.c | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/module.h> | 4 | #include <linux/module.h> |
5 | #include <linux/init.h> | 5 | #include <linux/init.h> |
6 | #include <linux/usb.h> | 6 | #include <linux/usb.h> |
7 | #include <linux/usb_input.h> | ||
7 | #include <asm/unaligned.h> | 8 | #include <asm/unaligned.h> |
8 | #include <asm/byteorder.h> | 9 | #include <asm/byteorder.h> |
9 | 10 | ||
@@ -167,10 +168,7 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
167 | 168 | ||
168 | kbtab->dev.name = "KB Gear Tablet"; | 169 | kbtab->dev.name = "KB Gear Tablet"; |
169 | kbtab->dev.phys = kbtab->phys; | 170 | kbtab->dev.phys = kbtab->phys; |
170 | kbtab->dev.id.bustype = BUS_USB; | 171 | usb_to_input_id(dev, &kbtab->dev.id); |
171 | kbtab->dev.id.vendor = le16_to_cpu(dev->descriptor.idVendor); | ||
172 | kbtab->dev.id.product = le16_to_cpu(dev->descriptor.idProduct); | ||
173 | kbtab->dev.id.version = le16_to_cpu(dev->descriptor.bcdDevice); | ||
174 | kbtab->dev.dev = &intf->dev; | 172 | kbtab->dev.dev = &intf->dev; |
175 | kbtab->usbdev = dev; | 173 | kbtab->usbdev = dev; |
176 | 174 | ||
diff --git a/drivers/usb/input/mtouchusb.c b/drivers/usb/input/mtouchusb.c index 09b5cc7c66de..ff9275057a18 100644 --- a/drivers/usb/input/mtouchusb.c +++ b/drivers/usb/input/mtouchusb.c | |||
@@ -53,6 +53,7 @@ | |||
53 | #include <linux/module.h> | 53 | #include <linux/module.h> |
54 | #include <linux/init.h> | 54 | #include <linux/init.h> |
55 | #include <linux/usb.h> | 55 | #include <linux/usb.h> |
56 | #include <linux/usb_input.h> | ||
56 | 57 | ||
57 | #define MTOUCHUSB_MIN_XC 0x0 | 58 | #define MTOUCHUSB_MIN_XC 0x0 |
58 | #define MTOUCHUSB_MAX_RAW_XC 0x4000 | 59 | #define MTOUCHUSB_MAX_RAW_XC 0x4000 |
@@ -232,10 +233,7 @@ static int mtouchusb_probe(struct usb_interface *intf, const struct usb_device_i | |||
232 | 233 | ||
233 | mtouch->input.name = mtouch->name; | 234 | mtouch->input.name = mtouch->name; |
234 | mtouch->input.phys = mtouch->phys; | 235 | mtouch->input.phys = mtouch->phys; |
235 | mtouch->input.id.bustype = BUS_USB; | 236 | usb_to_input_id(udev, &mtouch->input.id); |
236 | mtouch->input.id.vendor = le16_to_cpu(udev->descriptor.idVendor); | ||
237 | mtouch->input.id.product = le16_to_cpu(udev->descriptor.idProduct); | ||
238 | mtouch->input.id.version = le16_to_cpu(udev->descriptor.bcdDevice); | ||
239 | mtouch->input.dev = &intf->dev; | 237 | mtouch->input.dev = &intf->dev; |
240 | 238 | ||
241 | mtouch->input.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); | 239 | mtouch->input.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); |
diff --git a/drivers/usb/input/powermate.c b/drivers/usb/input/powermate.c index 3975b309d55f..ad4afe7e5897 100644 --- a/drivers/usb/input/powermate.c +++ b/drivers/usb/input/powermate.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <linux/init.h> | 35 | #include <linux/init.h> |
36 | #include <linux/spinlock.h> | 36 | #include <linux/spinlock.h> |
37 | #include <linux/usb.h> | 37 | #include <linux/usb.h> |
38 | #include <linux/usb_input.h> | ||
38 | 39 | ||
39 | #define POWERMATE_VENDOR 0x077d /* Griffin Technology, Inc. */ | 40 | #define POWERMATE_VENDOR 0x077d /* Griffin Technology, Inc. */ |
40 | #define POWERMATE_PRODUCT_NEW 0x0410 /* Griffin PowerMate */ | 41 | #define POWERMATE_PRODUCT_NEW 0x0410 /* Griffin PowerMate */ |
@@ -389,10 +390,7 @@ static int powermate_probe(struct usb_interface *intf, const struct usb_device_i | |||
389 | pm->input.keybit[LONG(BTN_0)] = BIT(BTN_0); | 390 | pm->input.keybit[LONG(BTN_0)] = BIT(BTN_0); |
390 | pm->input.relbit[LONG(REL_DIAL)] = BIT(REL_DIAL); | 391 | pm->input.relbit[LONG(REL_DIAL)] = BIT(REL_DIAL); |
391 | pm->input.mscbit[LONG(MSC_PULSELED)] = BIT(MSC_PULSELED); | 392 | pm->input.mscbit[LONG(MSC_PULSELED)] = BIT(MSC_PULSELED); |
392 | pm->input.id.bustype = BUS_USB; | 393 | usb_to_input_id(udev, &pm->input.id); |
393 | pm->input.id.vendor = le16_to_cpu(udev->descriptor.idVendor); | ||
394 | pm->input.id.product = le16_to_cpu(udev->descriptor.idProduct); | ||
395 | pm->input.id.version = le16_to_cpu(udev->descriptor.bcdDevice); | ||
396 | pm->input.event = powermate_input_event; | 394 | pm->input.event = powermate_input_event; |
397 | pm->input.dev = &intf->dev; | 395 | pm->input.dev = &intf->dev; |
398 | pm->input.phys = pm->phys; | 396 | pm->input.phys = pm->phys; |
diff --git a/drivers/usb/input/touchkitusb.c b/drivers/usb/input/touchkitusb.c index 386595ee21c0..4276c24a5080 100644 --- a/drivers/usb/input/touchkitusb.c +++ b/drivers/usb/input/touchkitusb.c | |||
@@ -35,7 +35,7 @@ | |||
35 | #define DEBUG | 35 | #define DEBUG |
36 | #endif | 36 | #endif |
37 | #include <linux/usb.h> | 37 | #include <linux/usb.h> |
38 | 38 | #include <linux/usb_input.h> | |
39 | 39 | ||
40 | #define TOUCHKIT_MIN_XC 0x0 | 40 | #define TOUCHKIT_MIN_XC 0x0 |
41 | #define TOUCHKIT_MAX_XC 0x07ff | 41 | #define TOUCHKIT_MAX_XC 0x07ff |
@@ -202,10 +202,7 @@ static int touchkit_probe(struct usb_interface *intf, | |||
202 | 202 | ||
203 | touchkit->input.name = touchkit->name; | 203 | touchkit->input.name = touchkit->name; |
204 | touchkit->input.phys = touchkit->phys; | 204 | touchkit->input.phys = touchkit->phys; |
205 | touchkit->input.id.bustype = BUS_USB; | 205 | usb_to_input_id(udev, &touchkit->input.id); |
206 | touchkit->input.id.vendor = le16_to_cpu(udev->descriptor.idVendor); | ||
207 | touchkit->input.id.product = le16_to_cpu(udev->descriptor.idProduct); | ||
208 | touchkit->input.id.version = le16_to_cpu(udev->descriptor.bcdDevice); | ||
209 | touchkit->input.dev = &intf->dev; | 206 | touchkit->input.dev = &intf->dev; |
210 | 207 | ||
211 | touchkit->input.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); | 208 | touchkit->input.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); |
diff --git a/drivers/usb/input/usbkbd.c b/drivers/usb/input/usbkbd.c index f35db1974c42..28987f15eeee 100644 --- a/drivers/usb/input/usbkbd.c +++ b/drivers/usb/input/usbkbd.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/input.h> | 32 | #include <linux/input.h> |
33 | #include <linux/init.h> | 33 | #include <linux/init.h> |
34 | #include <linux/usb.h> | 34 | #include <linux/usb.h> |
35 | #include <linux/usb_input.h> | ||
35 | 36 | ||
36 | /* | 37 | /* |
37 | * Version Information | 38 | * Version Information |
@@ -288,10 +289,7 @@ static int usb_kbd_probe(struct usb_interface *iface, | |||
288 | 289 | ||
289 | kbd->dev.name = kbd->name; | 290 | kbd->dev.name = kbd->name; |
290 | kbd->dev.phys = kbd->phys; | 291 | kbd->dev.phys = kbd->phys; |
291 | kbd->dev.id.bustype = BUS_USB; | 292 | usb_to_input_id(dev, &kbd->dev.id); |
292 | kbd->dev.id.vendor = le16_to_cpu(dev->descriptor.idVendor); | ||
293 | kbd->dev.id.product = le16_to_cpu(dev->descriptor.idProduct); | ||
294 | kbd->dev.id.version = le16_to_cpu(dev->descriptor.bcdDevice); | ||
295 | kbd->dev.dev = &iface->dev; | 293 | kbd->dev.dev = &iface->dev; |
296 | 294 | ||
297 | if (dev->manufacturer) | 295 | if (dev->manufacturer) |
diff --git a/drivers/usb/input/usbmouse.c b/drivers/usb/input/usbmouse.c index 1ec41b5effe6..4104dec847fb 100644 --- a/drivers/usb/input/usbmouse.c +++ b/drivers/usb/input/usbmouse.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/module.h> | 32 | #include <linux/module.h> |
33 | #include <linux/init.h> | 33 | #include <linux/init.h> |
34 | #include <linux/usb.h> | 34 | #include <linux/usb.h> |
35 | #include <linux/usb_input.h> | ||
35 | 36 | ||
36 | /* | 37 | /* |
37 | * Version Information | 38 | * Version Information |
@@ -171,10 +172,7 @@ static int usb_mouse_probe(struct usb_interface * intf, const struct usb_device_ | |||
171 | 172 | ||
172 | mouse->dev.name = mouse->name; | 173 | mouse->dev.name = mouse->name; |
173 | mouse->dev.phys = mouse->phys; | 174 | mouse->dev.phys = mouse->phys; |
174 | mouse->dev.id.bustype = BUS_USB; | 175 | usb_to_input_id(dev, &mouse->dev.id); |
175 | mouse->dev.id.vendor = le16_to_cpu(dev->descriptor.idVendor); | ||
176 | mouse->dev.id.product = le16_to_cpu(dev->descriptor.idProduct); | ||
177 | mouse->dev.id.version = le16_to_cpu(dev->descriptor.bcdDevice); | ||
178 | mouse->dev.dev = &intf->dev; | 176 | mouse->dev.dev = &intf->dev; |
179 | 177 | ||
180 | if (dev->manufacturer) | 178 | if (dev->manufacturer) |
diff --git a/drivers/usb/input/wacom.c b/drivers/usb/input/wacom.c index f6b34af66b3d..02412e31a46b 100644 --- a/drivers/usb/input/wacom.c +++ b/drivers/usb/input/wacom.c | |||
@@ -69,6 +69,7 @@ | |||
69 | #include <linux/module.h> | 69 | #include <linux/module.h> |
70 | #include <linux/init.h> | 70 | #include <linux/init.h> |
71 | #include <linux/usb.h> | 71 | #include <linux/usb.h> |
72 | #include <linux/usb_input.h> | ||
72 | #include <asm/unaligned.h> | 73 | #include <asm/unaligned.h> |
73 | #include <asm/byteorder.h> | 74 | #include <asm/byteorder.h> |
74 | 75 | ||
@@ -823,10 +824,7 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
823 | 824 | ||
824 | wacom->dev.name = wacom->features->name; | 825 | wacom->dev.name = wacom->features->name; |
825 | wacom->dev.phys = wacom->phys; | 826 | wacom->dev.phys = wacom->phys; |
826 | wacom->dev.id.bustype = BUS_USB; | 827 | usb_to_input_id(dev, &wacom->dev.id); |
827 | wacom->dev.id.vendor = le16_to_cpu(dev->descriptor.idVendor); | ||
828 | wacom->dev.id.product = le16_to_cpu(dev->descriptor.idProduct); | ||
829 | wacom->dev.id.version = le16_to_cpu(dev->descriptor.bcdDevice); | ||
830 | wacom->dev.dev = &intf->dev; | 828 | wacom->dev.dev = &intf->dev; |
831 | wacom->usbdev = dev; | 829 | wacom->usbdev = dev; |
832 | 830 | ||
diff --git a/drivers/usb/input/xpad.c b/drivers/usb/input/xpad.c index a7fa1b17dcfe..18125e0bffa2 100644 --- a/drivers/usb/input/xpad.c +++ b/drivers/usb/input/xpad.c | |||
@@ -62,6 +62,7 @@ | |||
62 | #include <linux/module.h> | 62 | #include <linux/module.h> |
63 | #include <linux/smp_lock.h> | 63 | #include <linux/smp_lock.h> |
64 | #include <linux/usb.h> | 64 | #include <linux/usb.h> |
65 | #include <linux/usb_input.h> | ||
65 | 66 | ||
66 | #define DRIVER_VERSION "v0.0.5" | 67 | #define DRIVER_VERSION "v0.0.5" |
67 | #define DRIVER_AUTHOR "Marko Friedemann <mfr@bmx-chemnitz.de>" | 68 | #define DRIVER_AUTHOR "Marko Friedemann <mfr@bmx-chemnitz.de>" |
@@ -256,10 +257,7 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id | |||
256 | 257 | ||
257 | xpad->udev = udev; | 258 | xpad->udev = udev; |
258 | 259 | ||
259 | xpad->dev.id.bustype = BUS_USB; | 260 | usb_to_input_id(udev, &xpad->dev.id); |
260 | xpad->dev.id.vendor = le16_to_cpu(udev->descriptor.idVendor); | ||
261 | xpad->dev.id.product = le16_to_cpu(udev->descriptor.idProduct); | ||
262 | xpad->dev.id.version = le16_to_cpu(udev->descriptor.bcdDevice); | ||
263 | xpad->dev.dev = &intf->dev; | 261 | xpad->dev.dev = &intf->dev; |
264 | xpad->dev.private = xpad; | 262 | xpad->dev.private = xpad; |
265 | xpad->dev.name = xpad_device[i].name; | 263 | xpad->dev.name = xpad_device[i].name; |
diff --git a/drivers/usb/media/konicawc.c b/drivers/usb/media/konicawc.c index 08521a2b4f3d..20ac9e1069d4 100644 --- a/drivers/usb/media/konicawc.c +++ b/drivers/usb/media/konicawc.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/input.h> | 18 | #include <linux/input.h> |
19 | #include <linux/usb_input.h> | ||
19 | 20 | ||
20 | #include "usbvideo.h" | 21 | #include "usbvideo.h" |
21 | 22 | ||
@@ -845,10 +846,7 @@ static int konicawc_probe(struct usb_interface *intf, const struct usb_device_id | |||
845 | cam->input.private = cam; | 846 | cam->input.private = cam; |
846 | cam->input.evbit[0] = BIT(EV_KEY); | 847 | cam->input.evbit[0] = BIT(EV_KEY); |
847 | cam->input.keybit[LONG(BTN_0)] = BIT(BTN_0); | 848 | cam->input.keybit[LONG(BTN_0)] = BIT(BTN_0); |
848 | cam->input.id.bustype = BUS_USB; | 849 | usb_to_input_id(dev, &cam->input.id); |
849 | cam->input.id.vendor = le16_to_cpu(dev->descriptor.idVendor); | ||
850 | cam->input.id.product = le16_to_cpu(dev->descriptor.idProduct); | ||
851 | cam->input.id.version = le16_to_cpu(dev->descriptor.bcdDevice); | ||
852 | input_register_device(&cam->input); | 850 | input_register_device(&cam->input); |
853 | 851 | ||
854 | usb_make_path(dev, cam->input_physname, 56); | 852 | usb_make_path(dev, cam->input_physname, 56); |
diff --git a/drivers/usb/misc/ldusb.c b/drivers/usb/misc/ldusb.c index 66ec88354b93..ad17892aac9e 100644 --- a/drivers/usb/misc/ldusb.c +++ b/drivers/usb/misc/ldusb.c | |||
@@ -23,6 +23,7 @@ | |||
23 | * | 23 | * |
24 | * V0.1 (mh) Initial version | 24 | * V0.1 (mh) Initial version |
25 | * V0.11 (mh) Added raw support for HID 1.0 devices (no interrupt out endpoint) | 25 | * V0.11 (mh) Added raw support for HID 1.0 devices (no interrupt out endpoint) |
26 | * V0.12 (mh) Added kmalloc check for string buffer | ||
26 | */ | 27 | */ |
27 | 28 | ||
28 | #include <linux/config.h> | 29 | #include <linux/config.h> |
@@ -84,7 +85,7 @@ static struct usb_device_id ld_usb_table [] = { | |||
84 | { } /* Terminating entry */ | 85 | { } /* Terminating entry */ |
85 | }; | 86 | }; |
86 | MODULE_DEVICE_TABLE(usb, ld_usb_table); | 87 | MODULE_DEVICE_TABLE(usb, ld_usb_table); |
87 | MODULE_VERSION("V0.11"); | 88 | MODULE_VERSION("V0.12"); |
88 | MODULE_AUTHOR("Michael Hund <mhund@ld-didactic.de>"); | 89 | MODULE_AUTHOR("Michael Hund <mhund@ld-didactic.de>"); |
89 | MODULE_DESCRIPTION("LD USB Driver"); | 90 | MODULE_DESCRIPTION("LD USB Driver"); |
90 | MODULE_LICENSE("GPL"); | 91 | MODULE_LICENSE("GPL"); |
@@ -635,6 +636,10 @@ static int ld_usb_probe(struct usb_interface *intf, const struct usb_device_id * | |||
635 | (le16_to_cpu(udev->descriptor.idProduct) == USB_DEVICE_ID_COM3LAB)) && | 636 | (le16_to_cpu(udev->descriptor.idProduct) == USB_DEVICE_ID_COM3LAB)) && |
636 | (le16_to_cpu(udev->descriptor.bcdDevice) <= 0x103)) { | 637 | (le16_to_cpu(udev->descriptor.bcdDevice) <= 0x103)) { |
637 | buffer = kmalloc(256, GFP_KERNEL); | 638 | buffer = kmalloc(256, GFP_KERNEL); |
639 | if (buffer == NULL) { | ||
640 | dev_err(&intf->dev, "Couldn't allocate string buffer\n"); | ||
641 | goto error; | ||
642 | } | ||
638 | /* usb_string makes SETUP+STALL to leave always ControlReadLoop */ | 643 | /* usb_string makes SETUP+STALL to leave always ControlReadLoop */ |
639 | usb_string(udev, 255, buffer, 256); | 644 | usb_string(udev, 255, buffer, 256); |
640 | kfree(buffer); | 645 | kfree(buffer); |
diff --git a/drivers/usb/mon/Kconfig b/drivers/usb/mon/Kconfig index 777642e26b9a..deb9ddffa402 100644 --- a/drivers/usb/mon/Kconfig +++ b/drivers/usb/mon/Kconfig | |||
@@ -9,9 +9,8 @@ config USB_MON | |||
9 | help | 9 | help |
10 | If you say Y here, a component which captures the USB traffic | 10 | If you say Y here, a component which captures the USB traffic |
11 | between peripheral-specific drivers and HC drivers will be built. | 11 | between peripheral-specific drivers and HC drivers will be built. |
12 | The USB_MON is similar in spirit and may be compatible with Dave | 12 | For more information, see <file:Documentation/usb/usbmon.txt>. |
13 | Harding's USBMon. | ||
14 | 13 | ||
15 | This is somewhat experimental at this time, but it should be safe, | 14 | This is somewhat experimental at this time, but it should be safe. |
16 | as long as you aren't using modular USB and try to remove this | 15 | |
17 | module. | 16 | If unsure, say Y. |
diff --git a/drivers/usb/mon/Makefile b/drivers/usb/mon/Makefile index f18d10ce91f9..b0015b8a1d1f 100644 --- a/drivers/usb/mon/Makefile +++ b/drivers/usb/mon/Makefile | |||
@@ -4,4 +4,5 @@ | |||
4 | 4 | ||
5 | usbmon-objs := mon_main.o mon_stat.o mon_text.o | 5 | usbmon-objs := mon_main.o mon_stat.o mon_text.o |
6 | 6 | ||
7 | # This does not use CONFIG_USB_MON because we want this to use a tristate. | ||
7 | obj-$(CONFIG_USB) += usbmon.o | 8 | obj-$(CONFIG_USB) += usbmon.o |
diff --git a/drivers/usb/net/pegasus.c b/drivers/usb/net/pegasus.c index 5f4496d8dbac..fcd6d3ccef44 100644 --- a/drivers/usb/net/pegasus.c +++ b/drivers/usb/net/pegasus.c | |||
@@ -59,7 +59,6 @@ static const char driver_name[] = "pegasus"; | |||
59 | 59 | ||
60 | static int loopback = 0; | 60 | static int loopback = 0; |
61 | static int mii_mode = 0; | 61 | static int mii_mode = 0; |
62 | static int multicast_filter_limit = 32; | ||
63 | 62 | ||
64 | static struct usb_eth_dev usb_dev_id[] = { | 63 | static struct usb_eth_dev usb_dev_id[] = { |
65 | #define PEGASUS_DEV(pn, vid, pid, flags) \ | 64 | #define PEGASUS_DEV(pn, vid, pid, flags) \ |
diff --git a/drivers/usb/net/rtl8150.c b/drivers/usb/net/rtl8150.c index 626b016addff..59ab40ebb394 100644 --- a/drivers/usb/net/rtl8150.c +++ b/drivers/usb/net/rtl8150.c | |||
@@ -167,8 +167,6 @@ struct rtl8150 { | |||
167 | 167 | ||
168 | typedef struct rtl8150 rtl8150_t; | 168 | typedef struct rtl8150 rtl8150_t; |
169 | 169 | ||
170 | static unsigned long multicast_filter_limit = 32; | ||
171 | |||
172 | static void fill_skb_pool(rtl8150_t *); | 170 | static void fill_skb_pool(rtl8150_t *); |
173 | static void free_skb_pool(rtl8150_t *); | 171 | static void free_skb_pool(rtl8150_t *); |
174 | static inline struct sk_buff *pull_skb(rtl8150_t *); | 172 | static inline struct sk_buff *pull_skb(rtl8150_t *); |
diff --git a/drivers/usb/net/zd1201.c b/drivers/usb/net/zd1201.c index 3b387b005739..29cd801eb958 100644 --- a/drivers/usb/net/zd1201.c +++ b/drivers/usb/net/zd1201.c | |||
@@ -29,6 +29,7 @@ static struct usb_device_id zd1201_table[] = { | |||
29 | {USB_DEVICE(0x0ace, 0x1201)}, /* ZyDAS ZD1201 Wireless USB Adapter */ | 29 | {USB_DEVICE(0x0ace, 0x1201)}, /* ZyDAS ZD1201 Wireless USB Adapter */ |
30 | {USB_DEVICE(0x050d, 0x6051)}, /* Belkin F5D6051 usb adapter */ | 30 | {USB_DEVICE(0x050d, 0x6051)}, /* Belkin F5D6051 usb adapter */ |
31 | {USB_DEVICE(0x0db0, 0x6823)}, /* MSI UB11B usb adapter */ | 31 | {USB_DEVICE(0x0db0, 0x6823)}, /* MSI UB11B usb adapter */ |
32 | {USB_DEVICE(0x1044, 0x8005)}, /* GIGABYTE GN-WLBZ201 usb adapter */ | ||
32 | {} | 33 | {} |
33 | }; | 34 | }; |
34 | 35 | ||
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 0b03ddab53d9..d1964a0c4168 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -429,6 +429,9 @@ static struct usb_device_id id_table_combined [] = { | |||
429 | { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_2_PID) }, | 429 | { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_2_PID) }, |
430 | { USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) }, | 430 | { USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) }, |
431 | { USB_DEVICE(FTDI_VID, FTDI_ACTIVE_ROBOTS_PID) }, | 431 | { USB_DEVICE(FTDI_VID, FTDI_ACTIVE_ROBOTS_PID) }, |
432 | { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y6_PID) }, | ||
433 | { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y8_PID) }, | ||
434 | { USB_DEVICE(EVOLUTION_VID, EVOLUTION_ER1_PID) }, | ||
432 | { } /* Terminating entry */ | 435 | { } /* Terminating entry */ |
433 | }; | 436 | }; |
434 | 437 | ||
@@ -545,6 +548,7 @@ static struct usb_serial_device_type ftdi_sio_device = { | |||
545 | 548 | ||
546 | 549 | ||
547 | #define WDR_TIMEOUT 5000 /* default urb timeout */ | 550 | #define WDR_TIMEOUT 5000 /* default urb timeout */ |
551 | #define WDR_SHORT_TIMEOUT 1000 /* shorter urb timeout */ | ||
548 | 552 | ||
549 | /* High and low are for DTR, RTS etc etc */ | 553 | /* High and low are for DTR, RTS etc etc */ |
550 | #define HIGH 1 | 554 | #define HIGH 1 |
@@ -593,62 +597,59 @@ static __u32 ftdi_232bm_baud_to_divisor(int baud) | |||
593 | return(ftdi_232bm_baud_base_to_divisor(baud, 48000000)); | 597 | return(ftdi_232bm_baud_base_to_divisor(baud, 48000000)); |
594 | } | 598 | } |
595 | 599 | ||
596 | static int set_rts(struct usb_serial_port *port, int high_or_low) | 600 | #define set_mctrl(port, set) update_mctrl((port), (set), 0) |
601 | #define clear_mctrl(port, clear) update_mctrl((port), 0, (clear)) | ||
602 | |||
603 | static int update_mctrl(struct usb_serial_port *port, unsigned int set, unsigned int clear) | ||
597 | { | 604 | { |
598 | struct ftdi_private *priv = usb_get_serial_port_data(port); | 605 | struct ftdi_private *priv = usb_get_serial_port_data(port); |
599 | char *buf; | 606 | char *buf; |
600 | unsigned ftdi_high_or_low; | 607 | unsigned urb_value; |
601 | int rv; | 608 | int rv; |
602 | |||
603 | buf = kmalloc(1, GFP_NOIO); | ||
604 | if (!buf) | ||
605 | return -ENOMEM; | ||
606 | |||
607 | if (high_or_low) { | ||
608 | ftdi_high_or_low = FTDI_SIO_SET_RTS_HIGH; | ||
609 | priv->last_dtr_rts |= TIOCM_RTS; | ||
610 | } else { | ||
611 | ftdi_high_or_low = FTDI_SIO_SET_RTS_LOW; | ||
612 | priv->last_dtr_rts &= ~TIOCM_RTS; | ||
613 | } | ||
614 | rv = usb_control_msg(port->serial->dev, | ||
615 | usb_sndctrlpipe(port->serial->dev, 0), | ||
616 | FTDI_SIO_SET_MODEM_CTRL_REQUEST, | ||
617 | FTDI_SIO_SET_MODEM_CTRL_REQUEST_TYPE, | ||
618 | ftdi_high_or_low, priv->interface, | ||
619 | buf, 0, WDR_TIMEOUT); | ||
620 | |||
621 | kfree(buf); | ||
622 | return rv; | ||
623 | } | ||
624 | 609 | ||
610 | if (((set | clear) & (TIOCM_DTR | TIOCM_RTS)) == 0) { | ||
611 | dbg("%s - DTR|RTS not being set|cleared", __FUNCTION__); | ||
612 | return 0; /* no change */ | ||
613 | } | ||
625 | 614 | ||
626 | static int set_dtr(struct usb_serial_port *port, int high_or_low) | ||
627 | { | ||
628 | struct ftdi_private *priv = usb_get_serial_port_data(port); | ||
629 | char *buf; | ||
630 | unsigned ftdi_high_or_low; | ||
631 | int rv; | ||
632 | |||
633 | buf = kmalloc(1, GFP_NOIO); | 615 | buf = kmalloc(1, GFP_NOIO); |
634 | if (!buf) | 616 | if (!buf) { |
635 | return -ENOMEM; | 617 | return -ENOMEM; |
636 | |||
637 | if (high_or_low) { | ||
638 | ftdi_high_or_low = FTDI_SIO_SET_DTR_HIGH; | ||
639 | priv->last_dtr_rts |= TIOCM_DTR; | ||
640 | } else { | ||
641 | ftdi_high_or_low = FTDI_SIO_SET_DTR_LOW; | ||
642 | priv->last_dtr_rts &= ~TIOCM_DTR; | ||
643 | } | 618 | } |
619 | |||
620 | clear &= ~set; /* 'set' takes precedence over 'clear' */ | ||
621 | urb_value = 0; | ||
622 | if (clear & TIOCM_DTR) | ||
623 | urb_value |= FTDI_SIO_SET_DTR_LOW; | ||
624 | if (clear & TIOCM_RTS) | ||
625 | urb_value |= FTDI_SIO_SET_RTS_LOW; | ||
626 | if (set & TIOCM_DTR) | ||
627 | urb_value |= FTDI_SIO_SET_DTR_HIGH; | ||
628 | if (set & TIOCM_RTS) | ||
629 | urb_value |= FTDI_SIO_SET_RTS_HIGH; | ||
644 | rv = usb_control_msg(port->serial->dev, | 630 | rv = usb_control_msg(port->serial->dev, |
645 | usb_sndctrlpipe(port->serial->dev, 0), | 631 | usb_sndctrlpipe(port->serial->dev, 0), |
646 | FTDI_SIO_SET_MODEM_CTRL_REQUEST, | 632 | FTDI_SIO_SET_MODEM_CTRL_REQUEST, |
647 | FTDI_SIO_SET_MODEM_CTRL_REQUEST_TYPE, | 633 | FTDI_SIO_SET_MODEM_CTRL_REQUEST_TYPE, |
648 | ftdi_high_or_low, priv->interface, | 634 | urb_value, priv->interface, |
649 | buf, 0, WDR_TIMEOUT); | 635 | buf, 0, WDR_TIMEOUT); |
650 | 636 | ||
651 | kfree(buf); | 637 | kfree(buf); |
638 | if (rv < 0) { | ||
639 | err("%s Error from MODEM_CTRL urb: DTR %s, RTS %s", | ||
640 | __FUNCTION__, | ||
641 | (set & TIOCM_DTR) ? "HIGH" : | ||
642 | (clear & TIOCM_DTR) ? "LOW" : "unchanged", | ||
643 | (set & TIOCM_RTS) ? "HIGH" : | ||
644 | (clear & TIOCM_RTS) ? "LOW" : "unchanged"); | ||
645 | } else { | ||
646 | dbg("%s - DTR %s, RTS %s", __FUNCTION__, | ||
647 | (set & TIOCM_DTR) ? "HIGH" : | ||
648 | (clear & TIOCM_DTR) ? "LOW" : "unchanged", | ||
649 | (set & TIOCM_RTS) ? "HIGH" : | ||
650 | (clear & TIOCM_RTS) ? "LOW" : "unchanged"); | ||
651 | priv->last_dtr_rts = (priv->last_dtr_rts & ~clear) | set; | ||
652 | } | ||
652 | return rv; | 653 | return rv; |
653 | } | 654 | } |
654 | 655 | ||
@@ -681,7 +682,7 @@ static int change_speed(struct usb_serial_port *port) | |||
681 | FTDI_SIO_SET_BAUDRATE_REQUEST, | 682 | FTDI_SIO_SET_BAUDRATE_REQUEST, |
682 | FTDI_SIO_SET_BAUDRATE_REQUEST_TYPE, | 683 | FTDI_SIO_SET_BAUDRATE_REQUEST_TYPE, |
683 | urb_value, urb_index, | 684 | urb_value, urb_index, |
684 | buf, 0, 100); | 685 | buf, 0, WDR_SHORT_TIMEOUT); |
685 | 686 | ||
686 | kfree(buf); | 687 | kfree(buf); |
687 | return rv; | 688 | return rv; |
@@ -1219,12 +1220,7 @@ static int ftdi_open (struct usb_serial_port *port, struct file *filp) | |||
1219 | /* FIXME: Flow control might be enabled, so it should be checked - | 1220 | /* FIXME: Flow control might be enabled, so it should be checked - |
1220 | we have no control of defaults! */ | 1221 | we have no control of defaults! */ |
1221 | /* Turn on RTS and DTR since we are not flow controlling by default */ | 1222 | /* Turn on RTS and DTR since we are not flow controlling by default */ |
1222 | if (set_dtr(port, HIGH) < 0) { | 1223 | set_mctrl(port, TIOCM_DTR | TIOCM_RTS); |
1223 | err("%s Error from DTR HIGH urb", __FUNCTION__); | ||
1224 | } | ||
1225 | if (set_rts(port, HIGH) < 0){ | ||
1226 | err("%s Error from RTS HIGH urb", __FUNCTION__); | ||
1227 | } | ||
1228 | 1224 | ||
1229 | /* Not throttled */ | 1225 | /* Not throttled */ |
1230 | spin_lock_irqsave(&priv->rx_lock, flags); | 1226 | spin_lock_irqsave(&priv->rx_lock, flags); |
@@ -1274,14 +1270,8 @@ static void ftdi_close (struct usb_serial_port *port, struct file *filp) | |||
1274 | err("error from flowcontrol urb"); | 1270 | err("error from flowcontrol urb"); |
1275 | } | 1271 | } |
1276 | 1272 | ||
1277 | /* drop DTR */ | 1273 | /* drop RTS and DTR */ |
1278 | if (set_dtr(port, LOW) < 0){ | 1274 | clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); |
1279 | err("Error from DTR LOW urb"); | ||
1280 | } | ||
1281 | /* drop RTS */ | ||
1282 | if (set_rts(port, LOW) < 0) { | ||
1283 | err("Error from RTS LOW urb"); | ||
1284 | } | ||
1285 | } /* Note change no line if hupcl is off */ | 1275 | } /* Note change no line if hupcl is off */ |
1286 | 1276 | ||
1287 | /* cancel any scheduled reading */ | 1277 | /* cancel any scheduled reading */ |
@@ -1797,7 +1787,7 @@ static void ftdi_set_termios (struct usb_serial_port *port, struct termios *old_ | |||
1797 | FTDI_SIO_SET_DATA_REQUEST, | 1787 | FTDI_SIO_SET_DATA_REQUEST, |
1798 | FTDI_SIO_SET_DATA_REQUEST_TYPE, | 1788 | FTDI_SIO_SET_DATA_REQUEST_TYPE, |
1799 | urb_value , priv->interface, | 1789 | urb_value , priv->interface, |
1800 | buf, 0, 100) < 0) { | 1790 | buf, 0, WDR_SHORT_TIMEOUT) < 0) { |
1801 | err("%s FAILED to set databits/stopbits/parity", __FUNCTION__); | 1791 | err("%s FAILED to set databits/stopbits/parity", __FUNCTION__); |
1802 | } | 1792 | } |
1803 | 1793 | ||
@@ -1812,25 +1802,14 @@ static void ftdi_set_termios (struct usb_serial_port *port, struct termios *old_ | |||
1812 | err("%s error from disable flowcontrol urb", __FUNCTION__); | 1802 | err("%s error from disable flowcontrol urb", __FUNCTION__); |
1813 | } | 1803 | } |
1814 | /* Drop RTS and DTR */ | 1804 | /* Drop RTS and DTR */ |
1815 | if (set_dtr(port, LOW) < 0){ | 1805 | clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); |
1816 | err("%s Error from DTR LOW urb", __FUNCTION__); | ||
1817 | } | ||
1818 | if (set_rts(port, LOW) < 0){ | ||
1819 | err("%s Error from RTS LOW urb", __FUNCTION__); | ||
1820 | } | ||
1821 | |||
1822 | } else { | 1806 | } else { |
1823 | /* set the baudrate determined before */ | 1807 | /* set the baudrate determined before */ |
1824 | if (change_speed(port)) { | 1808 | if (change_speed(port)) { |
1825 | err("%s urb failed to set baurdrate", __FUNCTION__); | 1809 | err("%s urb failed to set baurdrate", __FUNCTION__); |
1826 | } | 1810 | } |
1827 | /* Ensure RTS and DTR are raised */ | 1811 | /* Ensure RTS and DTR are raised */ |
1828 | else if (set_dtr(port, HIGH) < 0){ | 1812 | set_mctrl(port, TIOCM_DTR | TIOCM_RTS); |
1829 | err("%s Error from DTR HIGH urb", __FUNCTION__); | ||
1830 | } | ||
1831 | else if (set_rts(port, HIGH) < 0){ | ||
1832 | err("%s Error from RTS HIGH urb", __FUNCTION__); | ||
1833 | } | ||
1834 | } | 1813 | } |
1835 | 1814 | ||
1836 | /* Set flow control */ | 1815 | /* Set flow control */ |
@@ -1942,35 +1921,8 @@ static int ftdi_tiocmget (struct usb_serial_port *port, struct file *file) | |||
1942 | 1921 | ||
1943 | static int ftdi_tiocmset(struct usb_serial_port *port, struct file * file, unsigned int set, unsigned int clear) | 1922 | static int ftdi_tiocmset(struct usb_serial_port *port, struct file * file, unsigned int set, unsigned int clear) |
1944 | { | 1923 | { |
1945 | int ret; | ||
1946 | |||
1947 | dbg("%s TIOCMSET", __FUNCTION__); | 1924 | dbg("%s TIOCMSET", __FUNCTION__); |
1948 | if (set & TIOCM_DTR){ | 1925 | return update_mctrl(port, set, clear); |
1949 | if ((ret = set_dtr(port, HIGH)) < 0) { | ||
1950 | err("Urb to set DTR failed"); | ||
1951 | return(ret); | ||
1952 | } | ||
1953 | } | ||
1954 | if (set & TIOCM_RTS) { | ||
1955 | if ((ret = set_rts(port, HIGH)) < 0){ | ||
1956 | err("Urb to set RTS failed"); | ||
1957 | return(ret); | ||
1958 | } | ||
1959 | } | ||
1960 | |||
1961 | if (clear & TIOCM_DTR){ | ||
1962 | if ((ret = set_dtr(port, LOW)) < 0){ | ||
1963 | err("Urb to unset DTR failed"); | ||
1964 | return(ret); | ||
1965 | } | ||
1966 | } | ||
1967 | if (clear & TIOCM_RTS) { | ||
1968 | if ((ret = set_rts(port, LOW)) < 0){ | ||
1969 | err("Urb to unset RTS failed"); | ||
1970 | return(ret); | ||
1971 | } | ||
1972 | } | ||
1973 | return(0); | ||
1974 | } | 1926 | } |
1975 | 1927 | ||
1976 | 1928 | ||
diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h index 8866376823a5..9f4342093e8b 100644 --- a/drivers/usb/serial/ftdi_sio.h +++ b/drivers/usb/serial/ftdi_sio.h | |||
@@ -265,10 +265,24 @@ | |||
265 | #define MOBILITY_USB_SERIAL_PID 0x0202 /* EasiDock USB 200 serial */ | 265 | #define MOBILITY_USB_SERIAL_PID 0x0202 /* EasiDock USB 200 serial */ |
266 | 266 | ||
267 | /* | 267 | /* |
268 | * microHAM product IDs (http://www.microham.com). | ||
269 | * Submitted by Justin Burket (KL1RL) <zorton@jtan.com>. | ||
270 | */ | ||
271 | #define FTDI_MHAM_Y6_PID 0xEEEA /* USB-Y6 interface */ | ||
272 | #define FTDI_MHAM_Y8_PID 0xEEEB /* USB-Y8 interface */ | ||
273 | |||
274 | /* | ||
268 | * Active Robots product ids. | 275 | * Active Robots product ids. |
269 | */ | 276 | */ |
270 | #define FTDI_ACTIVE_ROBOTS_PID 0xE548 /* USB comms board */ | 277 | #define FTDI_ACTIVE_ROBOTS_PID 0xE548 /* USB comms board */ |
271 | 278 | ||
279 | /* | ||
280 | * Evolution Robotics products (http://www.evolution.com/). | ||
281 | * Submitted by Shawn M. Lavelle. | ||
282 | */ | ||
283 | #define EVOLUTION_VID 0xDEEE /* Vendor ID */ | ||
284 | #define EVOLUTION_ER1_PID 0x0300 /* ER1 Control Module */ | ||
285 | |||
272 | /* Commands */ | 286 | /* Commands */ |
273 | #define FTDI_SIO_RESET 0 /* Reset the port */ | 287 | #define FTDI_SIO_RESET 0 /* Reset the port */ |
274 | #define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */ | 288 | #define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */ |
diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c index 6051a646fe69..353f24d45bc1 100644 --- a/drivers/usb/usb-skeleton.c +++ b/drivers/usb/usb-skeleton.c | |||
@@ -257,7 +257,8 @@ static int skel_probe(struct usb_interface *interface, const struct usb_device_i | |||
257 | endpoint = &iface_desc->endpoint[i].desc; | 257 | endpoint = &iface_desc->endpoint[i].desc; |
258 | 258 | ||
259 | if (!dev->bulk_in_endpointAddr && | 259 | if (!dev->bulk_in_endpointAddr && |
260 | (endpoint->bEndpointAddress & USB_DIR_IN) && | 260 | ((endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK) |
261 | == USB_DIR_IN) && | ||
261 | ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) | 262 | ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) |
262 | == USB_ENDPOINT_XFER_BULK)) { | 263 | == USB_ENDPOINT_XFER_BULK)) { |
263 | /* we found a bulk in endpoint */ | 264 | /* we found a bulk in endpoint */ |
@@ -272,7 +273,8 @@ static int skel_probe(struct usb_interface *interface, const struct usb_device_i | |||
272 | } | 273 | } |
273 | 274 | ||
274 | if (!dev->bulk_out_endpointAddr && | 275 | if (!dev->bulk_out_endpointAddr && |
275 | !(endpoint->bEndpointAddress & USB_DIR_OUT) && | 276 | ((endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK) |
277 | == USB_DIR_OUT) && | ||
276 | ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) | 278 | ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) |
277 | == USB_ENDPOINT_XFER_BULK)) { | 279 | == USB_ENDPOINT_XFER_BULK)) { |
278 | /* we found a bulk out endpoint */ | 280 | /* we found a bulk out endpoint */ |