diff options
Diffstat (limited to 'drivers/usb')
44 files changed, 365 insertions, 185 deletions
diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile index c691eea51537..f5ed3d75fa5a 100644 --- a/drivers/usb/Makefile +++ b/drivers/usb/Makefile | |||
@@ -46,7 +46,7 @@ obj-$(CONFIG_USB_MICROTEK) += image/ | |||
46 | obj-$(CONFIG_USB_SERIAL) += serial/ | 46 | obj-$(CONFIG_USB_SERIAL) += serial/ |
47 | 47 | ||
48 | obj-$(CONFIG_USB) += misc/ | 48 | obj-$(CONFIG_USB) += misc/ |
49 | obj-$(CONFIG_USB) += phy/ | 49 | obj-$(CONFIG_USB_COMMON) += phy/ |
50 | obj-$(CONFIG_EARLY_PRINTK_DBGP) += early/ | 50 | obj-$(CONFIG_EARLY_PRINTK_DBGP) += early/ |
51 | 51 | ||
52 | obj-$(CONFIG_USB_ATM) += atm/ | 52 | obj-$(CONFIG_USB_ATM) += atm/ |
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index f2a120eea9d4..36a2a0b7b82c 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -567,6 +567,14 @@ static int acm_port_activate(struct tty_port *port, struct tty_struct *tty) | |||
567 | 567 | ||
568 | usb_autopm_put_interface(acm->control); | 568 | usb_autopm_put_interface(acm->control); |
569 | 569 | ||
570 | /* | ||
571 | * Unthrottle device in case the TTY was closed while throttled. | ||
572 | */ | ||
573 | spin_lock_irq(&acm->read_lock); | ||
574 | acm->throttled = 0; | ||
575 | acm->throttle_req = 0; | ||
576 | spin_unlock_irq(&acm->read_lock); | ||
577 | |||
570 | if (acm_submit_read_urbs(acm, GFP_KERNEL)) | 578 | if (acm_submit_read_urbs(acm, GFP_KERNEL)) |
571 | goto error_submit_read_urbs; | 579 | goto error_submit_read_urbs; |
572 | 580 | ||
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index ea8b304f0e85..8fd398dffced 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c | |||
@@ -55,6 +55,15 @@ static const struct usb_device_id wdm_ids[] = { | |||
55 | .bInterfaceSubClass = 1, | 55 | .bInterfaceSubClass = 1, |
56 | .bInterfaceProtocol = 9, /* NOTE: CDC ECM control interface! */ | 56 | .bInterfaceProtocol = 9, /* NOTE: CDC ECM control interface! */ |
57 | }, | 57 | }, |
58 | { | ||
59 | /* Vodafone/Huawei K5005 (12d1:14c8) and similar modems */ | ||
60 | .match_flags = USB_DEVICE_ID_MATCH_VENDOR | | ||
61 | USB_DEVICE_ID_MATCH_INT_INFO, | ||
62 | .idVendor = HUAWEI_VENDOR_ID, | ||
63 | .bInterfaceClass = USB_CLASS_VENDOR_SPEC, | ||
64 | .bInterfaceSubClass = 1, | ||
65 | .bInterfaceProtocol = 57, /* NOTE: CDC ECM control interface! */ | ||
66 | }, | ||
58 | { } | 67 | { } |
59 | }; | 68 | }; |
60 | 69 | ||
diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c index 57ed9e400c06..622b4a48e732 100644 --- a/drivers/usb/core/hcd-pci.c +++ b/drivers/usb/core/hcd-pci.c | |||
@@ -493,15 +493,6 @@ static int hcd_pci_suspend_noirq(struct device *dev) | |||
493 | 493 | ||
494 | pci_save_state(pci_dev); | 494 | pci_save_state(pci_dev); |
495 | 495 | ||
496 | /* | ||
497 | * Some systems crash if an EHCI controller is in D3 during | ||
498 | * a sleep transition. We have to leave such controllers in D0. | ||
499 | */ | ||
500 | if (hcd->broken_pci_sleep) { | ||
501 | dev_dbg(dev, "Staying in PCI D0\n"); | ||
502 | return retval; | ||
503 | } | ||
504 | |||
505 | /* If the root hub is dead rather than suspended, disallow remote | 496 | /* If the root hub is dead rather than suspended, disallow remote |
506 | * wakeup. usb_hc_died() should ensure that both hosts are marked as | 497 | * wakeup. usb_hc_died() should ensure that both hosts are marked as |
507 | * dying, so we only need to check the primary roothub. | 498 | * dying, so we only need to check the primary roothub. |
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 04fb834c3fa1..25a7422ee657 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -3379,7 +3379,7 @@ int usb_disable_lpm(struct usb_device *udev) | |||
3379 | return 0; | 3379 | return 0; |
3380 | 3380 | ||
3381 | udev->lpm_disable_count++; | 3381 | udev->lpm_disable_count++; |
3382 | if ((udev->u1_params.timeout == 0 && udev->u1_params.timeout == 0)) | 3382 | if ((udev->u1_params.timeout == 0 && udev->u2_params.timeout == 0)) |
3383 | return 0; | 3383 | return 0; |
3384 | 3384 | ||
3385 | /* If LPM is enabled, attempt to disable it. */ | 3385 | /* If LPM is enabled, attempt to disable it. */ |
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index b548cf1dbc62..bdd1c6749d88 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c | |||
@@ -1838,7 +1838,6 @@ free_interfaces: | |||
1838 | intfc = cp->intf_cache[i]; | 1838 | intfc = cp->intf_cache[i]; |
1839 | intf->altsetting = intfc->altsetting; | 1839 | intf->altsetting = intfc->altsetting; |
1840 | intf->num_altsetting = intfc->num_altsetting; | 1840 | intf->num_altsetting = intfc->num_altsetting; |
1841 | intf->intf_assoc = find_iad(dev, cp, i); | ||
1842 | kref_get(&intfc->ref); | 1841 | kref_get(&intfc->ref); |
1843 | 1842 | ||
1844 | alt = usb_altnum_to_altsetting(intf, 0); | 1843 | alt = usb_altnum_to_altsetting(intf, 0); |
@@ -1851,6 +1850,8 @@ free_interfaces: | |||
1851 | if (!alt) | 1850 | if (!alt) |
1852 | alt = &intf->altsetting[0]; | 1851 | alt = &intf->altsetting[0]; |
1853 | 1852 | ||
1853 | intf->intf_assoc = | ||
1854 | find_iad(dev, cp, alt->desc.bInterfaceNumber); | ||
1854 | intf->cur_altsetting = alt; | 1855 | intf->cur_altsetting = alt; |
1855 | usb_enable_interface(dev, intf, true); | 1856 | usb_enable_interface(dev, intf, true); |
1856 | intf->dev.parent = &dev->dev; | 1857 | intf->dev.parent = &dev->dev; |
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 3df1a1973b05..ec70df7aba17 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c | |||
@@ -1091,7 +1091,7 @@ static int dwc3_gadget_ep_dequeue(struct usb_ep *ep, | |||
1091 | if (r == req) { | 1091 | if (r == req) { |
1092 | /* wait until it is processed */ | 1092 | /* wait until it is processed */ |
1093 | dwc3_stop_active_transfer(dwc, dep->number); | 1093 | dwc3_stop_active_transfer(dwc, dep->number); |
1094 | goto out0; | 1094 | goto out1; |
1095 | } | 1095 | } |
1096 | dev_err(dwc->dev, "request %p was not queued to %s\n", | 1096 | dev_err(dwc->dev, "request %p was not queued to %s\n", |
1097 | request, ep->name); | 1097 | request, ep->name); |
@@ -1099,6 +1099,7 @@ static int dwc3_gadget_ep_dequeue(struct usb_ep *ep, | |||
1099 | goto out0; | 1099 | goto out0; |
1100 | } | 1100 | } |
1101 | 1101 | ||
1102 | out1: | ||
1102 | /* giveback the request */ | 1103 | /* giveback the request */ |
1103 | dwc3_gadget_giveback(dep, req, -ECONNRESET); | 1104 | dwc3_gadget_giveback(dep, req, -ECONNRESET); |
1104 | 1105 | ||
diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c index e23bf7984aaf..9a9bced813ed 100644 --- a/drivers/usb/gadget/atmel_usba_udc.c +++ b/drivers/usb/gadget/atmel_usba_udc.c | |||
@@ -599,12 +599,6 @@ usba_ep_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc) | |||
599 | 599 | ||
600 | spin_lock_irqsave(&ep->udc->lock, flags); | 600 | spin_lock_irqsave(&ep->udc->lock, flags); |
601 | 601 | ||
602 | if (ep->ep.desc) { | ||
603 | spin_unlock_irqrestore(&ep->udc->lock, flags); | ||
604 | DBG(DBG_ERR, "ep%d already enabled\n", ep->index); | ||
605 | return -EBUSY; | ||
606 | } | ||
607 | |||
608 | ep->ep.desc = desc; | 602 | ep->ep.desc = desc; |
609 | ep->ep.maxpacket = maxpacket; | 603 | ep->ep.maxpacket = maxpacket; |
610 | 604 | ||
diff --git a/drivers/usb/gadget/fsl_qe_udc.c b/drivers/usb/gadget/fsl_qe_udc.c index 51881f3bd07a..b09452d6f33a 100644 --- a/drivers/usb/gadget/fsl_qe_udc.c +++ b/drivers/usb/gadget/fsl_qe_udc.c | |||
@@ -1596,7 +1596,7 @@ static int qe_ep_enable(struct usb_ep *_ep, | |||
1596 | ep = container_of(_ep, struct qe_ep, ep); | 1596 | ep = container_of(_ep, struct qe_ep, ep); |
1597 | 1597 | ||
1598 | /* catch various bogus parameters */ | 1598 | /* catch various bogus parameters */ |
1599 | if (!_ep || !desc || ep->ep.desc || _ep->name == ep_name[0] || | 1599 | if (!_ep || !desc || _ep->name == ep_name[0] || |
1600 | (desc->bDescriptorType != USB_DT_ENDPOINT)) | 1600 | (desc->bDescriptorType != USB_DT_ENDPOINT)) |
1601 | return -EINVAL; | 1601 | return -EINVAL; |
1602 | 1602 | ||
diff --git a/drivers/usb/gadget/fsl_qe_udc.h b/drivers/usb/gadget/fsl_qe_udc.h index 4c07ca9cebf3..7026919fc901 100644 --- a/drivers/usb/gadget/fsl_qe_udc.h +++ b/drivers/usb/gadget/fsl_qe_udc.h | |||
@@ -153,10 +153,10 @@ struct usb_ep_para{ | |||
153 | #define USB_BUSMODE_DTB 0x02 | 153 | #define USB_BUSMODE_DTB 0x02 |
154 | 154 | ||
155 | /* Endpoint basic handle */ | 155 | /* Endpoint basic handle */ |
156 | #define ep_index(EP) ((EP)->desc->bEndpointAddress & 0xF) | 156 | #define ep_index(EP) ((EP)->ep.desc->bEndpointAddress & 0xF) |
157 | #define ep_maxpacket(EP) ((EP)->ep.maxpacket) | 157 | #define ep_maxpacket(EP) ((EP)->ep.maxpacket) |
158 | #define ep_is_in(EP) ((ep_index(EP) == 0) ? (EP->udc->ep0_dir == \ | 158 | #define ep_is_in(EP) ((ep_index(EP) == 0) ? (EP->udc->ep0_dir == \ |
159 | USB_DIR_IN) : ((EP)->desc->bEndpointAddress \ | 159 | USB_DIR_IN) : ((EP)->ep.desc->bEndpointAddress \ |
160 | & USB_DIR_IN) == USB_DIR_IN) | 160 | & USB_DIR_IN) == USB_DIR_IN) |
161 | 161 | ||
162 | /* ep0 transfer state */ | 162 | /* ep0 transfer state */ |
diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c index 28316858208b..bc6f9bb9994a 100644 --- a/drivers/usb/gadget/fsl_udc_core.c +++ b/drivers/usb/gadget/fsl_udc_core.c | |||
@@ -567,7 +567,7 @@ static int fsl_ep_enable(struct usb_ep *_ep, | |||
567 | ep = container_of(_ep, struct fsl_ep, ep); | 567 | ep = container_of(_ep, struct fsl_ep, ep); |
568 | 568 | ||
569 | /* catch various bogus parameters */ | 569 | /* catch various bogus parameters */ |
570 | if (!_ep || !desc || ep->ep.desc | 570 | if (!_ep || !desc |
571 | || (desc->bDescriptorType != USB_DT_ENDPOINT)) | 571 | || (desc->bDescriptorType != USB_DT_ENDPOINT)) |
572 | return -EINVAL; | 572 | return -EINVAL; |
573 | 573 | ||
@@ -2575,7 +2575,7 @@ static int __init fsl_udc_probe(struct platform_device *pdev) | |||
2575 | /* for ep0: the desc defined here; | 2575 | /* for ep0: the desc defined here; |
2576 | * for other eps, gadget layer called ep_enable with defined desc | 2576 | * for other eps, gadget layer called ep_enable with defined desc |
2577 | */ | 2577 | */ |
2578 | udc_controller->eps[0].desc = &fsl_ep0_desc; | 2578 | udc_controller->eps[0].ep.desc = &fsl_ep0_desc; |
2579 | udc_controller->eps[0].ep.maxpacket = USB_MAX_CTRL_PAYLOAD; | 2579 | udc_controller->eps[0].ep.maxpacket = USB_MAX_CTRL_PAYLOAD; |
2580 | 2580 | ||
2581 | /* setup the udc->eps[] for non-control endpoints and link | 2581 | /* setup the udc->eps[] for non-control endpoints and link |
diff --git a/drivers/usb/gadget/fsl_usb2_udc.h b/drivers/usb/gadget/fsl_usb2_udc.h index 5cd7b7e7ddb4..f61a967f7082 100644 --- a/drivers/usb/gadget/fsl_usb2_udc.h +++ b/drivers/usb/gadget/fsl_usb2_udc.h | |||
@@ -568,10 +568,10 @@ static void dump_msg(const char *label, const u8 * buf, unsigned int length) | |||
568 | /* | 568 | /* |
569 | * ### internal used help routines. | 569 | * ### internal used help routines. |
570 | */ | 570 | */ |
571 | #define ep_index(EP) ((EP)->desc->bEndpointAddress&0xF) | 571 | #define ep_index(EP) ((EP)->ep.desc->bEndpointAddress&0xF) |
572 | #define ep_maxpacket(EP) ((EP)->ep.maxpacket) | 572 | #define ep_maxpacket(EP) ((EP)->ep.maxpacket) |
573 | #define ep_is_in(EP) ( (ep_index(EP) == 0) ? (EP->udc->ep0_dir == \ | 573 | #define ep_is_in(EP) ( (ep_index(EP) == 0) ? (EP->udc->ep0_dir == \ |
574 | USB_DIR_IN ):((EP)->desc->bEndpointAddress \ | 574 | USB_DIR_IN) : ((EP)->ep.desc->bEndpointAddress \ |
575 | & USB_DIR_IN)==USB_DIR_IN) | 575 | & USB_DIR_IN)==USB_DIR_IN) |
576 | #define get_ep_by_pipe(udc, pipe) ((pipe == 1)? &udc->eps[0]: \ | 576 | #define get_ep_by_pipe(udc, pipe) ((pipe == 1)? &udc->eps[0]: \ |
577 | &udc->eps[pipe]) | 577 | &udc->eps[pipe]) |
diff --git a/drivers/usb/gadget/goku_udc.c b/drivers/usb/gadget/goku_udc.c index b241e6c6a7f2..3d28fb976c78 100644 --- a/drivers/usb/gadget/goku_udc.c +++ b/drivers/usb/gadget/goku_udc.c | |||
@@ -102,7 +102,7 @@ goku_ep_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc) | |||
102 | unsigned long flags; | 102 | unsigned long flags; |
103 | 103 | ||
104 | ep = container_of(_ep, struct goku_ep, ep); | 104 | ep = container_of(_ep, struct goku_ep, ep); |
105 | if (!_ep || !desc || ep->ep.desc | 105 | if (!_ep || !desc |
106 | || desc->bDescriptorType != USB_DT_ENDPOINT) | 106 | || desc->bDescriptorType != USB_DT_ENDPOINT) |
107 | return -EINVAL; | 107 | return -EINVAL; |
108 | dev = ep->dev; | 108 | dev = ep->dev; |
diff --git a/drivers/usb/gadget/lpc32xx_udc.c b/drivers/usb/gadget/lpc32xx_udc.c index 262acfd53e32..2ab0388d93eb 100644 --- a/drivers/usb/gadget/lpc32xx_udc.c +++ b/drivers/usb/gadget/lpc32xx_udc.c | |||
@@ -61,6 +61,7 @@ | |||
61 | #include <mach/irqs.h> | 61 | #include <mach/irqs.h> |
62 | #include <mach/board.h> | 62 | #include <mach/board.h> |
63 | #ifdef CONFIG_USB_GADGET_DEBUG_FILES | 63 | #ifdef CONFIG_USB_GADGET_DEBUG_FILES |
64 | #include <linux/debugfs.h> | ||
64 | #include <linux/seq_file.h> | 65 | #include <linux/seq_file.h> |
65 | #endif | 66 | #endif |
66 | 67 | ||
diff --git a/drivers/usb/gadget/mv_udc_core.c b/drivers/usb/gadget/mv_udc_core.c index dbcd1329495e..117a4bba1b8c 100644 --- a/drivers/usb/gadget/mv_udc_core.c +++ b/drivers/usb/gadget/mv_udc_core.c | |||
@@ -464,7 +464,7 @@ static int mv_ep_enable(struct usb_ep *_ep, | |||
464 | ep = container_of(_ep, struct mv_ep, ep); | 464 | ep = container_of(_ep, struct mv_ep, ep); |
465 | udc = ep->udc; | 465 | udc = ep->udc; |
466 | 466 | ||
467 | if (!_ep || !desc || ep->ep.desc | 467 | if (!_ep || !desc |
468 | || desc->bDescriptorType != USB_DT_ENDPOINT) | 468 | || desc->bDescriptorType != USB_DT_ENDPOINT) |
469 | return -EINVAL; | 469 | return -EINVAL; |
470 | 470 | ||
diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c index 7ba32469c5bd..a460e8c204f4 100644 --- a/drivers/usb/gadget/omap_udc.c +++ b/drivers/usb/gadget/omap_udc.c | |||
@@ -153,7 +153,7 @@ static int omap_ep_enable(struct usb_ep *_ep, | |||
153 | u16 maxp; | 153 | u16 maxp; |
154 | 154 | ||
155 | /* catch various bogus parameters */ | 155 | /* catch various bogus parameters */ |
156 | if (!_ep || !desc || ep->ep.desc | 156 | if (!_ep || !desc |
157 | || desc->bDescriptorType != USB_DT_ENDPOINT | 157 | || desc->bDescriptorType != USB_DT_ENDPOINT |
158 | || ep->bEndpointAddress != desc->bEndpointAddress | 158 | || ep->bEndpointAddress != desc->bEndpointAddress |
159 | || ep->maxpacket < usb_endpoint_maxp(desc)) { | 159 | || ep->maxpacket < usb_endpoint_maxp(desc)) { |
diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c index d7c8cb3bf759..f7ff9e8e746a 100644 --- a/drivers/usb/gadget/pxa25x_udc.c +++ b/drivers/usb/gadget/pxa25x_udc.c | |||
@@ -218,7 +218,7 @@ static int pxa25x_ep_enable (struct usb_ep *_ep, | |||
218 | struct pxa25x_udc *dev; | 218 | struct pxa25x_udc *dev; |
219 | 219 | ||
220 | ep = container_of (_ep, struct pxa25x_ep, ep); | 220 | ep = container_of (_ep, struct pxa25x_ep, ep); |
221 | if (!_ep || !desc || ep->ep.desc || _ep->name == ep0name | 221 | if (!_ep || !desc || _ep->name == ep0name |
222 | || desc->bDescriptorType != USB_DT_ENDPOINT | 222 | || desc->bDescriptorType != USB_DT_ENDPOINT |
223 | || ep->bEndpointAddress != desc->bEndpointAddress | 223 | || ep->bEndpointAddress != desc->bEndpointAddress |
224 | || ep->fifo_size < usb_endpoint_maxp (desc)) { | 224 | || ep->fifo_size < usb_endpoint_maxp (desc)) { |
diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c index 36c6836eeb0f..236b271871a0 100644 --- a/drivers/usb/gadget/s3c-hsudc.c +++ b/drivers/usb/gadget/s3c-hsudc.c | |||
@@ -760,7 +760,7 @@ static int s3c_hsudc_ep_enable(struct usb_ep *_ep, | |||
760 | u32 ecr = 0; | 760 | u32 ecr = 0; |
761 | 761 | ||
762 | hsep = our_ep(_ep); | 762 | hsep = our_ep(_ep); |
763 | if (!_ep || !desc || hsep->ep.desc || _ep->name == ep0name | 763 | if (!_ep || !desc || _ep->name == ep0name |
764 | || desc->bDescriptorType != USB_DT_ENDPOINT | 764 | || desc->bDescriptorType != USB_DT_ENDPOINT |
765 | || hsep->bEndpointAddress != desc->bEndpointAddress | 765 | || hsep->bEndpointAddress != desc->bEndpointAddress |
766 | || ep_maxpacket(hsep) < usb_endpoint_maxp(desc)) | 766 | || ep_maxpacket(hsep) < usb_endpoint_maxp(desc)) |
diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c index 3de71d37d75e..f2e51f50e528 100644 --- a/drivers/usb/gadget/s3c2410_udc.c +++ b/drivers/usb/gadget/s3c2410_udc.c | |||
@@ -1062,7 +1062,7 @@ static int s3c2410_udc_ep_enable(struct usb_ep *_ep, | |||
1062 | 1062 | ||
1063 | ep = to_s3c2410_ep(_ep); | 1063 | ep = to_s3c2410_ep(_ep); |
1064 | 1064 | ||
1065 | if (!_ep || !desc || ep->ep.desc | 1065 | if (!_ep || !desc |
1066 | || _ep->name == ep0name | 1066 | || _ep->name == ep0name |
1067 | || desc->bDescriptorType != USB_DT_ENDPOINT) | 1067 | || desc->bDescriptorType != USB_DT_ENDPOINT) |
1068 | return -EINVAL; | 1068 | return -EINVAL; |
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index b100f5f9f4b6..800be38c78b4 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
@@ -671,7 +671,9 @@ static int ehci_init(struct usb_hcd *hcd) | |||
671 | hw = ehci->async->hw; | 671 | hw = ehci->async->hw; |
672 | hw->hw_next = QH_NEXT(ehci, ehci->async->qh_dma); | 672 | hw->hw_next = QH_NEXT(ehci, ehci->async->qh_dma); |
673 | hw->hw_info1 = cpu_to_hc32(ehci, QH_HEAD); | 673 | hw->hw_info1 = cpu_to_hc32(ehci, QH_HEAD); |
674 | #if defined(CONFIG_PPC_PS3) | ||
674 | hw->hw_info1 |= cpu_to_hc32(ehci, (1 << 7)); /* I = 1 */ | 675 | hw->hw_info1 |= cpu_to_hc32(ehci, (1 << 7)); /* I = 1 */ |
676 | #endif | ||
675 | hw->hw_token = cpu_to_hc32(ehci, QTD_STS_HALT); | 677 | hw->hw_token = cpu_to_hc32(ehci, QTD_STS_HALT); |
676 | hw->hw_qtd_next = EHCI_LIST_END(ehci); | 678 | hw->hw_qtd_next = EHCI_LIST_END(ehci); |
677 | ehci->async->qh_state = QH_STATE_LINKED; | 679 | ehci->async->qh_state = QH_STATE_LINKED; |
diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index a44294d13494..17cfb8a1131c 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #include <linux/regulator/consumer.h> | 43 | #include <linux/regulator/consumer.h> |
44 | #include <linux/pm_runtime.h> | 44 | #include <linux/pm_runtime.h> |
45 | #include <linux/gpio.h> | 45 | #include <linux/gpio.h> |
46 | #include <linux/clk.h> | ||
46 | 47 | ||
47 | /* EHCI Register Set */ | 48 | /* EHCI Register Set */ |
48 | #define EHCI_INSNREG04 (0xA0) | 49 | #define EHCI_INSNREG04 (0xA0) |
@@ -55,6 +56,15 @@ | |||
55 | #define EHCI_INSNREG05_ULPI_EXTREGADD_SHIFT 8 | 56 | #define EHCI_INSNREG05_ULPI_EXTREGADD_SHIFT 8 |
56 | #define EHCI_INSNREG05_ULPI_WRDATA_SHIFT 0 | 57 | #define EHCI_INSNREG05_ULPI_WRDATA_SHIFT 0 |
57 | 58 | ||
59 | /* Errata i693 */ | ||
60 | static struct clk *utmi_p1_fck; | ||
61 | static struct clk *utmi_p2_fck; | ||
62 | static struct clk *xclk60mhsp1_ck; | ||
63 | static struct clk *xclk60mhsp2_ck; | ||
64 | static struct clk *usbhost_p1_fck; | ||
65 | static struct clk *usbhost_p2_fck; | ||
66 | static struct clk *init_60m_fclk; | ||
67 | |||
58 | /*-------------------------------------------------------------------------*/ | 68 | /*-------------------------------------------------------------------------*/ |
59 | 69 | ||
60 | static const struct hc_driver ehci_omap_hc_driver; | 70 | static const struct hc_driver ehci_omap_hc_driver; |
@@ -70,6 +80,41 @@ static inline u32 ehci_read(void __iomem *base, u32 reg) | |||
70 | return __raw_readl(base + reg); | 80 | return __raw_readl(base + reg); |
71 | } | 81 | } |
72 | 82 | ||
83 | /* Erratum i693 workaround sequence */ | ||
84 | static void omap_ehci_erratum_i693(struct ehci_hcd *ehci) | ||
85 | { | ||
86 | int ret = 0; | ||
87 | |||
88 | /* Switch to the internal 60 MHz clock */ | ||
89 | ret = clk_set_parent(utmi_p1_fck, init_60m_fclk); | ||
90 | if (ret != 0) | ||
91 | ehci_err(ehci, "init_60m_fclk set parent" | ||
92 | "failed error:%d\n", ret); | ||
93 | |||
94 | ret = clk_set_parent(utmi_p2_fck, init_60m_fclk); | ||
95 | if (ret != 0) | ||
96 | ehci_err(ehci, "init_60m_fclk set parent" | ||
97 | "failed error:%d\n", ret); | ||
98 | |||
99 | clk_enable(usbhost_p1_fck); | ||
100 | clk_enable(usbhost_p2_fck); | ||
101 | |||
102 | /* Wait 1ms and switch back to the external clock */ | ||
103 | mdelay(1); | ||
104 | ret = clk_set_parent(utmi_p1_fck, xclk60mhsp1_ck); | ||
105 | if (ret != 0) | ||
106 | ehci_err(ehci, "xclk60mhsp1_ck set parent" | ||
107 | "failed error:%d\n", ret); | ||
108 | |||
109 | ret = clk_set_parent(utmi_p2_fck, xclk60mhsp2_ck); | ||
110 | if (ret != 0) | ||
111 | ehci_err(ehci, "xclk60mhsp2_ck set parent" | ||
112 | "failed error:%d\n", ret); | ||
113 | |||
114 | clk_disable(usbhost_p1_fck); | ||
115 | clk_disable(usbhost_p2_fck); | ||
116 | } | ||
117 | |||
73 | static void omap_ehci_soft_phy_reset(struct platform_device *pdev, u8 port) | 118 | static void omap_ehci_soft_phy_reset(struct platform_device *pdev, u8 port) |
74 | { | 119 | { |
75 | struct usb_hcd *hcd = dev_get_drvdata(&pdev->dev); | 120 | struct usb_hcd *hcd = dev_get_drvdata(&pdev->dev); |
@@ -100,6 +145,50 @@ static void omap_ehci_soft_phy_reset(struct platform_device *pdev, u8 port) | |||
100 | } | 145 | } |
101 | } | 146 | } |
102 | 147 | ||
148 | static int omap_ehci_hub_control( | ||
149 | struct usb_hcd *hcd, | ||
150 | u16 typeReq, | ||
151 | u16 wValue, | ||
152 | u16 wIndex, | ||
153 | char *buf, | ||
154 | u16 wLength | ||
155 | ) | ||
156 | { | ||
157 | struct ehci_hcd *ehci = hcd_to_ehci(hcd); | ||
158 | u32 __iomem *status_reg = &ehci->regs->port_status[ | ||
159 | (wIndex & 0xff) - 1]; | ||
160 | u32 temp; | ||
161 | unsigned long flags; | ||
162 | int retval = 0; | ||
163 | |||
164 | spin_lock_irqsave(&ehci->lock, flags); | ||
165 | |||
166 | if (typeReq == SetPortFeature && wValue == USB_PORT_FEAT_SUSPEND) { | ||
167 | temp = ehci_readl(ehci, status_reg); | ||
168 | if ((temp & PORT_PE) == 0 || (temp & PORT_RESET) != 0) { | ||
169 | retval = -EPIPE; | ||
170 | goto done; | ||
171 | } | ||
172 | |||
173 | temp &= ~PORT_WKCONN_E; | ||
174 | temp |= PORT_WKDISC_E | PORT_WKOC_E; | ||
175 | ehci_writel(ehci, temp | PORT_SUSPEND, status_reg); | ||
176 | |||
177 | omap_ehci_erratum_i693(ehci); | ||
178 | |||
179 | set_bit((wIndex & 0xff) - 1, &ehci->suspended_ports); | ||
180 | goto done; | ||
181 | } | ||
182 | |||
183 | spin_unlock_irqrestore(&ehci->lock, flags); | ||
184 | |||
185 | /* Handle the hub control events here */ | ||
186 | return ehci_hub_control(hcd, typeReq, wValue, wIndex, buf, wLength); | ||
187 | done: | ||
188 | spin_unlock_irqrestore(&ehci->lock, flags); | ||
189 | return retval; | ||
190 | } | ||
191 | |||
103 | static void disable_put_regulator( | 192 | static void disable_put_regulator( |
104 | struct ehci_hcd_omap_platform_data *pdata) | 193 | struct ehci_hcd_omap_platform_data *pdata) |
105 | { | 194 | { |
@@ -264,8 +353,76 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) | |||
264 | /* root ports should always stay powered */ | 353 | /* root ports should always stay powered */ |
265 | ehci_port_power(omap_ehci, 1); | 354 | ehci_port_power(omap_ehci, 1); |
266 | 355 | ||
356 | /* get clocks */ | ||
357 | utmi_p1_fck = clk_get(dev, "utmi_p1_gfclk"); | ||
358 | if (IS_ERR(utmi_p1_fck)) { | ||
359 | ret = PTR_ERR(utmi_p1_fck); | ||
360 | dev_err(dev, "utmi_p1_gfclk failed error:%d\n", ret); | ||
361 | goto err_add_hcd; | ||
362 | } | ||
363 | |||
364 | xclk60mhsp1_ck = clk_get(dev, "xclk60mhsp1_ck"); | ||
365 | if (IS_ERR(xclk60mhsp1_ck)) { | ||
366 | ret = PTR_ERR(xclk60mhsp1_ck); | ||
367 | dev_err(dev, "xclk60mhsp1_ck failed error:%d\n", ret); | ||
368 | goto err_utmi_p1_fck; | ||
369 | } | ||
370 | |||
371 | utmi_p2_fck = clk_get(dev, "utmi_p2_gfclk"); | ||
372 | if (IS_ERR(utmi_p2_fck)) { | ||
373 | ret = PTR_ERR(utmi_p2_fck); | ||
374 | dev_err(dev, "utmi_p2_gfclk failed error:%d\n", ret); | ||
375 | goto err_xclk60mhsp1_ck; | ||
376 | } | ||
377 | |||
378 | xclk60mhsp2_ck = clk_get(dev, "xclk60mhsp2_ck"); | ||
379 | if (IS_ERR(xclk60mhsp2_ck)) { | ||
380 | ret = PTR_ERR(xclk60mhsp2_ck); | ||
381 | dev_err(dev, "xclk60mhsp2_ck failed error:%d\n", ret); | ||
382 | goto err_utmi_p2_fck; | ||
383 | } | ||
384 | |||
385 | usbhost_p1_fck = clk_get(dev, "usb_host_hs_utmi_p1_clk"); | ||
386 | if (IS_ERR(usbhost_p1_fck)) { | ||
387 | ret = PTR_ERR(usbhost_p1_fck); | ||
388 | dev_err(dev, "usbhost_p1_fck failed error:%d\n", ret); | ||
389 | goto err_xclk60mhsp2_ck; | ||
390 | } | ||
391 | |||
392 | usbhost_p2_fck = clk_get(dev, "usb_host_hs_utmi_p2_clk"); | ||
393 | if (IS_ERR(usbhost_p2_fck)) { | ||
394 | ret = PTR_ERR(usbhost_p2_fck); | ||
395 | dev_err(dev, "usbhost_p2_fck failed error:%d\n", ret); | ||
396 | goto err_usbhost_p1_fck; | ||
397 | } | ||
398 | |||
399 | init_60m_fclk = clk_get(dev, "init_60m_fclk"); | ||
400 | if (IS_ERR(init_60m_fclk)) { | ||
401 | ret = PTR_ERR(init_60m_fclk); | ||
402 | dev_err(dev, "init_60m_fclk failed error:%d\n", ret); | ||
403 | goto err_usbhost_p2_fck; | ||
404 | } | ||
405 | |||
267 | return 0; | 406 | return 0; |
268 | 407 | ||
408 | err_usbhost_p2_fck: | ||
409 | clk_put(usbhost_p2_fck); | ||
410 | |||
411 | err_usbhost_p1_fck: | ||
412 | clk_put(usbhost_p1_fck); | ||
413 | |||
414 | err_xclk60mhsp2_ck: | ||
415 | clk_put(xclk60mhsp2_ck); | ||
416 | |||
417 | err_utmi_p2_fck: | ||
418 | clk_put(utmi_p2_fck); | ||
419 | |||
420 | err_xclk60mhsp1_ck: | ||
421 | clk_put(xclk60mhsp1_ck); | ||
422 | |||
423 | err_utmi_p1_fck: | ||
424 | clk_put(utmi_p1_fck); | ||
425 | |||
269 | err_add_hcd: | 426 | err_add_hcd: |
270 | disable_put_regulator(pdata); | 427 | disable_put_regulator(pdata); |
271 | pm_runtime_put_sync(dev); | 428 | pm_runtime_put_sync(dev); |
@@ -294,6 +451,15 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev) | |||
294 | disable_put_regulator(dev->platform_data); | 451 | disable_put_regulator(dev->platform_data); |
295 | iounmap(hcd->regs); | 452 | iounmap(hcd->regs); |
296 | usb_put_hcd(hcd); | 453 | usb_put_hcd(hcd); |
454 | |||
455 | clk_put(utmi_p1_fck); | ||
456 | clk_put(utmi_p2_fck); | ||
457 | clk_put(xclk60mhsp1_ck); | ||
458 | clk_put(xclk60mhsp2_ck); | ||
459 | clk_put(usbhost_p1_fck); | ||
460 | clk_put(usbhost_p2_fck); | ||
461 | clk_put(init_60m_fclk); | ||
462 | |||
297 | pm_runtime_put_sync(dev); | 463 | pm_runtime_put_sync(dev); |
298 | pm_runtime_disable(dev); | 464 | pm_runtime_disable(dev); |
299 | 465 | ||
@@ -364,7 +530,7 @@ static const struct hc_driver ehci_omap_hc_driver = { | |||
364 | * root hub support | 530 | * root hub support |
365 | */ | 531 | */ |
366 | .hub_status_data = ehci_hub_status_data, | 532 | .hub_status_data = ehci_hub_status_data, |
367 | .hub_control = ehci_hub_control, | 533 | .hub_control = omap_ehci_hub_control, |
368 | .bus_suspend = ehci_bus_suspend, | 534 | .bus_suspend = ehci_bus_suspend, |
369 | .bus_resume = ehci_bus_resume, | 535 | .bus_resume = ehci_bus_resume, |
370 | 536 | ||
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c index bc94d7bf072d..123481793a47 100644 --- a/drivers/usb/host/ehci-pci.c +++ b/drivers/usb/host/ehci-pci.c | |||
@@ -144,14 +144,6 @@ static int ehci_pci_setup(struct usb_hcd *hcd) | |||
144 | hcd->has_tt = 1; | 144 | hcd->has_tt = 1; |
145 | tdi_reset(ehci); | 145 | tdi_reset(ehci); |
146 | } | 146 | } |
147 | if (pdev->subsystem_vendor == PCI_VENDOR_ID_ASUSTEK) { | ||
148 | /* EHCI #1 or #2 on 6 Series/C200 Series chipset */ | ||
149 | if (pdev->device == 0x1c26 || pdev->device == 0x1c2d) { | ||
150 | ehci_info(ehci, "broken D3 during system sleep on ASUS\n"); | ||
151 | hcd->broken_pci_sleep = 1; | ||
152 | device_set_wakeup_capable(&pdev->dev, false); | ||
153 | } | ||
154 | } | ||
155 | break; | 147 | break; |
156 | case PCI_VENDOR_ID_TDI: | 148 | case PCI_VENDOR_ID_TDI: |
157 | if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) { | 149 | if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) { |
diff --git a/drivers/usb/host/ehci-sh.c b/drivers/usb/host/ehci-sh.c index ca819cdd0c5e..e7cb3925abf8 100644 --- a/drivers/usb/host/ehci-sh.c +++ b/drivers/usb/host/ehci-sh.c | |||
@@ -126,8 +126,7 @@ static int ehci_hcd_sh_probe(struct platform_device *pdev) | |||
126 | goto fail_create_hcd; | 126 | goto fail_create_hcd; |
127 | } | 127 | } |
128 | 128 | ||
129 | if (pdev->dev.platform_data != NULL) | 129 | pdata = pdev->dev.platform_data; |
130 | pdata = pdev->dev.platform_data; | ||
131 | 130 | ||
132 | /* initialize hcd */ | 131 | /* initialize hcd */ |
133 | hcd = usb_create_hcd(&ehci_sh_hc_driver, &pdev->dev, | 132 | hcd = usb_create_hcd(&ehci_sh_hc_driver, &pdev->dev, |
diff --git a/drivers/usb/host/ehci-xilinx-of.c b/drivers/usb/host/ehci-xilinx-of.c index 9c2cc4633894..e9713d589e30 100644 --- a/drivers/usb/host/ehci-xilinx-of.c +++ b/drivers/usb/host/ehci-xilinx-of.c | |||
@@ -270,14 +270,12 @@ static int ehci_hcd_xilinx_of_remove(struct platform_device *op) | |||
270 | * | 270 | * |
271 | * Properly shutdown the hcd, call driver's shutdown routine. | 271 | * Properly shutdown the hcd, call driver's shutdown routine. |
272 | */ | 272 | */ |
273 | static int ehci_hcd_xilinx_of_shutdown(struct platform_device *op) | 273 | static void ehci_hcd_xilinx_of_shutdown(struct platform_device *op) |
274 | { | 274 | { |
275 | struct usb_hcd *hcd = dev_get_drvdata(&op->dev); | 275 | struct usb_hcd *hcd = dev_get_drvdata(&op->dev); |
276 | 276 | ||
277 | if (hcd->driver->shutdown) | 277 | if (hcd->driver->shutdown) |
278 | hcd->driver->shutdown(hcd); | 278 | hcd->driver->shutdown(hcd); |
279 | |||
280 | return 0; | ||
281 | } | 279 | } |
282 | 280 | ||
283 | 281 | ||
diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c index 836772dfabd3..2f3619eefefa 100644 --- a/drivers/usb/host/ohci-hub.c +++ b/drivers/usb/host/ohci-hub.c | |||
@@ -317,7 +317,7 @@ static int ohci_bus_resume (struct usb_hcd *hcd) | |||
317 | } | 317 | } |
318 | 318 | ||
319 | /* Carry out the final steps of resuming the controller device */ | 319 | /* Carry out the final steps of resuming the controller device */ |
320 | static void ohci_finish_controller_resume(struct usb_hcd *hcd) | 320 | static void __maybe_unused ohci_finish_controller_resume(struct usb_hcd *hcd) |
321 | { | 321 | { |
322 | struct ohci_hcd *ohci = hcd_to_ohci(hcd); | 322 | struct ohci_hcd *ohci = hcd_to_ohci(hcd); |
323 | int port; | 323 | int port; |
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index ec4338eec826..77689bd64cac 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c | |||
@@ -793,10 +793,9 @@ static void xhci_free_tt_info(struct xhci_hcd *xhci, | |||
793 | struct xhci_virt_device *virt_dev, | 793 | struct xhci_virt_device *virt_dev, |
794 | int slot_id) | 794 | int slot_id) |
795 | { | 795 | { |
796 | struct list_head *tt; | ||
797 | struct list_head *tt_list_head; | 796 | struct list_head *tt_list_head; |
798 | struct list_head *tt_next; | 797 | struct xhci_tt_bw_info *tt_info, *next; |
799 | struct xhci_tt_bw_info *tt_info; | 798 | bool slot_found = false; |
800 | 799 | ||
801 | /* If the device never made it past the Set Address stage, | 800 | /* If the device never made it past the Set Address stage, |
802 | * it may not have the real_port set correctly. | 801 | * it may not have the real_port set correctly. |
@@ -808,34 +807,16 @@ static void xhci_free_tt_info(struct xhci_hcd *xhci, | |||
808 | } | 807 | } |
809 | 808 | ||
810 | tt_list_head = &(xhci->rh_bw[virt_dev->real_port - 1].tts); | 809 | tt_list_head = &(xhci->rh_bw[virt_dev->real_port - 1].tts); |
811 | if (list_empty(tt_list_head)) | 810 | list_for_each_entry_safe(tt_info, next, tt_list_head, tt_list) { |
812 | return; | 811 | /* Multi-TT hubs will have more than one entry */ |
813 | 812 | if (tt_info->slot_id == slot_id) { | |
814 | list_for_each(tt, tt_list_head) { | 813 | slot_found = true; |
815 | tt_info = list_entry(tt, struct xhci_tt_bw_info, tt_list); | 814 | list_del(&tt_info->tt_list); |
816 | if (tt_info->slot_id == slot_id) | 815 | kfree(tt_info); |
816 | } else if (slot_found) { | ||
817 | break; | 817 | break; |
818 | } | ||
818 | } | 819 | } |
819 | /* Cautionary measure in case the hub was disconnected before we | ||
820 | * stored the TT information. | ||
821 | */ | ||
822 | if (tt_info->slot_id != slot_id) | ||
823 | return; | ||
824 | |||
825 | tt_next = tt->next; | ||
826 | tt_info = list_entry(tt, struct xhci_tt_bw_info, | ||
827 | tt_list); | ||
828 | /* Multi-TT hubs will have more than one entry */ | ||
829 | do { | ||
830 | list_del(tt); | ||
831 | kfree(tt_info); | ||
832 | tt = tt_next; | ||
833 | if (list_empty(tt_list_head)) | ||
834 | break; | ||
835 | tt_next = tt->next; | ||
836 | tt_info = list_entry(tt, struct xhci_tt_bw_info, | ||
837 | tt_list); | ||
838 | } while (tt_info->slot_id == slot_id); | ||
839 | } | 820 | } |
840 | 821 | ||
841 | int xhci_alloc_tt_info(struct xhci_hcd *xhci, | 822 | int xhci_alloc_tt_info(struct xhci_hcd *xhci, |
@@ -1791,17 +1772,9 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci) | |||
1791 | { | 1772 | { |
1792 | struct pci_dev *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller); | 1773 | struct pci_dev *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller); |
1793 | struct dev_info *dev_info, *next; | 1774 | struct dev_info *dev_info, *next; |
1794 | struct list_head *tt_list_head; | ||
1795 | struct list_head *tt; | ||
1796 | struct list_head *endpoints; | ||
1797 | struct list_head *ep, *q; | ||
1798 | struct xhci_tt_bw_info *tt_info; | ||
1799 | struct xhci_interval_bw_table *bwt; | ||
1800 | struct xhci_virt_ep *virt_ep; | ||
1801 | |||
1802 | unsigned long flags; | 1775 | unsigned long flags; |
1803 | int size; | 1776 | int size; |
1804 | int i; | 1777 | int i, j, num_ports; |
1805 | 1778 | ||
1806 | /* Free the Event Ring Segment Table and the actual Event Ring */ | 1779 | /* Free the Event Ring Segment Table and the actual Event Ring */ |
1807 | size = sizeof(struct xhci_erst_entry)*(xhci->erst.num_entries); | 1780 | size = sizeof(struct xhci_erst_entry)*(xhci->erst.num_entries); |
@@ -1860,21 +1833,22 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci) | |||
1860 | } | 1833 | } |
1861 | spin_unlock_irqrestore(&xhci->lock, flags); | 1834 | spin_unlock_irqrestore(&xhci->lock, flags); |
1862 | 1835 | ||
1863 | bwt = &xhci->rh_bw->bw_table; | 1836 | num_ports = HCS_MAX_PORTS(xhci->hcs_params1); |
1864 | for (i = 0; i < XHCI_MAX_INTERVAL; i++) { | 1837 | for (i = 0; i < num_ports; i++) { |
1865 | endpoints = &bwt->interval_bw[i].endpoints; | 1838 | struct xhci_interval_bw_table *bwt = &xhci->rh_bw[i].bw_table; |
1866 | list_for_each_safe(ep, q, endpoints) { | 1839 | for (j = 0; j < XHCI_MAX_INTERVAL; j++) { |
1867 | virt_ep = list_entry(ep, struct xhci_virt_ep, bw_endpoint_list); | 1840 | struct list_head *ep = &bwt->interval_bw[j].endpoints; |
1868 | list_del(&virt_ep->bw_endpoint_list); | 1841 | while (!list_empty(ep)) |
1869 | kfree(virt_ep); | 1842 | list_del_init(ep->next); |
1870 | } | 1843 | } |
1871 | } | 1844 | } |
1872 | 1845 | ||
1873 | tt_list_head = &xhci->rh_bw->tts; | 1846 | for (i = 0; i < num_ports; i++) { |
1874 | list_for_each_safe(tt, q, tt_list_head) { | 1847 | struct xhci_tt_bw_info *tt, *n; |
1875 | tt_info = list_entry(tt, struct xhci_tt_bw_info, tt_list); | 1848 | list_for_each_entry_safe(tt, n, &xhci->rh_bw[i].tts, tt_list) { |
1876 | list_del(tt); | 1849 | list_del(&tt->tt_list); |
1877 | kfree(tt_info); | 1850 | kfree(tt); |
1851 | } | ||
1878 | } | 1852 | } |
1879 | 1853 | ||
1880 | xhci->num_usb2_ports = 0; | 1854 | xhci->num_usb2_ports = 0; |
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index afdc73ee84a6..a979cd0dbe0f 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
@@ -795,8 +795,8 @@ int xhci_suspend(struct xhci_hcd *xhci) | |||
795 | command = xhci_readl(xhci, &xhci->op_regs->command); | 795 | command = xhci_readl(xhci, &xhci->op_regs->command); |
796 | command |= CMD_CSS; | 796 | command |= CMD_CSS; |
797 | xhci_writel(xhci, command, &xhci->op_regs->command); | 797 | xhci_writel(xhci, command, &xhci->op_regs->command); |
798 | if (handshake(xhci, &xhci->op_regs->status, STS_SAVE, 0, 10*100)) { | 798 | if (handshake(xhci, &xhci->op_regs->status, STS_SAVE, 0, 10 * 1000)) { |
799 | xhci_warn(xhci, "WARN: xHC CMD_CSS timeout\n"); | 799 | xhci_warn(xhci, "WARN: xHC save state timeout\n"); |
800 | spin_unlock_irq(&xhci->lock); | 800 | spin_unlock_irq(&xhci->lock); |
801 | return -ETIMEDOUT; | 801 | return -ETIMEDOUT; |
802 | } | 802 | } |
@@ -848,8 +848,8 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) | |||
848 | command |= CMD_CRS; | 848 | command |= CMD_CRS; |
849 | xhci_writel(xhci, command, &xhci->op_regs->command); | 849 | xhci_writel(xhci, command, &xhci->op_regs->command); |
850 | if (handshake(xhci, &xhci->op_regs->status, | 850 | if (handshake(xhci, &xhci->op_regs->status, |
851 | STS_RESTORE, 0, 10*100)) { | 851 | STS_RESTORE, 0, 10 * 1000)) { |
852 | xhci_dbg(xhci, "WARN: xHC CMD_CSS timeout\n"); | 852 | xhci_warn(xhci, "WARN: xHC restore state timeout\n"); |
853 | spin_unlock_irq(&xhci->lock); | 853 | spin_unlock_irq(&xhci->lock); |
854 | return -ETIMEDOUT; | 854 | return -ETIMEDOUT; |
855 | } | 855 | } |
@@ -3906,7 +3906,7 @@ static u16 xhci_get_timeout_no_hub_lpm(struct usb_device *udev, | |||
3906 | default: | 3906 | default: |
3907 | dev_warn(&udev->dev, "%s: Can't get timeout for non-U1 or U2 state.\n", | 3907 | dev_warn(&udev->dev, "%s: Can't get timeout for non-U1 or U2 state.\n", |
3908 | __func__); | 3908 | __func__); |
3909 | return -EINVAL; | 3909 | return USB3_LPM_DISABLED; |
3910 | } | 3910 | } |
3911 | 3911 | ||
3912 | if (sel <= max_sel_pel && pel <= max_sel_pel) | 3912 | if (sel <= max_sel_pel && pel <= max_sel_pel) |
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c index 768b4b55c816..9d63ba4d10d6 100644 --- a/drivers/usb/musb/davinci.c +++ b/drivers/usb/musb/davinci.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/dma-mapping.h> | 34 | #include <linux/dma-mapping.h> |
35 | 35 | ||
36 | #include <mach/cputype.h> | 36 | #include <mach/cputype.h> |
37 | #include <mach/hardware.h> | ||
37 | 38 | ||
38 | #include <asm/mach-types.h> | 39 | #include <asm/mach-types.h> |
39 | 40 | ||
diff --git a/drivers/usb/musb/davinci.h b/drivers/usb/musb/davinci.h index 046c84433cad..371baa0ee509 100644 --- a/drivers/usb/musb/davinci.h +++ b/drivers/usb/musb/davinci.h | |||
@@ -15,7 +15,7 @@ | |||
15 | */ | 15 | */ |
16 | 16 | ||
17 | /* Integrated highspeed/otg PHY */ | 17 | /* Integrated highspeed/otg PHY */ |
18 | #define USBPHY_CTL_PADDR (DAVINCI_SYSTEM_MODULE_BASE + 0x34) | 18 | #define USBPHY_CTL_PADDR 0x01c40034 |
19 | #define USBPHY_DATAPOL BIT(11) /* (dm355) switch D+/D- */ | 19 | #define USBPHY_DATAPOL BIT(11) /* (dm355) switch D+/D- */ |
20 | #define USBPHY_PHYCLKGD BIT(8) | 20 | #define USBPHY_PHYCLKGD BIT(8) |
21 | #define USBPHY_SESNDEN BIT(7) /* v(sess_end) comparator */ | 21 | #define USBPHY_SESNDEN BIT(7) /* v(sess_end) comparator */ |
@@ -27,7 +27,7 @@ | |||
27 | #define USBPHY_OTGPDWN BIT(1) | 27 | #define USBPHY_OTGPDWN BIT(1) |
28 | #define USBPHY_PHYPDWN BIT(0) | 28 | #define USBPHY_PHYPDWN BIT(0) |
29 | 29 | ||
30 | #define DM355_DEEPSLEEP_PADDR (DAVINCI_SYSTEM_MODULE_BASE + 0x48) | 30 | #define DM355_DEEPSLEEP_PADDR 0x01c40048 |
31 | #define DRVVBUS_FORCE BIT(2) | 31 | #define DRVVBUS_FORCE BIT(2) |
32 | #define DRVVBUS_OVERRIDE BIT(1) | 32 | #define DRVVBUS_OVERRIDE BIT(1) |
33 | 33 | ||
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index f42c29b11f71..95918dacc99a 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c | |||
@@ -1232,6 +1232,7 @@ static int musb_gadget_disable(struct usb_ep *ep) | |||
1232 | } | 1232 | } |
1233 | 1233 | ||
1234 | musb_ep->desc = NULL; | 1234 | musb_ep->desc = NULL; |
1235 | musb_ep->end_point.desc = NULL; | ||
1235 | 1236 | ||
1236 | /* abort all pending DMA and requests */ | 1237 | /* abort all pending DMA and requests */ |
1237 | nuke(musb_ep, -ESHUTDOWN); | 1238 | nuke(musb_ep, -ESHUTDOWN); |
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index ef8d744800ac..e090c799d87b 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c | |||
@@ -375,11 +375,21 @@ static void musb_advance_schedule(struct musb *musb, struct urb *urb, | |||
375 | */ | 375 | */ |
376 | if (list_empty(&qh->hep->urb_list)) { | 376 | if (list_empty(&qh->hep->urb_list)) { |
377 | struct list_head *head; | 377 | struct list_head *head; |
378 | struct dma_controller *dma = musb->dma_controller; | ||
378 | 379 | ||
379 | if (is_in) | 380 | if (is_in) { |
380 | ep->rx_reinit = 1; | 381 | ep->rx_reinit = 1; |
381 | else | 382 | if (ep->rx_channel) { |
383 | dma->channel_release(ep->rx_channel); | ||
384 | ep->rx_channel = NULL; | ||
385 | } | ||
386 | } else { | ||
382 | ep->tx_reinit = 1; | 387 | ep->tx_reinit = 1; |
388 | if (ep->tx_channel) { | ||
389 | dma->channel_release(ep->tx_channel); | ||
390 | ep->tx_channel = NULL; | ||
391 | } | ||
392 | } | ||
383 | 393 | ||
384 | /* Clobber old pointers to this qh */ | 394 | /* Clobber old pointers to this qh */ |
385 | musb_ep_set_qh(ep, is_in, NULL); | 395 | musb_ep_set_qh(ep, is_in, NULL); |
diff --git a/drivers/usb/otg/twl6030-usb.c b/drivers/usb/otg/twl6030-usb.c index d2a9a8e691b9..0eabb049b6a9 100644 --- a/drivers/usb/otg/twl6030-usb.c +++ b/drivers/usb/otg/twl6030-usb.c | |||
@@ -305,9 +305,8 @@ static irqreturn_t twl6030_usbotg_irq(int irq, void *_twl) | |||
305 | 305 | ||
306 | regulator_enable(twl->usb3v3); | 306 | regulator_enable(twl->usb3v3); |
307 | twl->asleep = 1; | 307 | twl->asleep = 1; |
308 | twl6030_writeb(twl, TWL_MODULE_USB, USB_ID_INT_EN_HI_CLR, 0x1); | 308 | twl6030_writeb(twl, TWL_MODULE_USB, 0x1, USB_ID_INT_EN_HI_CLR); |
309 | twl6030_writeb(twl, TWL_MODULE_USB, USB_ID_INT_EN_HI_SET, | 309 | twl6030_writeb(twl, TWL_MODULE_USB, 0x10, USB_ID_INT_EN_HI_SET); |
310 | 0x10); | ||
311 | status = USB_EVENT_ID; | 310 | status = USB_EVENT_ID; |
312 | otg->default_a = true; | 311 | otg->default_a = true; |
313 | twl->phy.state = OTG_STATE_A_IDLE; | 312 | twl->phy.state = OTG_STATE_A_IDLE; |
@@ -316,12 +315,10 @@ static irqreturn_t twl6030_usbotg_irq(int irq, void *_twl) | |||
316 | atomic_notifier_call_chain(&twl->phy.notifier, status, | 315 | atomic_notifier_call_chain(&twl->phy.notifier, status, |
317 | otg->gadget); | 316 | otg->gadget); |
318 | } else { | 317 | } else { |
319 | twl6030_writeb(twl, TWL_MODULE_USB, USB_ID_INT_EN_HI_CLR, | 318 | twl6030_writeb(twl, TWL_MODULE_USB, 0x10, USB_ID_INT_EN_HI_CLR); |
320 | 0x10); | 319 | twl6030_writeb(twl, TWL_MODULE_USB, 0x1, USB_ID_INT_EN_HI_SET); |
321 | twl6030_writeb(twl, TWL_MODULE_USB, USB_ID_INT_EN_HI_SET, | ||
322 | 0x1); | ||
323 | } | 320 | } |
324 | twl6030_writeb(twl, TWL_MODULE_USB, USB_ID_INT_LATCH_CLR, status); | 321 | twl6030_writeb(twl, TWL_MODULE_USB, status, USB_ID_INT_LATCH_CLR); |
325 | 322 | ||
326 | return IRQ_HANDLED; | 323 | return IRQ_HANDLED; |
327 | } | 324 | } |
@@ -343,7 +340,7 @@ static int twl6030_enable_irq(struct usb_phy *x) | |||
343 | { | 340 | { |
344 | struct twl6030_usb *twl = phy_to_twl(x); | 341 | struct twl6030_usb *twl = phy_to_twl(x); |
345 | 342 | ||
346 | twl6030_writeb(twl, TWL_MODULE_USB, USB_ID_INT_EN_HI_SET, 0x1); | 343 | twl6030_writeb(twl, TWL_MODULE_USB, 0x1, USB_ID_INT_EN_HI_SET); |
347 | twl6030_interrupt_unmask(0x05, REG_INT_MSK_LINE_C); | 344 | twl6030_interrupt_unmask(0x05, REG_INT_MSK_LINE_C); |
348 | twl6030_interrupt_unmask(0x05, REG_INT_MSK_STS_C); | 345 | twl6030_interrupt_unmask(0x05, REG_INT_MSK_STS_C); |
349 | 346 | ||
diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig index 3cfabcba7447..e7cf84f0751a 100644 --- a/drivers/usb/phy/Kconfig +++ b/drivers/usb/phy/Kconfig | |||
@@ -2,11 +2,11 @@ | |||
2 | # Physical Layer USB driver configuration | 2 | # Physical Layer USB driver configuration |
3 | # | 3 | # |
4 | comment "USB Physical Layer drivers" | 4 | comment "USB Physical Layer drivers" |
5 | depends on USB | 5 | depends on USB || USB_GADGET |
6 | 6 | ||
7 | config USB_ISP1301 | 7 | config USB_ISP1301 |
8 | tristate "NXP ISP1301 USB transceiver support" | 8 | tristate "NXP ISP1301 USB transceiver support" |
9 | depends on USB | 9 | depends on USB || USB_GADGET |
10 | depends on I2C | 10 | depends on I2C |
11 | help | 11 | help |
12 | Say Y here to add support for the NXP ISP1301 USB transceiver driver. | 12 | Say Y here to add support for the NXP ISP1301 USB transceiver driver. |
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index 1b1926200ba7..1e71079ce33b 100644 --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c | |||
@@ -82,6 +82,7 @@ static const struct usb_device_id id_table[] = { | |||
82 | { USB_DEVICE(0x10C4, 0x8066) }, /* Argussoft In-System Programmer */ | 82 | { USB_DEVICE(0x10C4, 0x8066) }, /* Argussoft In-System Programmer */ |
83 | { USB_DEVICE(0x10C4, 0x806F) }, /* IMS USB to RS422 Converter Cable */ | 83 | { USB_DEVICE(0x10C4, 0x806F) }, /* IMS USB to RS422 Converter Cable */ |
84 | { USB_DEVICE(0x10C4, 0x807A) }, /* Crumb128 board */ | 84 | { USB_DEVICE(0x10C4, 0x807A) }, /* Crumb128 board */ |
85 | { USB_DEVICE(0x10C4, 0x80C4) }, /* Cygnal Integrated Products, Inc., Optris infrared thermometer */ | ||
85 | { USB_DEVICE(0x10C4, 0x80CA) }, /* Degree Controls Inc */ | 86 | { USB_DEVICE(0x10C4, 0x80CA) }, /* Degree Controls Inc */ |
86 | { USB_DEVICE(0x10C4, 0x80DD) }, /* Tracient RFID */ | 87 | { USB_DEVICE(0x10C4, 0x80DD) }, /* Tracient RFID */ |
87 | { USB_DEVICE(0x10C4, 0x80F6) }, /* Suunto sports instrument */ | 88 | { USB_DEVICE(0x10C4, 0x80F6) }, /* Suunto sports instrument */ |
@@ -92,6 +93,7 @@ static const struct usb_device_id id_table[] = { | |||
92 | { USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */ | 93 | { USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */ |
93 | { USB_DEVICE(0x10C4, 0x8156) }, /* B&G H3000 link cable */ | 94 | { USB_DEVICE(0x10C4, 0x8156) }, /* B&G H3000 link cable */ |
94 | { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */ | 95 | { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */ |
96 | { USB_DEVICE(0x10C4, 0x815F) }, /* Timewave HamLinkUSB */ | ||
95 | { USB_DEVICE(0x10C4, 0x818B) }, /* AVIT Research USB to TTL */ | 97 | { USB_DEVICE(0x10C4, 0x818B) }, /* AVIT Research USB to TTL */ |
96 | { USB_DEVICE(0x10C4, 0x819F) }, /* MJS USB Toslink Switcher */ | 98 | { USB_DEVICE(0x10C4, 0x819F) }, /* MJS USB Toslink Switcher */ |
97 | { USB_DEVICE(0x10C4, 0x81A6) }, /* ThinkOptics WavIt */ | 99 | { USB_DEVICE(0x10C4, 0x81A6) }, /* ThinkOptics WavIt */ |
@@ -133,7 +135,13 @@ static const struct usb_device_id id_table[] = { | |||
133 | { USB_DEVICE(0x10CE, 0xEA6A) }, /* Silicon Labs MobiData GPRS USB Modem 100EU */ | 135 | { USB_DEVICE(0x10CE, 0xEA6A) }, /* Silicon Labs MobiData GPRS USB Modem 100EU */ |
134 | { USB_DEVICE(0x13AD, 0x9999) }, /* Baltech card reader */ | 136 | { USB_DEVICE(0x13AD, 0x9999) }, /* Baltech card reader */ |
135 | { USB_DEVICE(0x1555, 0x0004) }, /* Owen AC4 USB-RS485 Converter */ | 137 | { USB_DEVICE(0x1555, 0x0004) }, /* Owen AC4 USB-RS485 Converter */ |
138 | { USB_DEVICE(0x166A, 0x0201) }, /* Clipsal 5500PACA C-Bus Pascal Automation Controller */ | ||
139 | { USB_DEVICE(0x166A, 0x0301) }, /* Clipsal 5800PC C-Bus Wireless PC Interface */ | ||
136 | { USB_DEVICE(0x166A, 0x0303) }, /* Clipsal 5500PCU C-Bus USB interface */ | 140 | { USB_DEVICE(0x166A, 0x0303) }, /* Clipsal 5500PCU C-Bus USB interface */ |
141 | { USB_DEVICE(0x166A, 0x0304) }, /* Clipsal 5000CT2 C-Bus Black and White Touchscreen */ | ||
142 | { USB_DEVICE(0x166A, 0x0305) }, /* Clipsal C-5000CT2 C-Bus Spectrum Colour Touchscreen */ | ||
143 | { USB_DEVICE(0x166A, 0x0401) }, /* Clipsal L51xx C-Bus Architectural Dimmer */ | ||
144 | { USB_DEVICE(0x166A, 0x0101) }, /* Clipsal 5560884 C-Bus Multi-room Audio Matrix Switcher */ | ||
137 | { USB_DEVICE(0x16D6, 0x0001) }, /* Jablotron serial interface */ | 145 | { USB_DEVICE(0x16D6, 0x0001) }, /* Jablotron serial interface */ |
138 | { USB_DEVICE(0x16DC, 0x0010) }, /* W-IE-NE-R Plein & Baus GmbH PL512 Power Supply */ | 146 | { USB_DEVICE(0x16DC, 0x0010) }, /* W-IE-NE-R Plein & Baus GmbH PL512 Power Supply */ |
139 | { USB_DEVICE(0x16DC, 0x0011) }, /* W-IE-NE-R Plein & Baus GmbH RCM Remote Control for MARATON Power Supply */ | 147 | { USB_DEVICE(0x16DC, 0x0011) }, /* W-IE-NE-R Plein & Baus GmbH RCM Remote Control for MARATON Power Supply */ |
@@ -145,7 +153,11 @@ static const struct usb_device_id id_table[] = { | |||
145 | { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */ | 153 | { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */ |
146 | { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */ | 154 | { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */ |
147 | { USB_DEVICE(0x1BE3, 0x07A6) }, /* WAGO 750-923 USB Service Cable */ | 155 | { USB_DEVICE(0x1BE3, 0x07A6) }, /* WAGO 750-923 USB Service Cable */ |
156 | { USB_DEVICE(0x1E29, 0x0102) }, /* Festo CPX-USB */ | ||
157 | { USB_DEVICE(0x1E29, 0x0501) }, /* Festo CMSP */ | ||
148 | { USB_DEVICE(0x3195, 0xF190) }, /* Link Instruments MSO-19 */ | 158 | { USB_DEVICE(0x3195, 0xF190) }, /* Link Instruments MSO-19 */ |
159 | { USB_DEVICE(0x3195, 0xF280) }, /* Link Instruments MSO-28 */ | ||
160 | { USB_DEVICE(0x3195, 0xF281) }, /* Link Instruments MSO-28 */ | ||
149 | { USB_DEVICE(0x413C, 0x9500) }, /* DW700 GPS USB interface */ | 161 | { USB_DEVICE(0x413C, 0x9500) }, /* DW700 GPS USB interface */ |
150 | { } /* Terminating Entry */ | 162 | { } /* Terminating Entry */ |
151 | }; | 163 | }; |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 8c084ea34e26..bc912e5a3beb 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -737,6 +737,7 @@ static struct usb_device_id id_table_combined [] = { | |||
737 | { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, | 737 | { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, |
738 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_SERIAL_VX7_PID) }, | 738 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_SERIAL_VX7_PID) }, |
739 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_CT29B_PID) }, | 739 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_CT29B_PID) }, |
740 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_RTS01_PID) }, | ||
740 | { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) }, | 741 | { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) }, |
741 | { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) }, | 742 | { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) }, |
742 | { USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) }, | 743 | { USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) }, |
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h index f3c7c78ede33..5661c7e2d415 100644 --- a/drivers/usb/serial/ftdi_sio_ids.h +++ b/drivers/usb/serial/ftdi_sio_ids.h | |||
@@ -784,6 +784,7 @@ | |||
784 | #define RTSYSTEMS_VID 0x2100 /* Vendor ID */ | 784 | #define RTSYSTEMS_VID 0x2100 /* Vendor ID */ |
785 | #define RTSYSTEMS_SERIAL_VX7_PID 0x9e52 /* Serial converter for VX-7 Radios using FT232RL */ | 785 | #define RTSYSTEMS_SERIAL_VX7_PID 0x9e52 /* Serial converter for VX-7 Radios using FT232RL */ |
786 | #define RTSYSTEMS_CT29B_PID 0x9e54 /* CT29B Radio Cable */ | 786 | #define RTSYSTEMS_CT29B_PID 0x9e54 /* CT29B Radio Cable */ |
787 | #define RTSYSTEMS_RTS01_PID 0x9e57 /* USB-RTS01 Radio Cable */ | ||
787 | 788 | ||
788 | 789 | ||
789 | /* | 790 | /* |
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c index 105a6d898ca4..9b026bf7afef 100644 --- a/drivers/usb/serial/generic.c +++ b/drivers/usb/serial/generic.c | |||
@@ -39,13 +39,6 @@ MODULE_PARM_DESC(product, "User specified USB idProduct"); | |||
39 | 39 | ||
40 | static struct usb_device_id generic_device_ids[2]; /* Initially all zeroes. */ | 40 | static struct usb_device_id generic_device_ids[2]; /* Initially all zeroes. */ |
41 | 41 | ||
42 | /* we want to look at all devices, as the vendor/product id can change | ||
43 | * depending on the command line argument */ | ||
44 | static const struct usb_device_id generic_serial_ids[] = { | ||
45 | {.driver_info = 42}, | ||
46 | {} | ||
47 | }; | ||
48 | |||
49 | /* All of the device info needed for the Generic Serial Converter */ | 42 | /* All of the device info needed for the Generic Serial Converter */ |
50 | struct usb_serial_driver usb_serial_generic_device = { | 43 | struct usb_serial_driver usb_serial_generic_device = { |
51 | .driver = { | 44 | .driver = { |
@@ -79,7 +72,8 @@ int usb_serial_generic_register(int _debug) | |||
79 | USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT; | 72 | USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT; |
80 | 73 | ||
81 | /* register our generic driver with ourselves */ | 74 | /* register our generic driver with ourselves */ |
82 | retval = usb_serial_register_drivers(serial_drivers, "usbserial_generic", generic_serial_ids); | 75 | retval = usb_serial_register_drivers(serial_drivers, |
76 | "usbserial_generic", generic_device_ids); | ||
83 | #endif | 77 | #endif |
84 | return retval; | 78 | return retval; |
85 | } | 79 | } |
diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c index d0ec1aa52719..a71fa0aa0406 100644 --- a/drivers/usb/serial/mct_u232.c +++ b/drivers/usb/serial/mct_u232.c | |||
@@ -309,13 +309,16 @@ static int mct_u232_set_modem_ctrl(struct usb_serial *serial, | |||
309 | MCT_U232_SET_REQUEST_TYPE, | 309 | MCT_U232_SET_REQUEST_TYPE, |
310 | 0, 0, buf, MCT_U232_SET_MODEM_CTRL_SIZE, | 310 | 0, 0, buf, MCT_U232_SET_MODEM_CTRL_SIZE, |
311 | WDR_TIMEOUT); | 311 | WDR_TIMEOUT); |
312 | if (rc < 0) | 312 | kfree(buf); |
313 | dev_err(&serial->dev->dev, | 313 | |
314 | "Set MODEM CTRL 0x%x failed (error = %d)\n", mcr, rc); | ||
315 | dbg("set_modem_ctrl: state=0x%x ==> mcr=0x%x", control_state, mcr); | 314 | dbg("set_modem_ctrl: state=0x%x ==> mcr=0x%x", control_state, mcr); |
316 | 315 | ||
317 | kfree(buf); | 316 | if (rc < 0) { |
318 | return rc; | 317 | dev_err(&serial->dev->dev, |
318 | "Set MODEM CTRL 0x%x failed (error = %d)\n", mcr, rc); | ||
319 | return rc; | ||
320 | } | ||
321 | return 0; | ||
319 | } /* mct_u232_set_modem_ctrl */ | 322 | } /* mct_u232_set_modem_ctrl */ |
320 | 323 | ||
321 | static int mct_u232_get_modem_stat(struct usb_serial *serial, | 324 | static int mct_u232_get_modem_stat(struct usb_serial *serial, |
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index 29160f8b5101..57eca2448424 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c | |||
@@ -190,7 +190,7 @@ | |||
190 | 190 | ||
191 | static int device_type; | 191 | static int device_type; |
192 | 192 | ||
193 | static const struct usb_device_id id_table[] __devinitconst = { | 193 | static const struct usb_device_id id_table[] = { |
194 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7840)}, | 194 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7840)}, |
195 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)}, | 195 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)}, |
196 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7810)}, | 196 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7810)}, |
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 1aae9028cd0b..adf8ce72be50 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -47,6 +47,7 @@ | |||
47 | /* Function prototypes */ | 47 | /* Function prototypes */ |
48 | static int option_probe(struct usb_serial *serial, | 48 | static int option_probe(struct usb_serial *serial, |
49 | const struct usb_device_id *id); | 49 | const struct usb_device_id *id); |
50 | static void option_release(struct usb_serial *serial); | ||
50 | static int option_send_setup(struct usb_serial_port *port); | 51 | static int option_send_setup(struct usb_serial_port *port); |
51 | static void option_instat_callback(struct urb *urb); | 52 | static void option_instat_callback(struct urb *urb); |
52 | 53 | ||
@@ -150,6 +151,7 @@ static void option_instat_callback(struct urb *urb); | |||
150 | #define HUAWEI_PRODUCT_E14AC 0x14AC | 151 | #define HUAWEI_PRODUCT_E14AC 0x14AC |
151 | #define HUAWEI_PRODUCT_K3806 0x14AE | 152 | #define HUAWEI_PRODUCT_K3806 0x14AE |
152 | #define HUAWEI_PRODUCT_K4605 0x14C6 | 153 | #define HUAWEI_PRODUCT_K4605 0x14C6 |
154 | #define HUAWEI_PRODUCT_K5005 0x14C8 | ||
153 | #define HUAWEI_PRODUCT_K3770 0x14C9 | 155 | #define HUAWEI_PRODUCT_K3770 0x14C9 |
154 | #define HUAWEI_PRODUCT_K3771 0x14CA | 156 | #define HUAWEI_PRODUCT_K3771 0x14CA |
155 | #define HUAWEI_PRODUCT_K4510 0x14CB | 157 | #define HUAWEI_PRODUCT_K4510 0x14CB |
@@ -234,6 +236,7 @@ static void option_instat_callback(struct urb *urb); | |||
234 | #define NOVATELWIRELESS_PRODUCT_G1 0xA001 | 236 | #define NOVATELWIRELESS_PRODUCT_G1 0xA001 |
235 | #define NOVATELWIRELESS_PRODUCT_G1_M 0xA002 | 237 | #define NOVATELWIRELESS_PRODUCT_G1_M 0xA002 |
236 | #define NOVATELWIRELESS_PRODUCT_G2 0xA010 | 238 | #define NOVATELWIRELESS_PRODUCT_G2 0xA010 |
239 | #define NOVATELWIRELESS_PRODUCT_MC551 0xB001 | ||
237 | 240 | ||
238 | /* AMOI PRODUCTS */ | 241 | /* AMOI PRODUCTS */ |
239 | #define AMOI_VENDOR_ID 0x1614 | 242 | #define AMOI_VENDOR_ID 0x1614 |
@@ -425,7 +428,7 @@ static void option_instat_callback(struct urb *urb); | |||
425 | #define SAMSUNG_VENDOR_ID 0x04e8 | 428 | #define SAMSUNG_VENDOR_ID 0x04e8 |
426 | #define SAMSUNG_PRODUCT_GT_B3730 0x6889 | 429 | #define SAMSUNG_PRODUCT_GT_B3730 0x6889 |
427 | 430 | ||
428 | /* YUGA products www.yuga-info.com*/ | 431 | /* YUGA products www.yuga-info.com gavin.kx@qq.com */ |
429 | #define YUGA_VENDOR_ID 0x257A | 432 | #define YUGA_VENDOR_ID 0x257A |
430 | #define YUGA_PRODUCT_CEM600 0x1601 | 433 | #define YUGA_PRODUCT_CEM600 0x1601 |
431 | #define YUGA_PRODUCT_CEM610 0x1602 | 434 | #define YUGA_PRODUCT_CEM610 0x1602 |
@@ -442,6 +445,8 @@ static void option_instat_callback(struct urb *urb); | |||
442 | #define YUGA_PRODUCT_CEU516 0x160C | 445 | #define YUGA_PRODUCT_CEU516 0x160C |
443 | #define YUGA_PRODUCT_CEU528 0x160D | 446 | #define YUGA_PRODUCT_CEU528 0x160D |
444 | #define YUGA_PRODUCT_CEU526 0x160F | 447 | #define YUGA_PRODUCT_CEU526 0x160F |
448 | #define YUGA_PRODUCT_CEU881 0x161F | ||
449 | #define YUGA_PRODUCT_CEU882 0x162F | ||
445 | 450 | ||
446 | #define YUGA_PRODUCT_CWM600 0x2601 | 451 | #define YUGA_PRODUCT_CWM600 0x2601 |
447 | #define YUGA_PRODUCT_CWM610 0x2602 | 452 | #define YUGA_PRODUCT_CWM610 0x2602 |
@@ -457,23 +462,26 @@ static void option_instat_callback(struct urb *urb); | |||
457 | #define YUGA_PRODUCT_CWU518 0x260B | 462 | #define YUGA_PRODUCT_CWU518 0x260B |
458 | #define YUGA_PRODUCT_CWU516 0x260C | 463 | #define YUGA_PRODUCT_CWU516 0x260C |
459 | #define YUGA_PRODUCT_CWU528 0x260D | 464 | #define YUGA_PRODUCT_CWU528 0x260D |
465 | #define YUGA_PRODUCT_CWU581 0x260E | ||
460 | #define YUGA_PRODUCT_CWU526 0x260F | 466 | #define YUGA_PRODUCT_CWU526 0x260F |
461 | 467 | #define YUGA_PRODUCT_CWU582 0x261F | |
462 | #define YUGA_PRODUCT_CLM600 0x2601 | 468 | #define YUGA_PRODUCT_CWU583 0x262F |
463 | #define YUGA_PRODUCT_CLM610 0x2602 | 469 | |
464 | #define YUGA_PRODUCT_CLM500 0x2603 | 470 | #define YUGA_PRODUCT_CLM600 0x3601 |
465 | #define YUGA_PRODUCT_CLM510 0x2604 | 471 | #define YUGA_PRODUCT_CLM610 0x3602 |
466 | #define YUGA_PRODUCT_CLM800 0x2605 | 472 | #define YUGA_PRODUCT_CLM500 0x3603 |
467 | #define YUGA_PRODUCT_CLM900 0x2606 | 473 | #define YUGA_PRODUCT_CLM510 0x3604 |
468 | 474 | #define YUGA_PRODUCT_CLM800 0x3605 | |
469 | #define YUGA_PRODUCT_CLU718 0x2607 | 475 | #define YUGA_PRODUCT_CLM900 0x3606 |
470 | #define YUGA_PRODUCT_CLU716 0x2608 | 476 | |
471 | #define YUGA_PRODUCT_CLU728 0x2609 | 477 | #define YUGA_PRODUCT_CLU718 0x3607 |
472 | #define YUGA_PRODUCT_CLU726 0x260A | 478 | #define YUGA_PRODUCT_CLU716 0x3608 |
473 | #define YUGA_PRODUCT_CLU518 0x260B | 479 | #define YUGA_PRODUCT_CLU728 0x3609 |
474 | #define YUGA_PRODUCT_CLU516 0x260C | 480 | #define YUGA_PRODUCT_CLU726 0x360A |
475 | #define YUGA_PRODUCT_CLU528 0x260D | 481 | #define YUGA_PRODUCT_CLU518 0x360B |
476 | #define YUGA_PRODUCT_CLU526 0x260F | 482 | #define YUGA_PRODUCT_CLU516 0x360C |
483 | #define YUGA_PRODUCT_CLU528 0x360D | ||
484 | #define YUGA_PRODUCT_CLU526 0x360F | ||
477 | 485 | ||
478 | /* Viettel products */ | 486 | /* Viettel products */ |
479 | #define VIETTEL_VENDOR_ID 0x2262 | 487 | #define VIETTEL_VENDOR_ID 0x2262 |
@@ -490,6 +498,10 @@ static void option_instat_callback(struct urb *urb); | |||
490 | /* MediaTek products */ | 498 | /* MediaTek products */ |
491 | #define MEDIATEK_VENDOR_ID 0x0e8d | 499 | #define MEDIATEK_VENDOR_ID 0x0e8d |
492 | 500 | ||
501 | /* Cellient products */ | ||
502 | #define CELLIENT_VENDOR_ID 0x2692 | ||
503 | #define CELLIENT_PRODUCT_MEN200 0x9005 | ||
504 | |||
493 | /* some devices interfaces need special handling due to a number of reasons */ | 505 | /* some devices interfaces need special handling due to a number of reasons */ |
494 | enum option_blacklist_reason { | 506 | enum option_blacklist_reason { |
495 | OPTION_BLACKLIST_NONE = 0, | 507 | OPTION_BLACKLIST_NONE = 0, |
@@ -666,6 +678,11 @@ static const struct usb_device_id option_ids[] = { | |||
666 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3806, 0xff, 0xff, 0xff) }, | 678 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3806, 0xff, 0xff, 0xff) }, |
667 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4605, 0xff, 0xff, 0xff), | 679 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4605, 0xff, 0xff, 0xff), |
668 | .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist }, | 680 | .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist }, |
681 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4605, 0xff, 0x01, 0x31) }, | ||
682 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4605, 0xff, 0x01, 0x32) }, | ||
683 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K5005, 0xff, 0x01, 0x31) }, | ||
684 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K5005, 0xff, 0x01, 0x32) }, | ||
685 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K5005, 0xff, 0x01, 0x33) }, | ||
669 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3770, 0xff, 0x02, 0x31) }, | 686 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3770, 0xff, 0x02, 0x31) }, |
670 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3770, 0xff, 0x02, 0x32) }, | 687 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3770, 0xff, 0x02, 0x32) }, |
671 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3771, 0xff, 0x02, 0x31) }, | 688 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3771, 0xff, 0x02, 0x31) }, |
@@ -722,6 +739,8 @@ static const struct usb_device_id option_ids[] = { | |||
722 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G1) }, | 739 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G1) }, |
723 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G1_M) }, | 740 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G1_M) }, |
724 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G2) }, | 741 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G2) }, |
742 | /* Novatel Ovation MC551 a.k.a. Verizon USB551L */ | ||
743 | { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC551, 0xff, 0xff, 0xff) }, | ||
725 | 744 | ||
726 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) }, | 745 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) }, |
727 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) }, | 746 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) }, |
@@ -1209,6 +1228,11 @@ static const struct usb_device_id option_ids[] = { | |||
1209 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CLU516) }, | 1228 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CLU516) }, |
1210 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CLU528) }, | 1229 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CLU528) }, |
1211 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CLU526) }, | 1230 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CLU526) }, |
1231 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CEU881) }, | ||
1232 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CEU882) }, | ||
1233 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CWU581) }, | ||
1234 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CWU582) }, | ||
1235 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CWU583) }, | ||
1212 | { USB_DEVICE_AND_INTERFACE_INFO(VIETTEL_VENDOR_ID, VIETTEL_PRODUCT_VT1000, 0xff, 0xff, 0xff) }, | 1236 | { USB_DEVICE_AND_INTERFACE_INFO(VIETTEL_VENDOR_ID, VIETTEL_PRODUCT_VT1000, 0xff, 0xff, 0xff) }, |
1213 | { USB_DEVICE_AND_INTERFACE_INFO(ZD_VENDOR_ID, ZD_PRODUCT_7000, 0xff, 0xff, 0xff) }, | 1237 | { USB_DEVICE_AND_INTERFACE_INFO(ZD_VENDOR_ID, ZD_PRODUCT_7000, 0xff, 0xff, 0xff) }, |
1214 | { USB_DEVICE(LG_VENDOR_ID, LG_PRODUCT_L02C) }, /* docomo L-02C modem */ | 1238 | { USB_DEVICE(LG_VENDOR_ID, LG_PRODUCT_L02C) }, /* docomo L-02C modem */ |
@@ -1216,6 +1240,7 @@ static const struct usb_device_id option_ids[] = { | |||
1216 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a1, 0xff, 0x02, 0x01) }, | 1240 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a1, 0xff, 0x02, 0x01) }, |
1217 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a2, 0xff, 0x00, 0x00) }, | 1241 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a2, 0xff, 0x00, 0x00) }, |
1218 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a2, 0xff, 0x02, 0x01) }, /* MediaTek MT6276M modem & app port */ | 1242 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a2, 0xff, 0x02, 0x01) }, /* MediaTek MT6276M modem & app port */ |
1243 | { USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) }, | ||
1219 | { } /* Terminating entry */ | 1244 | { } /* Terminating entry */ |
1220 | }; | 1245 | }; |
1221 | MODULE_DEVICE_TABLE(usb, option_ids); | 1246 | MODULE_DEVICE_TABLE(usb, option_ids); |
@@ -1245,7 +1270,7 @@ static struct usb_serial_driver option_1port_device = { | |||
1245 | .ioctl = usb_wwan_ioctl, | 1270 | .ioctl = usb_wwan_ioctl, |
1246 | .attach = usb_wwan_startup, | 1271 | .attach = usb_wwan_startup, |
1247 | .disconnect = usb_wwan_disconnect, | 1272 | .disconnect = usb_wwan_disconnect, |
1248 | .release = usb_wwan_release, | 1273 | .release = option_release, |
1249 | .read_int_callback = option_instat_callback, | 1274 | .read_int_callback = option_instat_callback, |
1250 | #ifdef CONFIG_PM | 1275 | #ifdef CONFIG_PM |
1251 | .suspend = usb_wwan_suspend, | 1276 | .suspend = usb_wwan_suspend, |
@@ -1259,35 +1284,6 @@ static struct usb_serial_driver * const serial_drivers[] = { | |||
1259 | 1284 | ||
1260 | static bool debug; | 1285 | static bool debug; |
1261 | 1286 | ||
1262 | /* per port private data */ | ||
1263 | |||
1264 | #define N_IN_URB 4 | ||
1265 | #define N_OUT_URB 4 | ||
1266 | #define IN_BUFLEN 4096 | ||
1267 | #define OUT_BUFLEN 4096 | ||
1268 | |||
1269 | struct option_port_private { | ||
1270 | /* Input endpoints and buffer for this port */ | ||
1271 | struct urb *in_urbs[N_IN_URB]; | ||
1272 | u8 *in_buffer[N_IN_URB]; | ||
1273 | /* Output endpoints and buffer for this port */ | ||
1274 | struct urb *out_urbs[N_OUT_URB]; | ||
1275 | u8 *out_buffer[N_OUT_URB]; | ||
1276 | unsigned long out_busy; /* Bit vector of URBs in use */ | ||
1277 | int opened; | ||
1278 | struct usb_anchor delayed; | ||
1279 | |||
1280 | /* Settings for the port */ | ||
1281 | int rts_state; /* Handshaking pins (outputs) */ | ||
1282 | int dtr_state; | ||
1283 | int cts_state; /* Handshaking pins (inputs) */ | ||
1284 | int dsr_state; | ||
1285 | int dcd_state; | ||
1286 | int ri_state; | ||
1287 | |||
1288 | unsigned long tx_start_time[N_OUT_URB]; | ||
1289 | }; | ||
1290 | |||
1291 | module_usb_serial_driver(serial_drivers, option_ids); | 1287 | module_usb_serial_driver(serial_drivers, option_ids); |
1292 | 1288 | ||
1293 | static bool is_blacklisted(const u8 ifnum, enum option_blacklist_reason reason, | 1289 | static bool is_blacklisted(const u8 ifnum, enum option_blacklist_reason reason, |
@@ -1356,12 +1352,22 @@ static int option_probe(struct usb_serial *serial, | |||
1356 | return 0; | 1352 | return 0; |
1357 | } | 1353 | } |
1358 | 1354 | ||
1355 | static void option_release(struct usb_serial *serial) | ||
1356 | { | ||
1357 | struct usb_wwan_intf_private *priv = usb_get_serial_data(serial); | ||
1358 | |||
1359 | usb_wwan_release(serial); | ||
1360 | |||
1361 | kfree(priv); | ||
1362 | } | ||
1363 | |||
1359 | static void option_instat_callback(struct urb *urb) | 1364 | static void option_instat_callback(struct urb *urb) |
1360 | { | 1365 | { |
1361 | int err; | 1366 | int err; |
1362 | int status = urb->status; | 1367 | int status = urb->status; |
1363 | struct usb_serial_port *port = urb->context; | 1368 | struct usb_serial_port *port = urb->context; |
1364 | struct option_port_private *portdata = usb_get_serial_port_data(port); | 1369 | struct usb_wwan_port_private *portdata = |
1370 | usb_get_serial_port_data(port); | ||
1365 | 1371 | ||
1366 | dbg("%s: urb %p port %p has data %p", __func__, urb, port, portdata); | 1372 | dbg("%s: urb %p port %p has data %p", __func__, urb, port, portdata); |
1367 | 1373 | ||
@@ -1421,7 +1427,7 @@ static int option_send_setup(struct usb_serial_port *port) | |||
1421 | struct usb_serial *serial = port->serial; | 1427 | struct usb_serial *serial = port->serial; |
1422 | struct usb_wwan_intf_private *intfdata = | 1428 | struct usb_wwan_intf_private *intfdata = |
1423 | (struct usb_wwan_intf_private *) serial->private; | 1429 | (struct usb_wwan_intf_private *) serial->private; |
1424 | struct option_port_private *portdata; | 1430 | struct usb_wwan_port_private *portdata; |
1425 | int ifNum = serial->interface->cur_altsetting->desc.bInterfaceNumber; | 1431 | int ifNum = serial->interface->cur_altsetting->desc.bInterfaceNumber; |
1426 | int val = 0; | 1432 | int val = 0; |
1427 | 1433 | ||
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c index 0d5fe59ebb9e..996015c5f1ac 100644 --- a/drivers/usb/serial/qcserial.c +++ b/drivers/usb/serial/qcserial.c | |||
@@ -105,7 +105,13 @@ static const struct usb_device_id id_table[] = { | |||
105 | {USB_DEVICE(0x1410, 0xa021)}, /* Novatel Gobi 3000 Composite */ | 105 | {USB_DEVICE(0x1410, 0xa021)}, /* Novatel Gobi 3000 Composite */ |
106 | {USB_DEVICE(0x413c, 0x8193)}, /* Dell Gobi 3000 QDL */ | 106 | {USB_DEVICE(0x413c, 0x8193)}, /* Dell Gobi 3000 QDL */ |
107 | {USB_DEVICE(0x413c, 0x8194)}, /* Dell Gobi 3000 Composite */ | 107 | {USB_DEVICE(0x413c, 0x8194)}, /* Dell Gobi 3000 Composite */ |
108 | {USB_DEVICE(0x1199, 0x9010)}, /* Sierra Wireless Gobi 3000 QDL */ | ||
109 | {USB_DEVICE(0x1199, 0x9012)}, /* Sierra Wireless Gobi 3000 QDL */ | ||
108 | {USB_DEVICE(0x1199, 0x9013)}, /* Sierra Wireless Gobi 3000 Modem device (MC8355) */ | 110 | {USB_DEVICE(0x1199, 0x9013)}, /* Sierra Wireless Gobi 3000 Modem device (MC8355) */ |
111 | {USB_DEVICE(0x1199, 0x9014)}, /* Sierra Wireless Gobi 3000 QDL */ | ||
112 | {USB_DEVICE(0x1199, 0x9015)}, /* Sierra Wireless Gobi 3000 Modem device */ | ||
113 | {USB_DEVICE(0x1199, 0x9018)}, /* Sierra Wireless Gobi 3000 QDL */ | ||
114 | {USB_DEVICE(0x1199, 0x9019)}, /* Sierra Wireless Gobi 3000 Modem device */ | ||
109 | {USB_DEVICE(0x12D1, 0x14F0)}, /* Sony Gobi 3000 QDL */ | 115 | {USB_DEVICE(0x12D1, 0x14F0)}, /* Sony Gobi 3000 QDL */ |
110 | {USB_DEVICE(0x12D1, 0x14F1)}, /* Sony Gobi 3000 Composite */ | 116 | {USB_DEVICE(0x12D1, 0x14F1)}, /* Sony Gobi 3000 Composite */ |
111 | { } /* Terminating entry */ | 117 | { } /* Terminating entry */ |
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c index ba54a0a8235c..d423d36acc04 100644 --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c | |||
@@ -294,6 +294,10 @@ static const struct usb_device_id id_table[] = { | |||
294 | { USB_DEVICE(0x1199, 0x68A3), /* Sierra Wireless Direct IP modems */ | 294 | { USB_DEVICE(0x1199, 0x68A3), /* Sierra Wireless Direct IP modems */ |
295 | .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist | 295 | .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist |
296 | }, | 296 | }, |
297 | /* AT&T Direct IP LTE modems */ | ||
298 | { USB_DEVICE_AND_INTERFACE_INFO(0x0F3D, 0x68AA, 0xFF, 0xFF, 0xFF), | ||
299 | .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist | ||
300 | }, | ||
297 | { USB_DEVICE(0x0f3d, 0x68A3), /* Airprime/Sierra Wireless Direct IP modems */ | 301 | { USB_DEVICE(0x0f3d, 0x68A3), /* Airprime/Sierra Wireless Direct IP modems */ |
298 | .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist | 302 | .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist |
299 | }, | 303 | }, |
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 6a1b609a0d94..27483f91a4a3 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -659,12 +659,14 @@ exit: | |||
659 | static struct usb_serial_driver *search_serial_device( | 659 | static struct usb_serial_driver *search_serial_device( |
660 | struct usb_interface *iface) | 660 | struct usb_interface *iface) |
661 | { | 661 | { |
662 | const struct usb_device_id *id; | 662 | const struct usb_device_id *id = NULL; |
663 | struct usb_serial_driver *drv; | 663 | struct usb_serial_driver *drv; |
664 | struct usb_driver *driver = to_usb_driver(iface->dev.driver); | ||
664 | 665 | ||
665 | /* Check if the usb id matches a known device */ | 666 | /* Check if the usb id matches a known device */ |
666 | list_for_each_entry(drv, &usb_serial_driver_list, driver_list) { | 667 | list_for_each_entry(drv, &usb_serial_driver_list, driver_list) { |
667 | id = get_iface_id(drv, iface); | 668 | if (drv->usb_driver == driver) |
669 | id = get_iface_id(drv, iface); | ||
668 | if (id) | 670 | if (id) |
669 | return drv; | 671 | return drv; |
670 | } | 672 | } |
@@ -755,7 +757,7 @@ static int usb_serial_probe(struct usb_interface *interface, | |||
755 | 757 | ||
756 | if (retval) { | 758 | if (retval) { |
757 | dbg("sub driver rejected device"); | 759 | dbg("sub driver rejected device"); |
758 | kfree(serial); | 760 | usb_serial_put(serial); |
759 | module_put(type->driver.owner); | 761 | module_put(type->driver.owner); |
760 | return retval; | 762 | return retval; |
761 | } | 763 | } |
@@ -827,7 +829,7 @@ static int usb_serial_probe(struct usb_interface *interface, | |||
827 | */ | 829 | */ |
828 | if (num_bulk_in == 0 || num_bulk_out == 0) { | 830 | if (num_bulk_in == 0 || num_bulk_out == 0) { |
829 | dev_info(&interface->dev, "PL-2303 hack: descriptors matched but endpoints did not\n"); | 831 | dev_info(&interface->dev, "PL-2303 hack: descriptors matched but endpoints did not\n"); |
830 | kfree(serial); | 832 | usb_serial_put(serial); |
831 | module_put(type->driver.owner); | 833 | module_put(type->driver.owner); |
832 | return -ENODEV; | 834 | return -ENODEV; |
833 | } | 835 | } |
@@ -841,7 +843,7 @@ static int usb_serial_probe(struct usb_interface *interface, | |||
841 | if (num_ports == 0) { | 843 | if (num_ports == 0) { |
842 | dev_err(&interface->dev, | 844 | dev_err(&interface->dev, |
843 | "Generic device with no bulk out, not allowed.\n"); | 845 | "Generic device with no bulk out, not allowed.\n"); |
844 | kfree(serial); | 846 | usb_serial_put(serial); |
845 | module_put(type->driver.owner); | 847 | module_put(type->driver.owner); |
846 | return -EIO; | 848 | return -EIO; |
847 | } | 849 | } |
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index a324a5d21e99..11418da9bc09 100644 --- a/drivers/usb/storage/scsiglue.c +++ b/drivers/usb/storage/scsiglue.c | |||
@@ -202,6 +202,12 @@ static int slave_configure(struct scsi_device *sdev) | |||
202 | if (us->fflags & US_FL_NO_READ_CAPACITY_16) | 202 | if (us->fflags & US_FL_NO_READ_CAPACITY_16) |
203 | sdev->no_read_capacity_16 = 1; | 203 | sdev->no_read_capacity_16 = 1; |
204 | 204 | ||
205 | /* | ||
206 | * Many devices do not respond properly to READ_CAPACITY_16. | ||
207 | * Tell the SCSI layer to try READ_CAPACITY_10 first. | ||
208 | */ | ||
209 | sdev->try_rc_10_first = 1; | ||
210 | |||
205 | /* assume SPC3 or latter devices support sense size > 18 */ | 211 | /* assume SPC3 or latter devices support sense size > 18 */ |
206 | if (sdev->scsi_level > SCSI_SPC_2) | 212 | if (sdev->scsi_level > SCSI_SPC_2) |
207 | us->fflags |= US_FL_SANE_SENSE; | 213 | us->fflags |= US_FL_SANE_SENSE; |