diff options
Diffstat (limited to 'drivers/usb')
93 files changed, 485 insertions, 400 deletions
diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c index b7eb86ad6bf2..8a7eb77233b4 100644 --- a/drivers/usb/atm/cxacru.c +++ b/drivers/usb/atm/cxacru.c | |||
@@ -686,7 +686,8 @@ static int cxacru_cm_get_array(struct cxacru_data *instance, enum cxacru_cm_requ | |||
686 | { | 686 | { |
687 | int ret, len; | 687 | int ret, len; |
688 | __le32 *buf; | 688 | __le32 *buf; |
689 | int offb, offd; | 689 | int offb; |
690 | unsigned int offd; | ||
690 | const int stride = CMD_PACKET_SIZE / (4 * 2) - 1; | 691 | const int stride = CMD_PACKET_SIZE / (4 * 2) - 1; |
691 | int buflen = ((size - 1) / stride + 1 + size * 2) * 4; | 692 | int buflen = ((size - 1) / stride + 1 + size * 2) * 4; |
692 | 693 | ||
diff --git a/drivers/usb/chipidea/Kconfig b/drivers/usb/chipidea/Kconfig index 608a2aeb400c..b2df442eb3e5 100644 --- a/drivers/usb/chipidea/Kconfig +++ b/drivers/usb/chipidea/Kconfig | |||
@@ -20,7 +20,7 @@ config USB_CHIPIDEA_UDC | |||
20 | config USB_CHIPIDEA_HOST | 20 | config USB_CHIPIDEA_HOST |
21 | bool "ChipIdea host controller" | 21 | bool "ChipIdea host controller" |
22 | depends on USB=y || USB=USB_CHIPIDEA | 22 | depends on USB=y || USB=USB_CHIPIDEA |
23 | depends on USB_EHCI_HCD | 23 | depends on USB_EHCI_HCD=y |
24 | select USB_EHCI_ROOT_HUB_TT | 24 | select USB_EHCI_ROOT_HUB_TT |
25 | help | 25 | help |
26 | Say Y here to enable host controller functionality of the | 26 | Say Y here to enable host controller functionality of the |
diff --git a/drivers/usb/chipidea/ci13xxx_imx.c b/drivers/usb/chipidea/ci13xxx_imx.c index 8faec9dbbb84..73f9d5f15adb 100644 --- a/drivers/usb/chipidea/ci13xxx_imx.c +++ b/drivers/usb/chipidea/ci13xxx_imx.c | |||
@@ -173,17 +173,10 @@ static int ci13xxx_imx_probe(struct platform_device *pdev) | |||
173 | 173 | ||
174 | ci13xxx_imx_platdata.phy = data->phy; | 174 | ci13xxx_imx_platdata.phy = data->phy; |
175 | 175 | ||
176 | if (!pdev->dev.dma_mask) { | 176 | if (!pdev->dev.dma_mask) |
177 | pdev->dev.dma_mask = devm_kzalloc(&pdev->dev, | 177 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; |
178 | sizeof(*pdev->dev.dma_mask), GFP_KERNEL); | 178 | if (!pdev->dev.coherent_dma_mask) |
179 | if (!pdev->dev.dma_mask) { | 179 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); |
180 | ret = -ENOMEM; | ||
181 | dev_err(&pdev->dev, "Failed to alloc dma_mask!\n"); | ||
182 | goto err; | ||
183 | } | ||
184 | *pdev->dev.dma_mask = DMA_BIT_MASK(32); | ||
185 | dma_set_coherent_mask(&pdev->dev, *pdev->dev.dma_mask); | ||
186 | } | ||
187 | 180 | ||
188 | if (usbmisc_ops && usbmisc_ops->init) { | 181 | if (usbmisc_ops && usbmisc_ops->init) { |
189 | ret = usbmisc_ops->init(&pdev->dev); | 182 | ret = usbmisc_ops->init(&pdev->dev); |
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index 450107e5f657..475c9c114689 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c | |||
@@ -276,8 +276,9 @@ static void ci_role_work(struct work_struct *work) | |||
276 | 276 | ||
277 | ci_role_stop(ci); | 277 | ci_role_stop(ci); |
278 | ci_role_start(ci, role); | 278 | ci_role_start(ci, role); |
279 | enable_irq(ci->irq); | ||
280 | } | 279 | } |
280 | |||
281 | enable_irq(ci->irq); | ||
281 | } | 282 | } |
282 | 283 | ||
283 | static irqreturn_t ci_irq(int irq, void *data) | 284 | static irqreturn_t ci_irq(int irq, void *data) |
@@ -370,11 +371,6 @@ static int ci_hdrc_probe(struct platform_device *pdev) | |||
370 | } | 371 | } |
371 | 372 | ||
372 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 373 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
373 | if (!res) { | ||
374 | dev_err(dev, "missing resource\n"); | ||
375 | return -ENODEV; | ||
376 | } | ||
377 | |||
378 | base = devm_ioremap_resource(dev, res); | 374 | base = devm_ioremap_resource(dev, res); |
379 | if (IS_ERR(base)) | 375 | if (IS_ERR(base)) |
380 | return PTR_ERR(base); | 376 | return PTR_ERR(base); |
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index 519ead2443c5..b501346484ae 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c | |||
@@ -1678,8 +1678,11 @@ static int udc_start(struct ci13xxx *ci) | |||
1678 | 1678 | ||
1679 | ci->gadget.ep0 = &ci->ep0in->ep; | 1679 | ci->gadget.ep0 = &ci->ep0in->ep; |
1680 | 1680 | ||
1681 | if (ci->global_phy) | 1681 | if (ci->global_phy) { |
1682 | ci->transceiver = usb_get_phy(USB_PHY_TYPE_USB2); | 1682 | ci->transceiver = usb_get_phy(USB_PHY_TYPE_USB2); |
1683 | if (IS_ERR(ci->transceiver)) | ||
1684 | ci->transceiver = NULL; | ||
1685 | } | ||
1683 | 1686 | ||
1684 | if (ci->platdata->flags & CI13XXX_REQUIRE_TRANSCEIVER) { | 1687 | if (ci->platdata->flags & CI13XXX_REQUIRE_TRANSCEIVER) { |
1685 | if (ci->transceiver == NULL) { | 1688 | if (ci->transceiver == NULL) { |
@@ -1694,7 +1697,7 @@ static int udc_start(struct ci13xxx *ci) | |||
1694 | goto put_transceiver; | 1697 | goto put_transceiver; |
1695 | } | 1698 | } |
1696 | 1699 | ||
1697 | if (!IS_ERR_OR_NULL(ci->transceiver)) { | 1700 | if (ci->transceiver) { |
1698 | retval = otg_set_peripheral(ci->transceiver->otg, | 1701 | retval = otg_set_peripheral(ci->transceiver->otg, |
1699 | &ci->gadget); | 1702 | &ci->gadget); |
1700 | if (retval) | 1703 | if (retval) |
@@ -1711,7 +1714,7 @@ static int udc_start(struct ci13xxx *ci) | |||
1711 | return retval; | 1714 | return retval; |
1712 | 1715 | ||
1713 | remove_trans: | 1716 | remove_trans: |
1714 | if (!IS_ERR_OR_NULL(ci->transceiver)) { | 1717 | if (ci->transceiver) { |
1715 | otg_set_peripheral(ci->transceiver->otg, NULL); | 1718 | otg_set_peripheral(ci->transceiver->otg, NULL); |
1716 | if (ci->global_phy) | 1719 | if (ci->global_phy) |
1717 | usb_put_phy(ci->transceiver); | 1720 | usb_put_phy(ci->transceiver); |
@@ -1719,7 +1722,7 @@ remove_trans: | |||
1719 | 1722 | ||
1720 | dev_err(dev, "error = %i\n", retval); | 1723 | dev_err(dev, "error = %i\n", retval); |
1721 | put_transceiver: | 1724 | put_transceiver: |
1722 | if (!IS_ERR_OR_NULL(ci->transceiver) && ci->global_phy) | 1725 | if (ci->transceiver && ci->global_phy) |
1723 | usb_put_phy(ci->transceiver); | 1726 | usb_put_phy(ci->transceiver); |
1724 | destroy_eps: | 1727 | destroy_eps: |
1725 | destroy_eps(ci); | 1728 | destroy_eps(ci); |
@@ -1747,7 +1750,7 @@ static void udc_stop(struct ci13xxx *ci) | |||
1747 | dma_pool_destroy(ci->td_pool); | 1750 | dma_pool_destroy(ci->td_pool); |
1748 | dma_pool_destroy(ci->qh_pool); | 1751 | dma_pool_destroy(ci->qh_pool); |
1749 | 1752 | ||
1750 | if (!IS_ERR_OR_NULL(ci->transceiver)) { | 1753 | if (ci->transceiver) { |
1751 | otg_set_peripheral(ci->transceiver->otg, NULL); | 1754 | otg_set_peripheral(ci->transceiver->otg, NULL); |
1752 | if (ci->global_phy) | 1755 | if (ci->global_phy) |
1753 | usb_put_phy(ci->transceiver); | 1756 | usb_put_phy(ci->transceiver); |
diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig index 8772b3659296..db535b0aa172 100644 --- a/drivers/usb/core/Kconfig +++ b/drivers/usb/core/Kconfig | |||
@@ -51,7 +51,7 @@ config USB_DYNAMIC_MINORS | |||
51 | 51 | ||
52 | config USB_OTG | 52 | config USB_OTG |
53 | bool "OTG support" | 53 | bool "OTG support" |
54 | depends on USB_SUSPEND | 54 | depends on PM_RUNTIME |
55 | default n | 55 | default n |
56 | help | 56 | help |
57 | The most notable feature of USB OTG is support for a | 57 | The most notable feature of USB OTG is support for a |
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index caefc800f298..c88c4fb9459d 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c | |||
@@ -1287,9 +1287,13 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb, | |||
1287 | goto error; | 1287 | goto error; |
1288 | } | 1288 | } |
1289 | for (totlen = u = 0; u < uurb->number_of_packets; u++) { | 1289 | for (totlen = u = 0; u < uurb->number_of_packets; u++) { |
1290 | /* arbitrary limit, | 1290 | /* |
1291 | * sufficient for USB 2.0 high-bandwidth iso */ | 1291 | * arbitrary limit need for USB 3.0 |
1292 | if (isopkt[u].length > 8192) { | 1292 | * bMaxBurst (0~15 allowed, 1~16 packets) |
1293 | * bmAttributes (bit 1:0, mult 0~2, 1~3 packets) | ||
1294 | * sizemax: 1024 * 16 * 3 = 49152 | ||
1295 | */ | ||
1296 | if (isopkt[u].length > 49152) { | ||
1293 | ret = -EINVAL; | 1297 | ret = -EINVAL; |
1294 | goto error; | 1298 | goto error; |
1295 | } | 1299 | } |
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c index ab5638d9c707..a63598895077 100644 --- a/drivers/usb/core/quirks.c +++ b/drivers/usb/core/quirks.c | |||
@@ -88,6 +88,9 @@ static const struct usb_device_id usb_quirk_list[] = { | |||
88 | /* Edirol SD-20 */ | 88 | /* Edirol SD-20 */ |
89 | { USB_DEVICE(0x0582, 0x0027), .driver_info = USB_QUIRK_RESET_RESUME }, | 89 | { USB_DEVICE(0x0582, 0x0027), .driver_info = USB_QUIRK_RESET_RESUME }, |
90 | 90 | ||
91 | /* Alcor Micro Corp. Hub */ | ||
92 | { USB_DEVICE(0x058f, 0x9254), .driver_info = USB_QUIRK_RESET_RESUME }, | ||
93 | |||
91 | /* appletouch */ | 94 | /* appletouch */ |
92 | { USB_DEVICE(0x05ac, 0x021a), .driver_info = USB_QUIRK_RESET_RESUME }, | 95 | { USB_DEVICE(0x05ac, 0x021a), .driver_info = USB_QUIRK_RESET_RESUME }, |
93 | 96 | ||
diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig index ea5ee9c21c35..757aa18027d0 100644 --- a/drivers/usb/dwc3/Kconfig +++ b/drivers/usb/dwc3/Kconfig | |||
@@ -19,21 +19,21 @@ choice | |||
19 | 19 | ||
20 | config USB_DWC3_HOST | 20 | config USB_DWC3_HOST |
21 | bool "Host only mode" | 21 | bool "Host only mode" |
22 | depends on USB | 22 | depends on USB=y || USB=USB_DWC3 |
23 | help | 23 | help |
24 | Select this when you want to use DWC3 in host mode only, | 24 | Select this when you want to use DWC3 in host mode only, |
25 | thereby the gadget feature will be regressed. | 25 | thereby the gadget feature will be regressed. |
26 | 26 | ||
27 | config USB_DWC3_GADGET | 27 | config USB_DWC3_GADGET |
28 | bool "Gadget only mode" | 28 | bool "Gadget only mode" |
29 | depends on USB_GADGET | 29 | depends on USB_GADGET=y || USB_GADGET=USB_DWC3 |
30 | help | 30 | help |
31 | Select this when you want to use DWC3 in gadget mode only, | 31 | Select this when you want to use DWC3 in gadget mode only, |
32 | thereby the host feature will be regressed. | 32 | thereby the host feature will be regressed. |
33 | 33 | ||
34 | config USB_DWC3_DUAL_ROLE | 34 | config USB_DWC3_DUAL_ROLE |
35 | bool "Dual Role mode" | 35 | bool "Dual Role mode" |
36 | depends on (USB && USB_GADGET) | 36 | depends on ((USB=y || USB=USB_DWC3) && (USB_GADGET=y || USB_GADGET=USB_DWC3)) |
37 | help | 37 | help |
38 | This is the default mode of working of DWC3 controller where | 38 | This is the default mode of working of DWC3 controller where |
39 | both host and gadget features are enabled. | 39 | both host and gadget features are enabled. |
diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c index a8afe6e26621..8ce9d7fd6cfc 100644 --- a/drivers/usb/dwc3/dwc3-exynos.c +++ b/drivers/usb/dwc3/dwc3-exynos.c | |||
@@ -95,8 +95,6 @@ static int dwc3_exynos_remove_child(struct device *dev, void *unused) | |||
95 | return 0; | 95 | return 0; |
96 | } | 96 | } |
97 | 97 | ||
98 | static u64 dwc3_exynos_dma_mask = DMA_BIT_MASK(32); | ||
99 | |||
100 | static int dwc3_exynos_probe(struct platform_device *pdev) | 98 | static int dwc3_exynos_probe(struct platform_device *pdev) |
101 | { | 99 | { |
102 | struct dwc3_exynos *exynos; | 100 | struct dwc3_exynos *exynos; |
@@ -118,7 +116,9 @@ static int dwc3_exynos_probe(struct platform_device *pdev) | |||
118 | * Once we move to full device tree support this will vanish off. | 116 | * Once we move to full device tree support this will vanish off. |
119 | */ | 117 | */ |
120 | if (!dev->dma_mask) | 118 | if (!dev->dma_mask) |
121 | dev->dma_mask = &dwc3_exynos_dma_mask; | 119 | dev->dma_mask = &dev->coherent_dma_mask; |
120 | if (!dev->coherent_dma_mask) | ||
121 | dev->coherent_dma_mask = DMA_BIT_MASK(32); | ||
122 | 122 | ||
123 | platform_set_drvdata(pdev, exynos); | 123 | platform_set_drvdata(pdev, exynos); |
124 | 124 | ||
@@ -164,9 +164,9 @@ static int dwc3_exynos_remove(struct platform_device *pdev) | |||
164 | { | 164 | { |
165 | struct dwc3_exynos *exynos = platform_get_drvdata(pdev); | 165 | struct dwc3_exynos *exynos = platform_get_drvdata(pdev); |
166 | 166 | ||
167 | device_for_each_child(&pdev->dev, NULL, dwc3_exynos_remove_child); | ||
167 | platform_device_unregister(exynos->usb2_phy); | 168 | platform_device_unregister(exynos->usb2_phy); |
168 | platform_device_unregister(exynos->usb3_phy); | 169 | platform_device_unregister(exynos->usb3_phy); |
169 | device_for_each_child(&pdev->dev, NULL, dwc3_exynos_remove_child); | ||
170 | 170 | ||
171 | clk_disable_unprepare(exynos->clk); | 171 | clk_disable_unprepare(exynos->clk); |
172 | 172 | ||
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c index 227d4a7acad7..eba9e2baf32b 100644 --- a/drivers/usb/dwc3/dwc3-pci.c +++ b/drivers/usb/dwc3/dwc3-pci.c | |||
@@ -196,9 +196,9 @@ static void dwc3_pci_remove(struct pci_dev *pci) | |||
196 | { | 196 | { |
197 | struct dwc3_pci *glue = pci_get_drvdata(pci); | 197 | struct dwc3_pci *glue = pci_get_drvdata(pci); |
198 | 198 | ||
199 | platform_device_unregister(glue->dwc3); | ||
199 | platform_device_unregister(glue->usb2_phy); | 200 | platform_device_unregister(glue->usb2_phy); |
200 | platform_device_unregister(glue->usb3_phy); | 201 | platform_device_unregister(glue->usb3_phy); |
201 | platform_device_unregister(glue->dwc3); | ||
202 | pci_set_drvdata(pci, NULL); | 202 | pci_set_drvdata(pci, NULL); |
203 | pci_disable_device(pci); | 203 | pci_disable_device(pci); |
204 | } | 204 | } |
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 2b6e7e001207..b5e5b35df49c 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c | |||
@@ -1706,11 +1706,19 @@ static void dwc3_gadget_free_endpoints(struct dwc3 *dwc) | |||
1706 | dep = dwc->eps[epnum]; | 1706 | dep = dwc->eps[epnum]; |
1707 | if (!dep) | 1707 | if (!dep) |
1708 | continue; | 1708 | continue; |
1709 | 1709 | /* | |
1710 | dwc3_free_trb_pool(dep); | 1710 | * Physical endpoints 0 and 1 are special; they form the |
1711 | 1711 | * bi-directional USB endpoint 0. | |
1712 | if (epnum != 0 && epnum != 1) | 1712 | * |
1713 | * For those two physical endpoints, we don't allocate a TRB | ||
1714 | * pool nor do we add them the endpoints list. Due to that, we | ||
1715 | * shouldn't do these two operations otherwise we would end up | ||
1716 | * with all sorts of bugs when removing dwc3.ko. | ||
1717 | */ | ||
1718 | if (epnum != 0 && epnum != 1) { | ||
1719 | dwc3_free_trb_pool(dep); | ||
1713 | list_del(&dep->endpoint.ep_list); | 1720 | list_del(&dep->endpoint.ep_list); |
1721 | } | ||
1714 | 1722 | ||
1715 | kfree(dep); | 1723 | kfree(dep); |
1716 | } | 1724 | } |
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index 83300d94a893..f41aa0d0c414 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig | |||
@@ -146,7 +146,6 @@ config USB_LPC32XX | |||
146 | depends on ARCH_LPC32XX | 146 | depends on ARCH_LPC32XX |
147 | depends on USB_PHY | 147 | depends on USB_PHY |
148 | select USB_ISP1301 | 148 | select USB_ISP1301 |
149 | select USB_OTG_UTILS | ||
150 | help | 149 | help |
151 | This option selects the USB device controller in the LPC32xx SoC. | 150 | This option selects the USB device controller in the LPC32xx SoC. |
152 | 151 | ||
diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c index f2a970f75bfa..5a5128a226f7 100644 --- a/drivers/usb/gadget/atmel_usba_udc.c +++ b/drivers/usb/gadget/atmel_usba_udc.c | |||
@@ -1992,8 +1992,6 @@ err_map_regs: | |||
1992 | err_get_hclk: | 1992 | err_get_hclk: |
1993 | clk_put(pclk); | 1993 | clk_put(pclk); |
1994 | 1994 | ||
1995 | platform_set_drvdata(pdev, NULL); | ||
1996 | |||
1997 | return ret; | 1995 | return ret; |
1998 | } | 1996 | } |
1999 | 1997 | ||
diff --git a/drivers/usb/gadget/bcm63xx_udc.c b/drivers/usb/gadget/bcm63xx_udc.c index 6e6518264c42..fd24cb4540a4 100644 --- a/drivers/usb/gadget/bcm63xx_udc.c +++ b/drivers/usb/gadget/bcm63xx_udc.c | |||
@@ -2334,21 +2334,11 @@ static int bcm63xx_udc_probe(struct platform_device *pdev) | |||
2334 | } | 2334 | } |
2335 | 2335 | ||
2336 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 2336 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
2337 | if (!res) { | ||
2338 | dev_err(dev, "error finding USBD resource\n"); | ||
2339 | return -ENXIO; | ||
2340 | } | ||
2341 | |||
2342 | udc->usbd_regs = devm_ioremap_resource(dev, res); | 2337 | udc->usbd_regs = devm_ioremap_resource(dev, res); |
2343 | if (IS_ERR(udc->usbd_regs)) | 2338 | if (IS_ERR(udc->usbd_regs)) |
2344 | return PTR_ERR(udc->usbd_regs); | 2339 | return PTR_ERR(udc->usbd_regs); |
2345 | 2340 | ||
2346 | res = platform_get_resource(pdev, IORESOURCE_MEM, 1); | 2341 | res = platform_get_resource(pdev, IORESOURCE_MEM, 1); |
2347 | if (!res) { | ||
2348 | dev_err(dev, "error finding IUDMA resource\n"); | ||
2349 | return -ENXIO; | ||
2350 | } | ||
2351 | |||
2352 | udc->iudma_regs = devm_ioremap_resource(dev, res); | 2342 | udc->iudma_regs = devm_ioremap_resource(dev, res); |
2353 | if (IS_ERR(udc->iudma_regs)) | 2343 | if (IS_ERR(udc->iudma_regs)) |
2354 | return PTR_ERR(udc->iudma_regs); | 2344 | return PTR_ERR(udc->iudma_regs); |
@@ -2420,7 +2410,6 @@ static int bcm63xx_udc_remove(struct platform_device *pdev) | |||
2420 | usb_del_gadget_udc(&udc->gadget); | 2410 | usb_del_gadget_udc(&udc->gadget); |
2421 | BUG_ON(udc->driver); | 2411 | BUG_ON(udc->driver); |
2422 | 2412 | ||
2423 | platform_set_drvdata(pdev, NULL); | ||
2424 | bcm63xx_uninit_udc_hw(udc); | 2413 | bcm63xx_uninit_udc_hw(udc); |
2425 | 2414 | ||
2426 | return 0; | 2415 | return 0; |
diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c index 3d5cfc9c2c78..80e7f75a56c7 100644 --- a/drivers/usb/gadget/configfs.c +++ b/drivers/usb/gadget/configfs.c | |||
@@ -821,8 +821,10 @@ static int configfs_composite_bind(struct usb_gadget *gadget, | |||
821 | gi->gstrings[i] = NULL; | 821 | gi->gstrings[i] = NULL; |
822 | s = usb_gstrings_attach(&gi->cdev, gi->gstrings, | 822 | s = usb_gstrings_attach(&gi->cdev, gi->gstrings, |
823 | USB_GADGET_FIRST_AVAIL_IDX); | 823 | USB_GADGET_FIRST_AVAIL_IDX); |
824 | if (IS_ERR(s)) | 824 | if (IS_ERR(s)) { |
825 | ret = PTR_ERR(s); | ||
825 | goto err_comp_cleanup; | 826 | goto err_comp_cleanup; |
827 | } | ||
826 | 828 | ||
827 | gi->cdev.desc.iManufacturer = s[USB_GADGET_MANUFACTURER_IDX].id; | 829 | gi->cdev.desc.iManufacturer = s[USB_GADGET_MANUFACTURER_IDX].id; |
828 | gi->cdev.desc.iProduct = s[USB_GADGET_PRODUCT_IDX].id; | 830 | gi->cdev.desc.iProduct = s[USB_GADGET_PRODUCT_IDX].id; |
@@ -847,8 +849,10 @@ static int configfs_composite_bind(struct usb_gadget *gadget, | |||
847 | } | 849 | } |
848 | cfg->gstrings[i] = NULL; | 850 | cfg->gstrings[i] = NULL; |
849 | s = usb_gstrings_attach(&gi->cdev, cfg->gstrings, 1); | 851 | s = usb_gstrings_attach(&gi->cdev, cfg->gstrings, 1); |
850 | if (IS_ERR(s)) | 852 | if (IS_ERR(s)) { |
853 | ret = PTR_ERR(s); | ||
851 | goto err_comp_cleanup; | 854 | goto err_comp_cleanup; |
855 | } | ||
852 | c->iConfiguration = s[0].id; | 856 | c->iConfiguration = s[0].id; |
853 | } | 857 | } |
854 | 858 | ||
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c index a792e322f4f1..c588e8e486e5 100644 --- a/drivers/usb/gadget/dummy_hcd.c +++ b/drivers/usb/gadget/dummy_hcd.c | |||
@@ -1001,7 +1001,6 @@ static int dummy_udc_remove(struct platform_device *pdev) | |||
1001 | struct dummy *dum = platform_get_drvdata(pdev); | 1001 | struct dummy *dum = platform_get_drvdata(pdev); |
1002 | 1002 | ||
1003 | usb_del_gadget_udc(&dum->gadget); | 1003 | usb_del_gadget_udc(&dum->gadget); |
1004 | platform_set_drvdata(pdev, NULL); | ||
1005 | device_remove_file(&dum->gadget.dev, &dev_attr_function); | 1004 | device_remove_file(&dum->gadget.dev, &dev_attr_function); |
1006 | return 0; | 1005 | return 0; |
1007 | } | 1006 | } |
@@ -2661,8 +2660,10 @@ static int __init init(void) | |||
2661 | } | 2660 | } |
2662 | for (i = 0; i < mod_data.num; i++) { | 2661 | for (i = 0; i < mod_data.num; i++) { |
2663 | dum[i] = kzalloc(sizeof(struct dummy), GFP_KERNEL); | 2662 | dum[i] = kzalloc(sizeof(struct dummy), GFP_KERNEL); |
2664 | if (!dum[i]) | 2663 | if (!dum[i]) { |
2664 | retval = -ENOMEM; | ||
2665 | goto err_add_pdata; | 2665 | goto err_add_pdata; |
2666 | } | ||
2666 | retval = platform_device_add_data(the_hcd_pdev[i], &dum[i], | 2667 | retval = platform_device_add_data(the_hcd_pdev[i], &dum[i], |
2667 | sizeof(void *)); | 2668 | sizeof(void *)); |
2668 | if (retval) | 2669 | if (retval) |
diff --git a/drivers/usb/gadget/f_ecm.c b/drivers/usb/gadget/f_ecm.c index d893d6929079..abf8a31ae146 100644 --- a/drivers/usb/gadget/f_ecm.c +++ b/drivers/usb/gadget/f_ecm.c | |||
@@ -816,6 +816,7 @@ ecm_unbind(struct usb_configuration *c, struct usb_function *f) | |||
816 | * @c: the configuration to support the network link | 816 | * @c: the configuration to support the network link |
817 | * @ethaddr: a buffer in which the ethernet address of the host side | 817 | * @ethaddr: a buffer in which the ethernet address of the host side |
818 | * side of the link was recorded | 818 | * side of the link was recorded |
819 | * @dev: eth_dev structure | ||
819 | * Context: single threaded during gadget setup | 820 | * Context: single threaded during gadget setup |
820 | * | 821 | * |
821 | * Returns zero on success, else negative errno. | 822 | * Returns zero on success, else negative errno. |
diff --git a/drivers/usb/gadget/f_subset.c b/drivers/usb/gadget/f_subset.c index 185d6f5e4e4d..7be04b342494 100644 --- a/drivers/usb/gadget/f_subset.c +++ b/drivers/usb/gadget/f_subset.c | |||
@@ -373,6 +373,7 @@ geth_unbind(struct usb_configuration *c, struct usb_function *f) | |||
373 | * @c: the configuration to support the network link | 373 | * @c: the configuration to support the network link |
374 | * @ethaddr: a buffer in which the ethernet address of the host side | 374 | * @ethaddr: a buffer in which the ethernet address of the host side |
375 | * side of the link was recorded | 375 | * side of the link was recorded |
376 | * @dev: eth_dev structure | ||
376 | * Context: single threaded during gadget setup | 377 | * Context: single threaded during gadget setup |
377 | * | 378 | * |
378 | * Returns zero on success, else negative errno. | 379 | * Returns zero on success, else negative errno. |
diff --git a/drivers/usb/gadget/f_uac2.c b/drivers/usb/gadget/f_uac2.c index c7468b6c07b0..03c1fb686644 100644 --- a/drivers/usb/gadget/f_uac2.c +++ b/drivers/usb/gadget/f_uac2.c | |||
@@ -456,8 +456,6 @@ static int snd_uac2_remove(struct platform_device *pdev) | |||
456 | { | 456 | { |
457 | struct snd_card *card = platform_get_drvdata(pdev); | 457 | struct snd_card *card = platform_get_drvdata(pdev); |
458 | 458 | ||
459 | platform_set_drvdata(pdev, NULL); | ||
460 | |||
461 | if (card) | 459 | if (card) |
462 | return snd_card_free(card); | 460 | return snd_card_free(card); |
463 | 461 | ||
diff --git a/drivers/usb/gadget/fusb300_udc.c b/drivers/usb/gadget/fusb300_udc.c index cec8871b77f9..b8632d40f8bf 100644 --- a/drivers/usb/gadget/fusb300_udc.c +++ b/drivers/usb/gadget/fusb300_udc.c | |||
@@ -1461,8 +1461,10 @@ static int __init fusb300_probe(struct platform_device *pdev) | |||
1461 | 1461 | ||
1462 | fusb300->ep0_req = fusb300_alloc_request(&fusb300->ep[0]->ep, | 1462 | fusb300->ep0_req = fusb300_alloc_request(&fusb300->ep[0]->ep, |
1463 | GFP_KERNEL); | 1463 | GFP_KERNEL); |
1464 | if (fusb300->ep0_req == NULL) | 1464 | if (fusb300->ep0_req == NULL) { |
1465 | ret = -ENOMEM; | ||
1465 | goto clean_up3; | 1466 | goto clean_up3; |
1467 | } | ||
1466 | 1468 | ||
1467 | init_controller(fusb300); | 1469 | init_controller(fusb300); |
1468 | ret = usb_add_gadget_udc(&pdev->dev, &fusb300->gadget); | 1470 | ret = usb_add_gadget_udc(&pdev->dev, &fusb300->gadget); |
diff --git a/drivers/usb/gadget/imx_udc.c b/drivers/usb/gadget/imx_udc.c index b5cebd6b0d7a..9b2d24e4c95f 100644 --- a/drivers/usb/gadget/imx_udc.c +++ b/drivers/usb/gadget/imx_udc.c | |||
@@ -1511,8 +1511,6 @@ static int __exit imx_udc_remove(struct platform_device *pdev) | |||
1511 | if (pdata->exit) | 1511 | if (pdata->exit) |
1512 | pdata->exit(&pdev->dev); | 1512 | pdata->exit(&pdev->dev); |
1513 | 1513 | ||
1514 | platform_set_drvdata(pdev, NULL); | ||
1515 | |||
1516 | return 0; | 1514 | return 0; |
1517 | } | 1515 | } |
1518 | 1516 | ||
diff --git a/drivers/usb/gadget/m66592-udc.c b/drivers/usb/gadget/m66592-udc.c index 866ef0999247..51cfe72da5bb 100644 --- a/drivers/usb/gadget/m66592-udc.c +++ b/drivers/usb/gadget/m66592-udc.c | |||
@@ -1660,8 +1660,10 @@ static int __init m66592_probe(struct platform_device *pdev) | |||
1660 | m66592->epaddr2ep[0] = &m66592->ep[0]; | 1660 | m66592->epaddr2ep[0] = &m66592->ep[0]; |
1661 | 1661 | ||
1662 | m66592->ep0_req = m66592_alloc_request(&m66592->ep[0].ep, GFP_KERNEL); | 1662 | m66592->ep0_req = m66592_alloc_request(&m66592->ep[0].ep, GFP_KERNEL); |
1663 | if (m66592->ep0_req == NULL) | 1663 | if (m66592->ep0_req == NULL) { |
1664 | ret = -ENOMEM; | ||
1664 | goto clean_up3; | 1665 | goto clean_up3; |
1666 | } | ||
1665 | m66592->ep0_req->complete = nop_completion; | 1667 | m66592->ep0_req->complete = nop_completion; |
1666 | 1668 | ||
1667 | init_controller(m66592); | 1669 | init_controller(m66592); |
diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c index ef47495dec8f..95c531d5aa4f 100644 --- a/drivers/usb/gadget/pxa25x_udc.c +++ b/drivers/usb/gadget/pxa25x_udc.c | |||
@@ -2236,7 +2236,6 @@ static int __exit pxa25x_udc_remove(struct platform_device *pdev) | |||
2236 | dev->transceiver = NULL; | 2236 | dev->transceiver = NULL; |
2237 | } | 2237 | } |
2238 | 2238 | ||
2239 | platform_set_drvdata(pdev, NULL); | ||
2240 | the_controller = NULL; | 2239 | the_controller = NULL; |
2241 | return 0; | 2240 | return 0; |
2242 | } | 2241 | } |
diff --git a/drivers/usb/gadget/r8a66597-udc.c b/drivers/usb/gadget/r8a66597-udc.c index 0b742d171843..7ff7d9cf2061 100644 --- a/drivers/usb/gadget/r8a66597-udc.c +++ b/drivers/usb/gadget/r8a66597-udc.c | |||
@@ -1977,8 +1977,10 @@ static int __init r8a66597_probe(struct platform_device *pdev) | |||
1977 | 1977 | ||
1978 | r8a66597->ep0_req = r8a66597_alloc_request(&r8a66597->ep[0].ep, | 1978 | r8a66597->ep0_req = r8a66597_alloc_request(&r8a66597->ep[0].ep, |
1979 | GFP_KERNEL); | 1979 | GFP_KERNEL); |
1980 | if (r8a66597->ep0_req == NULL) | 1980 | if (r8a66597->ep0_req == NULL) { |
1981 | ret = -ENOMEM; | ||
1981 | goto clean_up3; | 1982 | goto clean_up3; |
1983 | } | ||
1982 | r8a66597->ep0_req->complete = nop_completion; | 1984 | r8a66597->ep0_req->complete = nop_completion; |
1983 | 1985 | ||
1984 | ret = usb_add_gadget_udc(&pdev->dev, &r8a66597->gadget); | 1986 | ret = usb_add_gadget_udc(&pdev->dev, &r8a66597->gadget); |
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index a3cdc32115d5..af22f24046b2 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c | |||
@@ -437,7 +437,7 @@ static void s3c_hsotg_unmap_dma(struct s3c_hsotg *hsotg, | |||
437 | if (hs_req->req.length == 0) | 437 | if (hs_req->req.length == 0) |
438 | return; | 438 | return; |
439 | 439 | ||
440 | usb_gadget_unmap_request(&hsotg->gadget, hs_req, hs_ep->dir_in); | 440 | usb_gadget_unmap_request(&hsotg->gadget, req, hs_ep->dir_in); |
441 | } | 441 | } |
442 | 442 | ||
443 | /** | 443 | /** |
diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c index d0e75e1b3ccb..09c4f70c93c4 100644 --- a/drivers/usb/gadget/s3c2410_udc.c +++ b/drivers/usb/gadget/s3c2410_udc.c | |||
@@ -1851,6 +1851,7 @@ static int s3c2410_udc_probe(struct platform_device *pdev) | |||
1851 | irq = gpio_to_irq(udc_info->vbus_pin); | 1851 | irq = gpio_to_irq(udc_info->vbus_pin); |
1852 | if (irq < 0) { | 1852 | if (irq < 0) { |
1853 | dev_err(dev, "no irq for gpio vbus pin\n"); | 1853 | dev_err(dev, "no irq for gpio vbus pin\n"); |
1854 | retval = irq; | ||
1854 | goto err_gpio_claim; | 1855 | goto err_gpio_claim; |
1855 | } | 1856 | } |
1856 | 1857 | ||
@@ -1948,8 +1949,6 @@ static int s3c2410_udc_remove(struct platform_device *pdev) | |||
1948 | iounmap(base_addr); | 1949 | iounmap(base_addr); |
1949 | release_mem_region(rsrc_start, rsrc_len); | 1950 | release_mem_region(rsrc_start, rsrc_len); |
1950 | 1951 | ||
1951 | platform_set_drvdata(pdev, NULL); | ||
1952 | |||
1953 | if (!IS_ERR(udc_clock) && udc_clock != NULL) { | 1952 | if (!IS_ERR(udc_clock) && udc_clock != NULL) { |
1954 | clk_disable(udc_clock); | 1953 | clk_disable(udc_clock); |
1955 | clk_put(udc_clock); | 1954 | clk_put(udc_clock); |
diff --git a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c index 2cd6262e8b71..0deb9d6cde26 100644 --- a/drivers/usb/gadget/zero.c +++ b/drivers/usb/gadget/zero.c | |||
@@ -284,12 +284,16 @@ static int __init zero_bind(struct usb_composite_dev *cdev) | |||
284 | ss_opts->bulk_buflen = gzero_options.bulk_buflen; | 284 | ss_opts->bulk_buflen = gzero_options.bulk_buflen; |
285 | 285 | ||
286 | func_ss = usb_get_function(func_inst_ss); | 286 | func_ss = usb_get_function(func_inst_ss); |
287 | if (IS_ERR(func_ss)) | 287 | if (IS_ERR(func_ss)) { |
288 | status = PTR_ERR(func_ss); | ||
288 | goto err_put_func_inst_ss; | 289 | goto err_put_func_inst_ss; |
290 | } | ||
289 | 291 | ||
290 | func_inst_lb = usb_get_function_instance("Loopback"); | 292 | func_inst_lb = usb_get_function_instance("Loopback"); |
291 | if (IS_ERR(func_inst_lb)) | 293 | if (IS_ERR(func_inst_lb)) { |
294 | status = PTR_ERR(func_inst_lb); | ||
292 | goto err_put_func_ss; | 295 | goto err_put_func_ss; |
296 | } | ||
293 | 297 | ||
294 | lb_opts = container_of(func_inst_lb, struct f_lb_opts, func_inst); | 298 | lb_opts = container_of(func_inst_lb, struct f_lb_opts, func_inst); |
295 | lb_opts->bulk_buflen = gzero_options.bulk_buflen; | 299 | lb_opts->bulk_buflen = gzero_options.bulk_buflen; |
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index de94f2699063..344d5e2f87d7 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig | |||
@@ -507,7 +507,7 @@ endif # USB_OHCI_HCD | |||
507 | 507 | ||
508 | config USB_UHCI_HCD | 508 | config USB_UHCI_HCD |
509 | tristate "UHCI HCD (most Intel and VIA) support" | 509 | tristate "UHCI HCD (most Intel and VIA) support" |
510 | depends on PCI || SPARC_LEON || ARCH_VT8500 | 510 | depends on PCI || USB_UHCI_SUPPORT_NON_PCI_HC |
511 | ---help--- | 511 | ---help--- |
512 | The Universal Host Controller Interface is a standard by Intel for | 512 | The Universal Host Controller Interface is a standard by Intel for |
513 | accessing the USB hardware in the PC (which is also called the USB | 513 | accessing the USB hardware in the PC (which is also called the USB |
@@ -524,26 +524,19 @@ config USB_UHCI_HCD | |||
524 | 524 | ||
525 | config USB_UHCI_SUPPORT_NON_PCI_HC | 525 | config USB_UHCI_SUPPORT_NON_PCI_HC |
526 | bool | 526 | bool |
527 | depends on USB_UHCI_HCD | 527 | default y if (SPARC_LEON || USB_UHCI_PLATFORM) |
528 | default y if (SPARC_LEON || ARCH_VT8500) | ||
529 | 528 | ||
530 | config USB_UHCI_PLATFORM | 529 | config USB_UHCI_PLATFORM |
531 | bool "Generic UHCI Platform Driver support" | 530 | bool |
532 | depends on USB_UHCI_SUPPORT_NON_PCI_HC | ||
533 | default y if ARCH_VT8500 | 531 | default y if ARCH_VT8500 |
534 | ---help--- | ||
535 | Enable support for generic UHCI platform devices that require no | ||
536 | additional configuration. | ||
537 | 532 | ||
538 | config USB_UHCI_BIG_ENDIAN_MMIO | 533 | config USB_UHCI_BIG_ENDIAN_MMIO |
539 | bool | 534 | bool |
540 | depends on USB_UHCI_SUPPORT_NON_PCI_HC && SPARC_LEON | 535 | default y if SPARC_LEON |
541 | default y | ||
542 | 536 | ||
543 | config USB_UHCI_BIG_ENDIAN_DESC | 537 | config USB_UHCI_BIG_ENDIAN_DESC |
544 | bool | 538 | bool |
545 | depends on USB_UHCI_SUPPORT_NON_PCI_HC && SPARC_LEON | 539 | default y if SPARC_LEON |
546 | default y | ||
547 | 540 | ||
548 | config USB_FHCI_HCD | 541 | config USB_FHCI_HCD |
549 | tristate "Freescale QE USB Host Controller support" | 542 | tristate "Freescale QE USB Host Controller support" |
diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c index 66420097c242..02f4611faa62 100644 --- a/drivers/usb/host/ehci-atmel.c +++ b/drivers/usb/host/ehci-atmel.c | |||
@@ -63,8 +63,6 @@ static void atmel_stop_ehci(struct platform_device *pdev) | |||
63 | 63 | ||
64 | /*-------------------------------------------------------------------------*/ | 64 | /*-------------------------------------------------------------------------*/ |
65 | 65 | ||
66 | static u64 at91_ehci_dma_mask = DMA_BIT_MASK(32); | ||
67 | |||
68 | static int ehci_atmel_drv_probe(struct platform_device *pdev) | 66 | static int ehci_atmel_drv_probe(struct platform_device *pdev) |
69 | { | 67 | { |
70 | struct usb_hcd *hcd; | 68 | struct usb_hcd *hcd; |
@@ -93,7 +91,9 @@ static int ehci_atmel_drv_probe(struct platform_device *pdev) | |||
93 | * Once we have dma capability bindings this can go away. | 91 | * Once we have dma capability bindings this can go away. |
94 | */ | 92 | */ |
95 | if (!pdev->dev.dma_mask) | 93 | if (!pdev->dev.dma_mask) |
96 | pdev->dev.dma_mask = &at91_ehci_dma_mask; | 94 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; |
95 | if (!pdev->dev.coherent_dma_mask) | ||
96 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | ||
97 | 97 | ||
98 | hcd = usb_create_hcd(driver, &pdev->dev, dev_name(&pdev->dev)); | 98 | hcd = usb_create_hcd(driver, &pdev->dev, dev_name(&pdev->dev)); |
99 | if (!hcd) { | 99 | if (!hcd) { |
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 312fc10da3c7..246e124e6ac5 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
@@ -1286,23 +1286,6 @@ MODULE_LICENSE ("GPL"); | |||
1286 | #define PLATFORM_DRIVER ehci_hcd_sead3_driver | 1286 | #define PLATFORM_DRIVER ehci_hcd_sead3_driver |
1287 | #endif | 1287 | #endif |
1288 | 1288 | ||
1289 | #if !IS_ENABLED(CONFIG_USB_EHCI_PCI) && \ | ||
1290 | !IS_ENABLED(CONFIG_USB_EHCI_HCD_PLATFORM) && \ | ||
1291 | !IS_ENABLED(CONFIG_USB_CHIPIDEA_HOST) && \ | ||
1292 | !IS_ENABLED(CONFIG_USB_EHCI_MXC) && \ | ||
1293 | !IS_ENABLED(CONFIG_USB_EHCI_HCD_OMAP) && \ | ||
1294 | !IS_ENABLED(CONFIG_USB_EHCI_HCD_ORION) && \ | ||
1295 | !IS_ENABLED(CONFIG_USB_EHCI_HCD_SPEAR) && \ | ||
1296 | !IS_ENABLED(CONFIG_USB_EHCI_S5P) && \ | ||
1297 | !IS_ENABLED(CONFIG_USB_EHCI_HCD_AT91) && \ | ||
1298 | !IS_ENABLED(CONFIG_USB_EHCI_MSM) && \ | ||
1299 | !defined(PLATFORM_DRIVER) && \ | ||
1300 | !defined(PS3_SYSTEM_BUS_DRIVER) && \ | ||
1301 | !defined(OF_PLATFORM_DRIVER) && \ | ||
1302 | !defined(XILINX_OF_PLATFORM_DRIVER) | ||
1303 | #error "missing bus glue for ehci-hcd" | ||
1304 | #endif | ||
1305 | |||
1306 | static int __init ehci_hcd_init(void) | 1289 | static int __init ehci_hcd_init(void) |
1307 | { | 1290 | { |
1308 | int retval = 0; | 1291 | int retval = 0; |
diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index 3d1491b5f360..16d7150e8557 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c | |||
@@ -90,8 +90,6 @@ static const struct ehci_driver_overrides ehci_omap_overrides __initdata = { | |||
90 | .extra_priv_size = sizeof(struct omap_hcd), | 90 | .extra_priv_size = sizeof(struct omap_hcd), |
91 | }; | 91 | }; |
92 | 92 | ||
93 | static u64 omap_ehci_dma_mask = DMA_BIT_MASK(32); | ||
94 | |||
95 | /** | 93 | /** |
96 | * ehci_hcd_omap_probe - initialize TI-based HCDs | 94 | * ehci_hcd_omap_probe - initialize TI-based HCDs |
97 | * | 95 | * |
@@ -146,8 +144,10 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) | |||
146 | * Since shared usb code relies on it, set it here for now. | 144 | * Since shared usb code relies on it, set it here for now. |
147 | * Once we have dma capability bindings this can go away. | 145 | * Once we have dma capability bindings this can go away. |
148 | */ | 146 | */ |
149 | if (!pdev->dev.dma_mask) | 147 | if (!dev->dma_mask) |
150 | pdev->dev.dma_mask = &omap_ehci_dma_mask; | 148 | dev->dma_mask = &dev->coherent_dma_mask; |
149 | if (!dev->coherent_dma_mask) | ||
150 | dev->coherent_dma_mask = DMA_BIT_MASK(32); | ||
151 | 151 | ||
152 | hcd = usb_create_hcd(&ehci_omap_hc_driver, dev, | 152 | hcd = usb_create_hcd(&ehci_omap_hc_driver, dev, |
153 | dev_name(dev)); | 153 | dev_name(dev)); |
diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c index 54c579485150..efbc588b48c5 100644 --- a/drivers/usb/host/ehci-orion.c +++ b/drivers/usb/host/ehci-orion.c | |||
@@ -137,8 +137,6 @@ ehci_orion_conf_mbus_windows(struct usb_hcd *hcd, | |||
137 | } | 137 | } |
138 | } | 138 | } |
139 | 139 | ||
140 | static u64 ehci_orion_dma_mask = DMA_BIT_MASK(32); | ||
141 | |||
142 | static int ehci_orion_drv_probe(struct platform_device *pdev) | 140 | static int ehci_orion_drv_probe(struct platform_device *pdev) |
143 | { | 141 | { |
144 | struct orion_ehci_data *pd = pdev->dev.platform_data; | 142 | struct orion_ehci_data *pd = pdev->dev.platform_data; |
@@ -183,7 +181,9 @@ static int ehci_orion_drv_probe(struct platform_device *pdev) | |||
183 | * now. Once we have dma capability bindings this can go away. | 181 | * now. Once we have dma capability bindings this can go away. |
184 | */ | 182 | */ |
185 | if (!pdev->dev.dma_mask) | 183 | if (!pdev->dev.dma_mask) |
186 | pdev->dev.dma_mask = &ehci_orion_dma_mask; | 184 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; |
185 | if (!pdev->dev.coherent_dma_mask) | ||
186 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | ||
187 | 187 | ||
188 | if (!request_mem_region(res->start, resource_size(res), | 188 | if (!request_mem_region(res->start, resource_size(res), |
189 | ehci_orion_hc_driver.description)) { | 189 | ehci_orion_hc_driver.description)) { |
diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c index 635775278c7f..379037f51a2f 100644 --- a/drivers/usb/host/ehci-s5p.c +++ b/drivers/usb/host/ehci-s5p.c | |||
@@ -71,8 +71,6 @@ static void s5p_setup_vbus_gpio(struct platform_device *pdev) | |||
71 | dev_err(dev, "can't request ehci vbus gpio %d", gpio); | 71 | dev_err(dev, "can't request ehci vbus gpio %d", gpio); |
72 | } | 72 | } |
73 | 73 | ||
74 | static u64 ehci_s5p_dma_mask = DMA_BIT_MASK(32); | ||
75 | |||
76 | static int s5p_ehci_probe(struct platform_device *pdev) | 74 | static int s5p_ehci_probe(struct platform_device *pdev) |
77 | { | 75 | { |
78 | struct s5p_ehci_platdata *pdata = pdev->dev.platform_data; | 76 | struct s5p_ehci_platdata *pdata = pdev->dev.platform_data; |
@@ -90,7 +88,7 @@ static int s5p_ehci_probe(struct platform_device *pdev) | |||
90 | * Once we move to full device tree support this will vanish off. | 88 | * Once we move to full device tree support this will vanish off. |
91 | */ | 89 | */ |
92 | if (!pdev->dev.dma_mask) | 90 | if (!pdev->dev.dma_mask) |
93 | pdev->dev.dma_mask = &ehci_s5p_dma_mask; | 91 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; |
94 | if (!pdev->dev.coherent_dma_mask) | 92 | if (!pdev->dev.coherent_dma_mask) |
95 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | 93 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); |
96 | 94 | ||
@@ -107,6 +105,7 @@ static int s5p_ehci_probe(struct platform_device *pdev) | |||
107 | if (IS_ERR(phy)) { | 105 | if (IS_ERR(phy)) { |
108 | /* Fallback to pdata */ | 106 | /* Fallback to pdata */ |
109 | if (!pdata) { | 107 | if (!pdata) { |
108 | usb_put_hcd(hcd); | ||
110 | dev_warn(&pdev->dev, "no platform data or transceiver defined\n"); | 109 | dev_warn(&pdev->dev, "no platform data or transceiver defined\n"); |
111 | return -EPROBE_DEFER; | 110 | return -EPROBE_DEFER; |
112 | } else { | 111 | } else { |
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index acff5b8f6e89..f80d0330d548 100644 --- a/drivers/usb/host/ehci-sched.c +++ b/drivers/usb/host/ehci-sched.c | |||
@@ -213,7 +213,7 @@ static inline unsigned char tt_start_uframe(struct ehci_hcd *ehci, __hc32 mask) | |||
213 | } | 213 | } |
214 | 214 | ||
215 | static const unsigned char | 215 | static const unsigned char |
216 | max_tt_usecs[] = { 125, 125, 125, 125, 125, 125, 125, 25 }; | 216 | max_tt_usecs[] = { 125, 125, 125, 125, 125, 125, 30, 0 }; |
217 | 217 | ||
218 | /* carryover low/fullspeed bandwidth that crosses uframe boundries */ | 218 | /* carryover low/fullspeed bandwidth that crosses uframe boundries */ |
219 | static inline void carryover_tt_bandwidth(unsigned short tt_usecs[8]) | 219 | static inline void carryover_tt_bandwidth(unsigned short tt_usecs[8]) |
@@ -646,6 +646,10 @@ static void end_unlink_intr(struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
646 | /* reschedule QH iff another request is queued */ | 646 | /* reschedule QH iff another request is queued */ |
647 | if (!list_empty(&qh->qtd_list) && ehci->rh_state == EHCI_RH_RUNNING) { | 647 | if (!list_empty(&qh->qtd_list) && ehci->rh_state == EHCI_RH_RUNNING) { |
648 | rc = qh_schedule(ehci, qh); | 648 | rc = qh_schedule(ehci, qh); |
649 | if (rc == 0) { | ||
650 | qh_refresh(ehci, qh); | ||
651 | qh_link_periodic(ehci, qh); | ||
652 | } | ||
649 | 653 | ||
650 | /* An error here likely indicates handshake failure | 654 | /* An error here likely indicates handshake failure |
651 | * or no space left in the schedule. Neither fault | 655 | * or no space left in the schedule. Neither fault |
@@ -653,9 +657,10 @@ static void end_unlink_intr(struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
653 | * | 657 | * |
654 | * FIXME kill the now-dysfunctional queued urbs | 658 | * FIXME kill the now-dysfunctional queued urbs |
655 | */ | 659 | */ |
656 | if (rc != 0) | 660 | else { |
657 | ehci_err(ehci, "can't reschedule qh %p, err %d\n", | 661 | ehci_err(ehci, "can't reschedule qh %p, err %d\n", |
658 | qh, rc); | 662 | qh, rc); |
663 | } | ||
659 | } | 664 | } |
660 | 665 | ||
661 | /* maybe turn off periodic schedule */ | 666 | /* maybe turn off periodic schedule */ |
diff --git a/drivers/usb/host/ehci-spear.c b/drivers/usb/host/ehci-spear.c index 61ecfb3d52f5..bd3e5cbc6240 100644 --- a/drivers/usb/host/ehci-spear.c +++ b/drivers/usb/host/ehci-spear.c | |||
@@ -58,8 +58,6 @@ static int ehci_spear_drv_resume(struct device *dev) | |||
58 | static SIMPLE_DEV_PM_OPS(ehci_spear_pm_ops, ehci_spear_drv_suspend, | 58 | static SIMPLE_DEV_PM_OPS(ehci_spear_pm_ops, ehci_spear_drv_suspend, |
59 | ehci_spear_drv_resume); | 59 | ehci_spear_drv_resume); |
60 | 60 | ||
61 | static u64 spear_ehci_dma_mask = DMA_BIT_MASK(32); | ||
62 | |||
63 | static int spear_ehci_hcd_drv_probe(struct platform_device *pdev) | 61 | static int spear_ehci_hcd_drv_probe(struct platform_device *pdev) |
64 | { | 62 | { |
65 | struct usb_hcd *hcd ; | 63 | struct usb_hcd *hcd ; |
@@ -84,7 +82,9 @@ static int spear_ehci_hcd_drv_probe(struct platform_device *pdev) | |||
84 | * Once we have dma capability bindings this can go away. | 82 | * Once we have dma capability bindings this can go away. |
85 | */ | 83 | */ |
86 | if (!pdev->dev.dma_mask) | 84 | if (!pdev->dev.dma_mask) |
87 | pdev->dev.dma_mask = &spear_ehci_dma_mask; | 85 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; |
86 | if (!pdev->dev.coherent_dma_mask) | ||
87 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | ||
88 | 88 | ||
89 | usbh_clk = devm_clk_get(&pdev->dev, NULL); | 89 | usbh_clk = devm_clk_get(&pdev->dev, NULL); |
90 | if (IS_ERR(usbh_clk)) { | 90 | if (IS_ERR(usbh_clk)) { |
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index e3eddc31ac83..59d111bf44a9 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c | |||
@@ -637,8 +637,6 @@ static void tegra_ehci_set_phcd(struct usb_phy *x, bool enable) | |||
637 | writel(val, base + TEGRA_USB_PORTSC1); | 637 | writel(val, base + TEGRA_USB_PORTSC1); |
638 | } | 638 | } |
639 | 639 | ||
640 | static u64 tegra_ehci_dma_mask = DMA_BIT_MASK(32); | ||
641 | |||
642 | static int tegra_ehci_probe(struct platform_device *pdev) | 640 | static int tegra_ehci_probe(struct platform_device *pdev) |
643 | { | 641 | { |
644 | struct resource *res; | 642 | struct resource *res; |
@@ -661,7 +659,9 @@ static int tegra_ehci_probe(struct platform_device *pdev) | |||
661 | * Once we have dma capability bindings this can go away. | 659 | * Once we have dma capability bindings this can go away. |
662 | */ | 660 | */ |
663 | if (!pdev->dev.dma_mask) | 661 | if (!pdev->dev.dma_mask) |
664 | pdev->dev.dma_mask = &tegra_ehci_dma_mask; | 662 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; |
663 | if (!pdev->dev.coherent_dma_mask) | ||
664 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | ||
665 | 665 | ||
666 | setup_vbus_gpio(pdev, pdata); | 666 | setup_vbus_gpio(pdev, pdata); |
667 | 667 | ||
diff --git a/drivers/usb/host/isp1760-hcd.c b/drivers/usb/host/isp1760-hcd.c index 125e261f5bfc..2facee53eab1 100644 --- a/drivers/usb/host/isp1760-hcd.c +++ b/drivers/usb/host/isp1760-hcd.c | |||
@@ -1739,7 +1739,7 @@ static int isp1760_hub_status_data(struct usb_hcd *hcd, char *buf) | |||
1739 | int retval = 1; | 1739 | int retval = 1; |
1740 | unsigned long flags; | 1740 | unsigned long flags; |
1741 | 1741 | ||
1742 | /* if !USB_SUSPEND, root hub timers won't get shut down ... */ | 1742 | /* if !PM_RUNTIME, root hub timers won't get shut down ... */ |
1743 | if (!HC_IS_RUNNING(hcd->state)) | 1743 | if (!HC_IS_RUNNING(hcd->state)) |
1744 | return 0; | 1744 | return 0; |
1745 | 1745 | ||
diff --git a/drivers/usb/host/isp1760-if.c b/drivers/usb/host/isp1760-if.c index bbb791bd7617..a13709ee4e5d 100644 --- a/drivers/usb/host/isp1760-if.c +++ b/drivers/usb/host/isp1760-if.c | |||
@@ -373,8 +373,10 @@ static int isp1760_plat_probe(struct platform_device *pdev) | |||
373 | irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); | 373 | irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); |
374 | if (!irq_res) { | 374 | if (!irq_res) { |
375 | pr_warning("isp1760: IRQ resource not available\n"); | 375 | pr_warning("isp1760: IRQ resource not available\n"); |
376 | return -ENODEV; | 376 | ret = -ENODEV; |
377 | goto cleanup; | ||
377 | } | 378 | } |
379 | |||
378 | irqflags |= irq_res->flags & IRQF_TRIGGER_MASK; | 380 | irqflags |= irq_res->flags & IRQF_TRIGGER_MASK; |
379 | 381 | ||
380 | if (priv) { | 382 | if (priv) { |
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index a0cb44f0e724..2ee1496dbc1d 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c | |||
@@ -504,8 +504,6 @@ static const struct of_device_id at91_ohci_dt_ids[] = { | |||
504 | 504 | ||
505 | MODULE_DEVICE_TABLE(of, at91_ohci_dt_ids); | 505 | MODULE_DEVICE_TABLE(of, at91_ohci_dt_ids); |
506 | 506 | ||
507 | static u64 at91_ohci_dma_mask = DMA_BIT_MASK(32); | ||
508 | |||
509 | static int ohci_at91_of_init(struct platform_device *pdev) | 507 | static int ohci_at91_of_init(struct platform_device *pdev) |
510 | { | 508 | { |
511 | struct device_node *np = pdev->dev.of_node; | 509 | struct device_node *np = pdev->dev.of_node; |
@@ -522,7 +520,9 @@ static int ohci_at91_of_init(struct platform_device *pdev) | |||
522 | * Once we have dma capability bindings this can go away. | 520 | * Once we have dma capability bindings this can go away. |
523 | */ | 521 | */ |
524 | if (!pdev->dev.dma_mask) | 522 | if (!pdev->dev.dma_mask) |
525 | pdev->dev.dma_mask = &at91_ohci_dma_mask; | 523 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; |
524 | if (!pdev->dev.coherent_dma_mask) | ||
525 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | ||
526 | 526 | ||
527 | pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); | 527 | pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); |
528 | if (!pdata) | 528 | if (!pdata) |
diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c index 07592c00af26..b0b542c14e31 100644 --- a/drivers/usb/host/ohci-exynos.c +++ b/drivers/usb/host/ohci-exynos.c | |||
@@ -98,8 +98,6 @@ static const struct hc_driver exynos_ohci_hc_driver = { | |||
98 | .start_port_reset = ohci_start_port_reset, | 98 | .start_port_reset = ohci_start_port_reset, |
99 | }; | 99 | }; |
100 | 100 | ||
101 | static u64 ohci_exynos_dma_mask = DMA_BIT_MASK(32); | ||
102 | |||
103 | static int exynos_ohci_probe(struct platform_device *pdev) | 101 | static int exynos_ohci_probe(struct platform_device *pdev) |
104 | { | 102 | { |
105 | struct exynos4_ohci_platdata *pdata = pdev->dev.platform_data; | 103 | struct exynos4_ohci_platdata *pdata = pdev->dev.platform_data; |
@@ -117,7 +115,7 @@ static int exynos_ohci_probe(struct platform_device *pdev) | |||
117 | * Once we move to full device tree support this will vanish off. | 115 | * Once we move to full device tree support this will vanish off. |
118 | */ | 116 | */ |
119 | if (!pdev->dev.dma_mask) | 117 | if (!pdev->dev.dma_mask) |
120 | pdev->dev.dma_mask = &ohci_exynos_dma_mask; | 118 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; |
121 | if (!pdev->dev.coherent_dma_mask) | 119 | if (!pdev->dev.coherent_dma_mask) |
122 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | 120 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); |
123 | 121 | ||
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index 9e6de9586ae4..fc627fd54116 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c | |||
@@ -233,14 +233,14 @@ static int ohci_urb_enqueue ( | |||
233 | urb->start_frame = frame; | 233 | urb->start_frame = frame; |
234 | } | 234 | } |
235 | } else if (ed->type == PIPE_ISOCHRONOUS) { | 235 | } else if (ed->type == PIPE_ISOCHRONOUS) { |
236 | u16 next = ohci_frame_no(ohci) + 2; | 236 | u16 next = ohci_frame_no(ohci) + 1; |
237 | u16 frame = ed->last_iso + ed->interval; | 237 | u16 frame = ed->last_iso + ed->interval; |
238 | 238 | ||
239 | /* Behind the scheduling threshold? */ | 239 | /* Behind the scheduling threshold? */ |
240 | if (unlikely(tick_before(frame, next))) { | 240 | if (unlikely(tick_before(frame, next))) { |
241 | 241 | ||
242 | /* USB_ISO_ASAP: Round up to the first available slot */ | 242 | /* USB_ISO_ASAP: Round up to the first available slot */ |
243 | if (urb->transfer_flags & URB_ISO_ASAP) | 243 | if (urb->transfer_flags & URB_ISO_ASAP) { |
244 | frame += (next - frame + ed->interval - 1) & | 244 | frame += (next - frame + ed->interval - 1) & |
245 | -ed->interval; | 245 | -ed->interval; |
246 | 246 | ||
@@ -248,21 +248,25 @@ static int ohci_urb_enqueue ( | |||
248 | * Not ASAP: Use the next slot in the stream. If | 248 | * Not ASAP: Use the next slot in the stream. If |
249 | * the entire URB falls before the threshold, fail. | 249 | * the entire URB falls before the threshold, fail. |
250 | */ | 250 | */ |
251 | else if (tick_before(frame + ed->interval * | 251 | } else { |
252 | if (tick_before(frame + ed->interval * | ||
252 | (urb->number_of_packets - 1), next)) { | 253 | (urb->number_of_packets - 1), next)) { |
253 | retval = -EXDEV; | 254 | retval = -EXDEV; |
254 | usb_hcd_unlink_urb_from_ep(hcd, urb); | 255 | usb_hcd_unlink_urb_from_ep(hcd, urb); |
255 | goto fail; | 256 | goto fail; |
256 | } | 257 | } |
257 | 258 | ||
258 | /* | 259 | /* |
259 | * Some OHCI hardware doesn't handle late TDs | 260 | * Some OHCI hardware doesn't handle late TDs |
260 | * correctly. After retiring them it proceeds to | 261 | * correctly. After retiring them it proceeds |
261 | * the next ED instead of the next TD. Therefore | 262 | * to the next ED instead of the next TD. |
262 | * we have to omit the late TDs entirely. | 263 | * Therefore we have to omit the late TDs |
263 | */ | 264 | * entirely. |
264 | urb_priv->td_cnt = DIV_ROUND_UP(next - frame, | 265 | */ |
265 | ed->interval); | 266 | urb_priv->td_cnt = DIV_ROUND_UP( |
267 | (u16) (next - frame), | ||
268 | ed->interval); | ||
269 | } | ||
266 | } | 270 | } |
267 | urb->start_frame = frame; | 271 | urb->start_frame = frame; |
268 | } | 272 | } |
diff --git a/drivers/usb/host/ohci-nxp.c b/drivers/usb/host/ohci-nxp.c index f4988fbe78e7..5d7eb72c5064 100644 --- a/drivers/usb/host/ohci-nxp.c +++ b/drivers/usb/host/ohci-nxp.c | |||
@@ -223,8 +223,7 @@ static int usb_hcd_nxp_probe(struct platform_device *pdev) | |||
223 | 223 | ||
224 | isp1301_i2c_client = isp1301_get_client(isp1301_node); | 224 | isp1301_i2c_client = isp1301_get_client(isp1301_node); |
225 | if (!isp1301_i2c_client) { | 225 | if (!isp1301_i2c_client) { |
226 | ret = -EPROBE_DEFER; | 226 | return -EPROBE_DEFER; |
227 | goto out; | ||
228 | } | 227 | } |
229 | 228 | ||
230 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | 229 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); |
@@ -234,7 +233,7 @@ static int usb_hcd_nxp_probe(struct platform_device *pdev) | |||
234 | if (usb_disabled()) { | 233 | if (usb_disabled()) { |
235 | dev_err(&pdev->dev, "USB is disabled\n"); | 234 | dev_err(&pdev->dev, "USB is disabled\n"); |
236 | ret = -ENODEV; | 235 | ret = -ENODEV; |
237 | goto out; | 236 | goto fail_disable; |
238 | } | 237 | } |
239 | 238 | ||
240 | /* Enable AHB slave USB clock, needed for further USB clock control */ | 239 | /* Enable AHB slave USB clock, needed for further USB clock control */ |
@@ -245,19 +244,19 @@ static int usb_hcd_nxp_probe(struct platform_device *pdev) | |||
245 | if (IS_ERR(usb_pll_clk)) { | 244 | if (IS_ERR(usb_pll_clk)) { |
246 | dev_err(&pdev->dev, "failed to acquire USB PLL\n"); | 245 | dev_err(&pdev->dev, "failed to acquire USB PLL\n"); |
247 | ret = PTR_ERR(usb_pll_clk); | 246 | ret = PTR_ERR(usb_pll_clk); |
248 | goto out1; | 247 | goto fail_pll; |
249 | } | 248 | } |
250 | 249 | ||
251 | ret = clk_enable(usb_pll_clk); | 250 | ret = clk_enable(usb_pll_clk); |
252 | if (ret < 0) { | 251 | if (ret < 0) { |
253 | dev_err(&pdev->dev, "failed to start USB PLL\n"); | 252 | dev_err(&pdev->dev, "failed to start USB PLL\n"); |
254 | goto out2; | 253 | goto fail_pllen; |
255 | } | 254 | } |
256 | 255 | ||
257 | ret = clk_set_rate(usb_pll_clk, 48000); | 256 | ret = clk_set_rate(usb_pll_clk, 48000); |
258 | if (ret < 0) { | 257 | if (ret < 0) { |
259 | dev_err(&pdev->dev, "failed to set USB clock rate\n"); | 258 | dev_err(&pdev->dev, "failed to set USB clock rate\n"); |
260 | goto out3; | 259 | goto fail_rate; |
261 | } | 260 | } |
262 | 261 | ||
263 | /* Enable USB device clock */ | 262 | /* Enable USB device clock */ |
@@ -265,13 +264,13 @@ static int usb_hcd_nxp_probe(struct platform_device *pdev) | |||
265 | if (IS_ERR(usb_dev_clk)) { | 264 | if (IS_ERR(usb_dev_clk)) { |
266 | dev_err(&pdev->dev, "failed to acquire USB DEV Clock\n"); | 265 | dev_err(&pdev->dev, "failed to acquire USB DEV Clock\n"); |
267 | ret = PTR_ERR(usb_dev_clk); | 266 | ret = PTR_ERR(usb_dev_clk); |
268 | goto out4; | 267 | goto fail_dev; |
269 | } | 268 | } |
270 | 269 | ||
271 | ret = clk_enable(usb_dev_clk); | 270 | ret = clk_enable(usb_dev_clk); |
272 | if (ret < 0) { | 271 | if (ret < 0) { |
273 | dev_err(&pdev->dev, "failed to start USB DEV Clock\n"); | 272 | dev_err(&pdev->dev, "failed to start USB DEV Clock\n"); |
274 | goto out5; | 273 | goto fail_deven; |
275 | } | 274 | } |
276 | 275 | ||
277 | /* Enable USB otg clocks */ | 276 | /* Enable USB otg clocks */ |
@@ -279,7 +278,7 @@ static int usb_hcd_nxp_probe(struct platform_device *pdev) | |||
279 | if (IS_ERR(usb_otg_clk)) { | 278 | if (IS_ERR(usb_otg_clk)) { |
280 | dev_err(&pdev->dev, "failed to acquire USB DEV Clock\n"); | 279 | dev_err(&pdev->dev, "failed to acquire USB DEV Clock\n"); |
281 | ret = PTR_ERR(usb_otg_clk); | 280 | ret = PTR_ERR(usb_otg_clk); |
282 | goto out6; | 281 | goto fail_otg; |
283 | } | 282 | } |
284 | 283 | ||
285 | __raw_writel(__raw_readl(USB_CTRL) | USB_HOST_NEED_CLK_EN, USB_CTRL); | 284 | __raw_writel(__raw_readl(USB_CTRL) | USB_HOST_NEED_CLK_EN, USB_CTRL); |
@@ -287,7 +286,7 @@ static int usb_hcd_nxp_probe(struct platform_device *pdev) | |||
287 | ret = clk_enable(usb_otg_clk); | 286 | ret = clk_enable(usb_otg_clk); |
288 | if (ret < 0) { | 287 | if (ret < 0) { |
289 | dev_err(&pdev->dev, "failed to start USB DEV Clock\n"); | 288 | dev_err(&pdev->dev, "failed to start USB DEV Clock\n"); |
290 | goto out7; | 289 | goto fail_otgen; |
291 | } | 290 | } |
292 | 291 | ||
293 | isp1301_configure(); | 292 | isp1301_configure(); |
@@ -296,20 +295,14 @@ static int usb_hcd_nxp_probe(struct platform_device *pdev) | |||
296 | if (!hcd) { | 295 | if (!hcd) { |
297 | dev_err(&pdev->dev, "Failed to allocate HC buffer\n"); | 296 | dev_err(&pdev->dev, "Failed to allocate HC buffer\n"); |
298 | ret = -ENOMEM; | 297 | ret = -ENOMEM; |
299 | goto out8; | 298 | goto fail_hcd; |
300 | } | 299 | } |
301 | 300 | ||
302 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 301 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
303 | if (!res) { | ||
304 | dev_err(&pdev->dev, "Failed to get MEM resource\n"); | ||
305 | ret = -ENOMEM; | ||
306 | goto out8; | ||
307 | } | ||
308 | |||
309 | hcd->regs = devm_ioremap_resource(&pdev->dev, res); | 302 | hcd->regs = devm_ioremap_resource(&pdev->dev, res); |
310 | if (IS_ERR(hcd->regs)) { | 303 | if (IS_ERR(hcd->regs)) { |
311 | ret = PTR_ERR(hcd->regs); | 304 | ret = PTR_ERR(hcd->regs); |
312 | goto out8; | 305 | goto fail_resource; |
313 | } | 306 | } |
314 | hcd->rsrc_start = res->start; | 307 | hcd->rsrc_start = res->start; |
315 | hcd->rsrc_len = resource_size(res); | 308 | hcd->rsrc_len = resource_size(res); |
@@ -317,7 +310,7 @@ static int usb_hcd_nxp_probe(struct platform_device *pdev) | |||
317 | irq = platform_get_irq(pdev, 0); | 310 | irq = platform_get_irq(pdev, 0); |
318 | if (irq < 0) { | 311 | if (irq < 0) { |
319 | ret = -ENXIO; | 312 | ret = -ENXIO; |
320 | goto out8; | 313 | goto fail_resource; |
321 | } | 314 | } |
322 | 315 | ||
323 | nxp_start_hc(); | 316 | nxp_start_hc(); |
@@ -331,23 +324,24 @@ static int usb_hcd_nxp_probe(struct platform_device *pdev) | |||
331 | return ret; | 324 | return ret; |
332 | 325 | ||
333 | nxp_stop_hc(); | 326 | nxp_stop_hc(); |
334 | out8: | 327 | fail_resource: |
335 | usb_put_hcd(hcd); | 328 | usb_put_hcd(hcd); |
336 | out7: | 329 | fail_hcd: |
337 | clk_disable(usb_otg_clk); | 330 | clk_disable(usb_otg_clk); |
338 | out6: | 331 | fail_otgen: |
339 | clk_put(usb_otg_clk); | 332 | clk_put(usb_otg_clk); |
340 | out5: | 333 | fail_otg: |
341 | clk_disable(usb_dev_clk); | 334 | clk_disable(usb_dev_clk); |
342 | out4: | 335 | fail_deven: |
343 | clk_put(usb_dev_clk); | 336 | clk_put(usb_dev_clk); |
344 | out3: | 337 | fail_dev: |
338 | fail_rate: | ||
345 | clk_disable(usb_pll_clk); | 339 | clk_disable(usb_pll_clk); |
346 | out2: | 340 | fail_pllen: |
347 | clk_put(usb_pll_clk); | 341 | clk_put(usb_pll_clk); |
348 | out1: | 342 | fail_pll: |
343 | fail_disable: | ||
349 | isp1301_i2c_client = NULL; | 344 | isp1301_i2c_client = NULL; |
350 | out: | ||
351 | return ret; | 345 | return ret; |
352 | } | 346 | } |
353 | 347 | ||
diff --git a/drivers/usb/host/ohci-omap3.c b/drivers/usb/host/ohci-omap3.c index ddfc31427bc0..8663851c8d8e 100644 --- a/drivers/usb/host/ohci-omap3.c +++ b/drivers/usb/host/ohci-omap3.c | |||
@@ -114,8 +114,6 @@ static const struct hc_driver ohci_omap3_hc_driver = { | |||
114 | 114 | ||
115 | /*-------------------------------------------------------------------------*/ | 115 | /*-------------------------------------------------------------------------*/ |
116 | 116 | ||
117 | static u64 omap_ohci_dma_mask = DMA_BIT_MASK(32); | ||
118 | |||
119 | /* | 117 | /* |
120 | * configure so an HC device and id are always provided | 118 | * configure so an HC device and id are always provided |
121 | * always called with process context; sleeping is OK | 119 | * always called with process context; sleeping is OK |
@@ -168,8 +166,10 @@ static int ohci_hcd_omap3_probe(struct platform_device *pdev) | |||
168 | * Since shared usb code relies on it, set it here for now. | 166 | * Since shared usb code relies on it, set it here for now. |
169 | * Once we have dma capability bindings this can go away. | 167 | * Once we have dma capability bindings this can go away. |
170 | */ | 168 | */ |
171 | if (!pdev->dev.dma_mask) | 169 | if (!dev->dma_mask) |
172 | pdev->dev.dma_mask = &omap_ohci_dma_mask; | 170 | dev->dma_mask = &dev->coherent_dma_mask; |
171 | if (!dev->coherent_dma_mask) | ||
172 | dev->coherent_dma_mask = DMA_BIT_MASK(32); | ||
173 | 173 | ||
174 | hcd = usb_create_hcd(&ohci_omap3_hc_driver, dev, | 174 | hcd = usb_create_hcd(&ohci_omap3_hc_driver, dev, |
175 | dev_name(dev)); | 175 | dev_name(dev)); |
diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c index efe71f3ca477..279b2ef17411 100644 --- a/drivers/usb/host/ohci-pxa27x.c +++ b/drivers/usb/host/ohci-pxa27x.c | |||
@@ -282,8 +282,6 @@ static const struct of_device_id pxa_ohci_dt_ids[] = { | |||
282 | 282 | ||
283 | MODULE_DEVICE_TABLE(of, pxa_ohci_dt_ids); | 283 | MODULE_DEVICE_TABLE(of, pxa_ohci_dt_ids); |
284 | 284 | ||
285 | static u64 pxa_ohci_dma_mask = DMA_BIT_MASK(32); | ||
286 | |||
287 | static int ohci_pxa_of_init(struct platform_device *pdev) | 285 | static int ohci_pxa_of_init(struct platform_device *pdev) |
288 | { | 286 | { |
289 | struct device_node *np = pdev->dev.of_node; | 287 | struct device_node *np = pdev->dev.of_node; |
@@ -298,7 +296,9 @@ static int ohci_pxa_of_init(struct platform_device *pdev) | |||
298 | * Once we have dma capability bindings this can go away. | 296 | * Once we have dma capability bindings this can go away. |
299 | */ | 297 | */ |
300 | if (!pdev->dev.dma_mask) | 298 | if (!pdev->dev.dma_mask) |
301 | pdev->dev.dma_mask = &pxa_ohci_dma_mask; | 299 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; |
300 | if (!pdev->dev.coherent_dma_mask) | ||
301 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | ||
302 | 302 | ||
303 | pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); | 303 | pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); |
304 | if (!pdata) | 304 | if (!pdata) |
diff --git a/drivers/usb/host/ohci-spear.c b/drivers/usb/host/ohci-spear.c index 9020bf0e2eca..3e19e0170d11 100644 --- a/drivers/usb/host/ohci-spear.c +++ b/drivers/usb/host/ohci-spear.c | |||
@@ -91,8 +91,6 @@ static const struct hc_driver ohci_spear_hc_driver = { | |||
91 | .start_port_reset = ohci_start_port_reset, | 91 | .start_port_reset = ohci_start_port_reset, |
92 | }; | 92 | }; |
93 | 93 | ||
94 | static u64 spear_ohci_dma_mask = DMA_BIT_MASK(32); | ||
95 | |||
96 | static int spear_ohci_hcd_drv_probe(struct platform_device *pdev) | 94 | static int spear_ohci_hcd_drv_probe(struct platform_device *pdev) |
97 | { | 95 | { |
98 | const struct hc_driver *driver = &ohci_spear_hc_driver; | 96 | const struct hc_driver *driver = &ohci_spear_hc_driver; |
@@ -114,7 +112,9 @@ static int spear_ohci_hcd_drv_probe(struct platform_device *pdev) | |||
114 | * Once we have dma capability bindings this can go away. | 112 | * Once we have dma capability bindings this can go away. |
115 | */ | 113 | */ |
116 | if (!pdev->dev.dma_mask) | 114 | if (!pdev->dev.dma_mask) |
117 | pdev->dev.dma_mask = &spear_ohci_dma_mask; | 115 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; |
116 | if (!pdev->dev.coherent_dma_mask) | ||
117 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | ||
118 | 118 | ||
119 | usbh_clk = devm_clk_get(&pdev->dev, NULL); | 119 | usbh_clk = devm_clk_get(&pdev->dev, NULL); |
120 | if (IS_ERR(usbh_clk)) { | 120 | if (IS_ERR(usbh_clk)) { |
diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c index 4f0f0339532f..0f401dbfaf07 100644 --- a/drivers/usb/host/oxu210hp-hcd.c +++ b/drivers/usb/host/oxu210hp-hcd.c | |||
@@ -3084,7 +3084,7 @@ static int oxu_hub_status_data(struct usb_hcd *hcd, char *buf) | |||
3084 | int ports, i, retval = 1; | 3084 | int ports, i, retval = 1; |
3085 | unsigned long flags; | 3085 | unsigned long flags; |
3086 | 3086 | ||
3087 | /* if !USB_SUSPEND, root hub timers won't get shut down ... */ | 3087 | /* if !PM_RUNTIME, root hub timers won't get shut down ... */ |
3088 | if (!HC_IS_RUNNING(hcd->state)) | 3088 | if (!HC_IS_RUNNING(hcd->state)) |
3089 | return 0; | 3089 | return 0; |
3090 | 3090 | ||
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c index ad4483efb6d6..b2ec7fe758dd 100644 --- a/drivers/usb/host/sl811-hcd.c +++ b/drivers/usb/host/sl811-hcd.c | |||
@@ -22,7 +22,7 @@ | |||
22 | * and usb-storage. | 22 | * and usb-storage. |
23 | * | 23 | * |
24 | * TODO: | 24 | * TODO: |
25 | * - usb suspend/resume triggered by sl811 (with USB_SUSPEND) | 25 | * - usb suspend/resume triggered by sl811 (with PM_RUNTIME) |
26 | * - various issues noted in the code | 26 | * - various issues noted in the code |
27 | * - performance work; use both register banks; ... | 27 | * - performance work; use both register banks; ... |
28 | * - use urb->iso_frame_desc[] with ISO transfers | 28 | * - use urb->iso_frame_desc[] with ISO transfers |
diff --git a/drivers/usb/host/uhci-hub.c b/drivers/usb/host/uhci-hub.c index f87bee6d2789..9189bc984c98 100644 --- a/drivers/usb/host/uhci-hub.c +++ b/drivers/usb/host/uhci-hub.c | |||
@@ -225,7 +225,8 @@ static int uhci_hub_status_data(struct usb_hcd *hcd, char *buf) | |||
225 | /* auto-stop if nothing connected for 1 second */ | 225 | /* auto-stop if nothing connected for 1 second */ |
226 | if (any_ports_active(uhci)) | 226 | if (any_ports_active(uhci)) |
227 | uhci->rh_state = UHCI_RH_RUNNING; | 227 | uhci->rh_state = UHCI_RH_RUNNING; |
228 | else if (time_after_eq(jiffies, uhci->auto_stop_time)) | 228 | else if (time_after_eq(jiffies, uhci->auto_stop_time) && |
229 | !uhci->wait_for_hp) | ||
229 | suspend_rh(uhci, UHCI_RH_AUTO_STOPPED); | 230 | suspend_rh(uhci, UHCI_RH_AUTO_STOPPED); |
230 | break; | 231 | break; |
231 | 232 | ||
diff --git a/drivers/usb/host/uhci-platform.c b/drivers/usb/host/uhci-platform.c index 8c4dace4b14a..f1db61ada6a8 100644 --- a/drivers/usb/host/uhci-platform.c +++ b/drivers/usb/host/uhci-platform.c | |||
@@ -60,8 +60,6 @@ static const struct hc_driver uhci_platform_hc_driver = { | |||
60 | .hub_control = uhci_hub_control, | 60 | .hub_control = uhci_hub_control, |
61 | }; | 61 | }; |
62 | 62 | ||
63 | static u64 platform_uhci_dma_mask = DMA_BIT_MASK(32); | ||
64 | |||
65 | static int uhci_hcd_platform_probe(struct platform_device *pdev) | 63 | static int uhci_hcd_platform_probe(struct platform_device *pdev) |
66 | { | 64 | { |
67 | struct usb_hcd *hcd; | 65 | struct usb_hcd *hcd; |
@@ -78,7 +76,9 @@ static int uhci_hcd_platform_probe(struct platform_device *pdev) | |||
78 | * Once we have dma capability bindings this can go away. | 76 | * Once we have dma capability bindings this can go away. |
79 | */ | 77 | */ |
80 | if (!pdev->dev.dma_mask) | 78 | if (!pdev->dev.dma_mask) |
81 | pdev->dev.dma_mask = &platform_uhci_dma_mask; | 79 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; |
80 | if (!pdev->dev.coherent_dma_mask) | ||
81 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | ||
82 | 82 | ||
83 | hcd = usb_create_hcd(&uhci_platform_hc_driver, &pdev->dev, | 83 | hcd = usb_create_hcd(&uhci_platform_hc_driver, &pdev->dev, |
84 | pdev->name); | 84 | pdev->name); |
diff --git a/drivers/usb/host/uhci-q.c b/drivers/usb/host/uhci-q.c index f0976d8190bc..041c6ddb695c 100644 --- a/drivers/usb/host/uhci-q.c +++ b/drivers/usb/host/uhci-q.c | |||
@@ -1287,7 +1287,7 @@ static int uhci_submit_isochronous(struct uhci_hcd *uhci, struct urb *urb, | |||
1287 | return -EINVAL; /* Can't change the period */ | 1287 | return -EINVAL; /* Can't change the period */ |
1288 | 1288 | ||
1289 | } else { | 1289 | } else { |
1290 | next = uhci->frame_number + 2; | 1290 | next = uhci->frame_number + 1; |
1291 | 1291 | ||
1292 | /* Find the next unused frame */ | 1292 | /* Find the next unused frame */ |
1293 | if (list_empty(&qh->queue)) { | 1293 | if (list_empty(&qh->queue)) { |
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index 965b539bc474..fbf75e57628b 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c | |||
@@ -1423,15 +1423,17 @@ int xhci_endpoint_init(struct xhci_hcd *xhci, | |||
1423 | ep_ctx->ep_info2 |= cpu_to_le32(xhci_get_endpoint_type(udev, ep)); | 1423 | ep_ctx->ep_info2 |= cpu_to_le32(xhci_get_endpoint_type(udev, ep)); |
1424 | 1424 | ||
1425 | /* Set the max packet size and max burst */ | 1425 | /* Set the max packet size and max burst */ |
1426 | max_packet = GET_MAX_PACKET(usb_endpoint_maxp(&ep->desc)); | ||
1427 | max_burst = 0; | ||
1426 | switch (udev->speed) { | 1428 | switch (udev->speed) { |
1427 | case USB_SPEED_SUPER: | 1429 | case USB_SPEED_SUPER: |
1428 | max_packet = usb_endpoint_maxp(&ep->desc); | ||
1429 | ep_ctx->ep_info2 |= cpu_to_le32(MAX_PACKET(max_packet)); | ||
1430 | /* dig out max burst from ep companion desc */ | 1430 | /* dig out max burst from ep companion desc */ |
1431 | max_packet = ep->ss_ep_comp.bMaxBurst; | 1431 | max_burst = ep->ss_ep_comp.bMaxBurst; |
1432 | ep_ctx->ep_info2 |= cpu_to_le32(MAX_BURST(max_packet)); | ||
1433 | break; | 1432 | break; |
1434 | case USB_SPEED_HIGH: | 1433 | case USB_SPEED_HIGH: |
1434 | /* Some devices get this wrong */ | ||
1435 | if (usb_endpoint_xfer_bulk(&ep->desc)) | ||
1436 | max_packet = 512; | ||
1435 | /* bits 11:12 specify the number of additional transaction | 1437 | /* bits 11:12 specify the number of additional transaction |
1436 | * opportunities per microframe (USB 2.0, section 9.6.6) | 1438 | * opportunities per microframe (USB 2.0, section 9.6.6) |
1437 | */ | 1439 | */ |
@@ -1439,17 +1441,16 @@ int xhci_endpoint_init(struct xhci_hcd *xhci, | |||
1439 | usb_endpoint_xfer_int(&ep->desc)) { | 1441 | usb_endpoint_xfer_int(&ep->desc)) { |
1440 | max_burst = (usb_endpoint_maxp(&ep->desc) | 1442 | max_burst = (usb_endpoint_maxp(&ep->desc) |
1441 | & 0x1800) >> 11; | 1443 | & 0x1800) >> 11; |
1442 | ep_ctx->ep_info2 |= cpu_to_le32(MAX_BURST(max_burst)); | ||
1443 | } | 1444 | } |
1444 | /* Fall through */ | 1445 | break; |
1445 | case USB_SPEED_FULL: | 1446 | case USB_SPEED_FULL: |
1446 | case USB_SPEED_LOW: | 1447 | case USB_SPEED_LOW: |
1447 | max_packet = GET_MAX_PACKET(usb_endpoint_maxp(&ep->desc)); | ||
1448 | ep_ctx->ep_info2 |= cpu_to_le32(MAX_PACKET(max_packet)); | ||
1449 | break; | 1448 | break; |
1450 | default: | 1449 | default: |
1451 | BUG(); | 1450 | BUG(); |
1452 | } | 1451 | } |
1452 | ep_ctx->ep_info2 |= cpu_to_le32(MAX_PACKET(max_packet) | | ||
1453 | MAX_BURST(max_burst)); | ||
1453 | max_esit_payload = xhci_get_max_esit_payload(xhci, udev, ep); | 1454 | max_esit_payload = xhci_get_max_esit_payload(xhci, udev, ep); |
1454 | ep_ctx->tx_info = cpu_to_le32(MAX_ESIT_PAYLOAD_FOR_EP(max_esit_payload)); | 1455 | ep_ctx->tx_info = cpu_to_le32(MAX_ESIT_PAYLOAD_FOR_EP(max_esit_payload)); |
1455 | 1456 | ||
@@ -1826,6 +1827,9 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci) | |||
1826 | } | 1827 | } |
1827 | spin_unlock_irqrestore(&xhci->lock, flags); | 1828 | spin_unlock_irqrestore(&xhci->lock, flags); |
1828 | 1829 | ||
1830 | if (!xhci->rh_bw) | ||
1831 | goto no_bw; | ||
1832 | |||
1829 | num_ports = HCS_MAX_PORTS(xhci->hcs_params1); | 1833 | num_ports = HCS_MAX_PORTS(xhci->hcs_params1); |
1830 | for (i = 0; i < num_ports; i++) { | 1834 | for (i = 0; i < num_ports; i++) { |
1831 | struct xhci_interval_bw_table *bwt = &xhci->rh_bw[i].bw_table; | 1835 | struct xhci_interval_bw_table *bwt = &xhci->rh_bw[i].bw_table; |
@@ -1844,6 +1848,7 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci) | |||
1844 | } | 1848 | } |
1845 | } | 1849 | } |
1846 | 1850 | ||
1851 | no_bw: | ||
1847 | xhci->num_usb2_ports = 0; | 1852 | xhci->num_usb2_ports = 0; |
1848 | xhci->num_usb3_ports = 0; | 1853 | xhci->num_usb3_ports = 0; |
1849 | xhci->num_active_eps = 0; | 1854 | xhci->num_active_eps = 0; |
@@ -2255,6 +2260,9 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) | |||
2255 | u32 page_size, temp; | 2260 | u32 page_size, temp; |
2256 | int i; | 2261 | int i; |
2257 | 2262 | ||
2263 | INIT_LIST_HEAD(&xhci->lpm_failed_devs); | ||
2264 | INIT_LIST_HEAD(&xhci->cancel_cmd_list); | ||
2265 | |||
2258 | page_size = xhci_readl(xhci, &xhci->op_regs->page_size); | 2266 | page_size = xhci_readl(xhci, &xhci->op_regs->page_size); |
2259 | xhci_dbg(xhci, "Supported page size register = 0x%x\n", page_size); | 2267 | xhci_dbg(xhci, "Supported page size register = 0x%x\n", page_size); |
2260 | for (i = 0; i < 16; i++) { | 2268 | for (i = 0; i < 16; i++) { |
@@ -2333,7 +2341,6 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) | |||
2333 | xhci->cmd_ring = xhci_ring_alloc(xhci, 1, 1, TYPE_COMMAND, flags); | 2341 | xhci->cmd_ring = xhci_ring_alloc(xhci, 1, 1, TYPE_COMMAND, flags); |
2334 | if (!xhci->cmd_ring) | 2342 | if (!xhci->cmd_ring) |
2335 | goto fail; | 2343 | goto fail; |
2336 | INIT_LIST_HEAD(&xhci->cancel_cmd_list); | ||
2337 | xhci_dbg(xhci, "Allocated command ring at %p\n", xhci->cmd_ring); | 2344 | xhci_dbg(xhci, "Allocated command ring at %p\n", xhci->cmd_ring); |
2338 | xhci_dbg(xhci, "First segment DMA is 0x%llx\n", | 2345 | xhci_dbg(xhci, "First segment DMA is 0x%llx\n", |
2339 | (unsigned long long)xhci->cmd_ring->first_seg->dma); | 2346 | (unsigned long long)xhci->cmd_ring->first_seg->dma); |
@@ -2444,8 +2451,6 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) | |||
2444 | if (xhci_setup_port_arrays(xhci, flags)) | 2451 | if (xhci_setup_port_arrays(xhci, flags)) |
2445 | goto fail; | 2452 | goto fail; |
2446 | 2453 | ||
2447 | INIT_LIST_HEAD(&xhci->lpm_failed_devs); | ||
2448 | |||
2449 | /* Enable USB 3.0 device notifications for function remote wake, which | 2454 | /* Enable USB 3.0 device notifications for function remote wake, which |
2450 | * is necessary for allowing USB 3.0 devices to do remote wakeup from | 2455 | * is necessary for allowing USB 3.0 devices to do remote wakeup from |
2451 | * U3 (device suspend). | 2456 | * U3 (device suspend). |
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index 1a30c380043c..cc24e39b97d5 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c | |||
@@ -221,6 +221,14 @@ static void xhci_pci_remove(struct pci_dev *dev) | |||
221 | static int xhci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup) | 221 | static int xhci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup) |
222 | { | 222 | { |
223 | struct xhci_hcd *xhci = hcd_to_xhci(hcd); | 223 | struct xhci_hcd *xhci = hcd_to_xhci(hcd); |
224 | struct pci_dev *pdev = to_pci_dev(hcd->self.controller); | ||
225 | |||
226 | /* | ||
227 | * Systems with the TI redriver that loses port status change events | ||
228 | * need to have the registers polled during D3, so avoid D3cold. | ||
229 | */ | ||
230 | if (xhci_compliance_mode_recovery_timer_quirk_check()) | ||
231 | pdev->no_d3cold = true; | ||
224 | 232 | ||
225 | return xhci_suspend(xhci); | 233 | return xhci_suspend(xhci); |
226 | } | 234 | } |
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index b4aa79d154b2..d8f640b12dd9 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
@@ -466,7 +466,7 @@ static void compliance_mode_recovery_timer_init(struct xhci_hcd *xhci) | |||
466 | * Systems: | 466 | * Systems: |
467 | * Vendor: Hewlett-Packard -> System Models: Z420, Z620 and Z820 | 467 | * Vendor: Hewlett-Packard -> System Models: Z420, Z620 and Z820 |
468 | */ | 468 | */ |
469 | static bool compliance_mode_recovery_timer_quirk_check(void) | 469 | bool xhci_compliance_mode_recovery_timer_quirk_check(void) |
470 | { | 470 | { |
471 | const char *dmi_product_name, *dmi_sys_vendor; | 471 | const char *dmi_product_name, *dmi_sys_vendor; |
472 | 472 | ||
@@ -517,7 +517,7 @@ int xhci_init(struct usb_hcd *hcd) | |||
517 | xhci_dbg(xhci, "Finished xhci_init\n"); | 517 | xhci_dbg(xhci, "Finished xhci_init\n"); |
518 | 518 | ||
519 | /* Initializing Compliance Mode Recovery Data If Needed */ | 519 | /* Initializing Compliance Mode Recovery Data If Needed */ |
520 | if (compliance_mode_recovery_timer_quirk_check()) { | 520 | if (xhci_compliance_mode_recovery_timer_quirk_check()) { |
521 | xhci->quirks |= XHCI_COMP_MODE_QUIRK; | 521 | xhci->quirks |= XHCI_COMP_MODE_QUIRK; |
522 | compliance_mode_recovery_timer_init(xhci); | 522 | compliance_mode_recovery_timer_init(xhci); |
523 | } | 523 | } |
@@ -956,6 +956,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) | |||
956 | struct usb_hcd *hcd = xhci_to_hcd(xhci); | 956 | struct usb_hcd *hcd = xhci_to_hcd(xhci); |
957 | struct usb_hcd *secondary_hcd; | 957 | struct usb_hcd *secondary_hcd; |
958 | int retval = 0; | 958 | int retval = 0; |
959 | bool comp_timer_running = false; | ||
959 | 960 | ||
960 | /* Wait a bit if either of the roothubs need to settle from the | 961 | /* Wait a bit if either of the roothubs need to settle from the |
961 | * transition into bus suspend. | 962 | * transition into bus suspend. |
@@ -993,6 +994,13 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) | |||
993 | 994 | ||
994 | /* If restore operation fails, re-initialize the HC during resume */ | 995 | /* If restore operation fails, re-initialize the HC during resume */ |
995 | if ((temp & STS_SRE) || hibernated) { | 996 | if ((temp & STS_SRE) || hibernated) { |
997 | |||
998 | if ((xhci->quirks & XHCI_COMP_MODE_QUIRK) && | ||
999 | !(xhci_all_ports_seen_u0(xhci))) { | ||
1000 | del_timer_sync(&xhci->comp_mode_recovery_timer); | ||
1001 | xhci_dbg(xhci, "Compliance Mode Recovery Timer deleted!\n"); | ||
1002 | } | ||
1003 | |||
996 | /* Let the USB core know _both_ roothubs lost power. */ | 1004 | /* Let the USB core know _both_ roothubs lost power. */ |
997 | usb_root_hub_lost_power(xhci->main_hcd->self.root_hub); | 1005 | usb_root_hub_lost_power(xhci->main_hcd->self.root_hub); |
998 | usb_root_hub_lost_power(xhci->shared_hcd->self.root_hub); | 1006 | usb_root_hub_lost_power(xhci->shared_hcd->self.root_hub); |
@@ -1035,6 +1043,8 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) | |||
1035 | retval = xhci_init(hcd->primary_hcd); | 1043 | retval = xhci_init(hcd->primary_hcd); |
1036 | if (retval) | 1044 | if (retval) |
1037 | return retval; | 1045 | return retval; |
1046 | comp_timer_running = true; | ||
1047 | |||
1038 | xhci_dbg(xhci, "Start the primary HCD\n"); | 1048 | xhci_dbg(xhci, "Start the primary HCD\n"); |
1039 | retval = xhci_run(hcd->primary_hcd); | 1049 | retval = xhci_run(hcd->primary_hcd); |
1040 | if (!retval) { | 1050 | if (!retval) { |
@@ -1076,7 +1086,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) | |||
1076 | * to suffer the Compliance Mode issue again. It doesn't matter if | 1086 | * to suffer the Compliance Mode issue again. It doesn't matter if |
1077 | * ports have entered previously to U0 before system's suspension. | 1087 | * ports have entered previously to U0 before system's suspension. |
1078 | */ | 1088 | */ |
1079 | if (xhci->quirks & XHCI_COMP_MODE_QUIRK) | 1089 | if ((xhci->quirks & XHCI_COMP_MODE_QUIRK) && !comp_timer_running) |
1080 | compliance_mode_recovery_timer_init(xhci); | 1090 | compliance_mode_recovery_timer_init(xhci); |
1081 | 1091 | ||
1082 | /* Re-enable port polling. */ | 1092 | /* Re-enable port polling. */ |
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 29c978e37135..77600cefcaf1 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h | |||
@@ -1853,4 +1853,7 @@ struct xhci_input_control_ctx *xhci_get_input_control_ctx(struct xhci_hcd *xhci, | |||
1853 | struct xhci_slot_ctx *xhci_get_slot_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx); | 1853 | struct xhci_slot_ctx *xhci_get_slot_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx); |
1854 | struct xhci_ep_ctx *xhci_get_ep_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx, unsigned int ep_index); | 1854 | struct xhci_ep_ctx *xhci_get_ep_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx, unsigned int ep_index); |
1855 | 1855 | ||
1856 | /* xHCI quirks */ | ||
1857 | bool xhci_compliance_mode_recovery_timer_quirk_check(void); | ||
1858 | |||
1856 | #endif /* __LINUX_XHCI_HCD_H */ | 1859 | #endif /* __LINUX_XHCI_HCD_H */ |
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c index 3a18e44e9391..e1b661d04021 100644 --- a/drivers/usb/musb/musb_dsps.c +++ b/drivers/usb/musb/musb_dsps.c | |||
@@ -560,6 +560,7 @@ static int dsps_create_musb_pdev(struct dsps_glue *glue, u8 id) | |||
560 | if (!config) { | 560 | if (!config) { |
561 | dev_err(&pdev->dev, | 561 | dev_err(&pdev->dev, |
562 | "failed to allocate musb hdrc config\n"); | 562 | "failed to allocate musb hdrc config\n"); |
563 | ret = -ENOMEM; | ||
563 | goto err2; | 564 | goto err2; |
564 | } | 565 | } |
565 | 566 | ||
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index 8914dec49f01..9d3044bdebe5 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c | |||
@@ -1232,7 +1232,6 @@ void musb_host_tx(struct musb *musb, u8 epnum) | |||
1232 | void __iomem *mbase = musb->mregs; | 1232 | void __iomem *mbase = musb->mregs; |
1233 | struct dma_channel *dma; | 1233 | struct dma_channel *dma; |
1234 | bool transfer_pending = false; | 1234 | bool transfer_pending = false; |
1235 | static bool use_sg; | ||
1236 | 1235 | ||
1237 | musb_ep_select(mbase, epnum); | 1236 | musb_ep_select(mbase, epnum); |
1238 | tx_csr = musb_readw(epio, MUSB_TXCSR); | 1237 | tx_csr = musb_readw(epio, MUSB_TXCSR); |
@@ -1463,9 +1462,9 @@ done: | |||
1463 | * NULL. | 1462 | * NULL. |
1464 | */ | 1463 | */ |
1465 | if (!urb->transfer_buffer) | 1464 | if (!urb->transfer_buffer) |
1466 | use_sg = true; | 1465 | qh->use_sg = true; |
1467 | 1466 | ||
1468 | if (use_sg) { | 1467 | if (qh->use_sg) { |
1469 | /* sg_miter_start is already done in musb_ep_program */ | 1468 | /* sg_miter_start is already done in musb_ep_program */ |
1470 | if (!sg_miter_next(&qh->sg_miter)) { | 1469 | if (!sg_miter_next(&qh->sg_miter)) { |
1471 | dev_err(musb->controller, "error: sg list empty\n"); | 1470 | dev_err(musb->controller, "error: sg list empty\n"); |
@@ -1484,9 +1483,9 @@ done: | |||
1484 | 1483 | ||
1485 | qh->segsize = length; | 1484 | qh->segsize = length; |
1486 | 1485 | ||
1487 | if (use_sg) { | 1486 | if (qh->use_sg) { |
1488 | if (offset + length >= urb->transfer_buffer_length) | 1487 | if (offset + length >= urb->transfer_buffer_length) |
1489 | use_sg = false; | 1488 | qh->use_sg = false; |
1490 | } | 1489 | } |
1491 | 1490 | ||
1492 | musb_ep_select(mbase, epnum); | 1491 | musb_ep_select(mbase, epnum); |
@@ -1552,7 +1551,6 @@ void musb_host_rx(struct musb *musb, u8 epnum) | |||
1552 | bool done = false; | 1551 | bool done = false; |
1553 | u32 status; | 1552 | u32 status; |
1554 | struct dma_channel *dma; | 1553 | struct dma_channel *dma; |
1555 | static bool use_sg; | ||
1556 | unsigned int sg_flags = SG_MITER_ATOMIC | SG_MITER_TO_SG; | 1554 | unsigned int sg_flags = SG_MITER_ATOMIC | SG_MITER_TO_SG; |
1557 | 1555 | ||
1558 | musb_ep_select(mbase, epnum); | 1556 | musb_ep_select(mbase, epnum); |
@@ -1878,12 +1876,12 @@ void musb_host_rx(struct musb *musb, u8 epnum) | |||
1878 | * NULL. | 1876 | * NULL. |
1879 | */ | 1877 | */ |
1880 | if (!urb->transfer_buffer) { | 1878 | if (!urb->transfer_buffer) { |
1881 | use_sg = true; | 1879 | qh->use_sg = true; |
1882 | sg_miter_start(&qh->sg_miter, urb->sg, 1, | 1880 | sg_miter_start(&qh->sg_miter, urb->sg, 1, |
1883 | sg_flags); | 1881 | sg_flags); |
1884 | } | 1882 | } |
1885 | 1883 | ||
1886 | if (use_sg) { | 1884 | if (qh->use_sg) { |
1887 | if (!sg_miter_next(&qh->sg_miter)) { | 1885 | if (!sg_miter_next(&qh->sg_miter)) { |
1888 | dev_err(musb->controller, "error: sg list empty\n"); | 1886 | dev_err(musb->controller, "error: sg list empty\n"); |
1889 | sg_miter_stop(&qh->sg_miter); | 1887 | sg_miter_stop(&qh->sg_miter); |
@@ -1913,8 +1911,8 @@ finish: | |||
1913 | urb->actual_length += xfer_len; | 1911 | urb->actual_length += xfer_len; |
1914 | qh->offset += xfer_len; | 1912 | qh->offset += xfer_len; |
1915 | if (done) { | 1913 | if (done) { |
1916 | if (use_sg) | 1914 | if (qh->use_sg) |
1917 | use_sg = false; | 1915 | qh->use_sg = false; |
1918 | 1916 | ||
1919 | if (urb->status == -EINPROGRESS) | 1917 | if (urb->status == -EINPROGRESS) |
1920 | urb->status = status; | 1918 | urb->status = status; |
diff --git a/drivers/usb/musb/musb_host.h b/drivers/usb/musb/musb_host.h index 5a9c8feec10c..738f7eb60df9 100644 --- a/drivers/usb/musb/musb_host.h +++ b/drivers/usb/musb/musb_host.h | |||
@@ -74,6 +74,7 @@ struct musb_qh { | |||
74 | u16 frame; /* for periodic schedule */ | 74 | u16 frame; /* for periodic schedule */ |
75 | unsigned iso_idx; /* in urb->iso_frame_desc[] */ | 75 | unsigned iso_idx; /* in urb->iso_frame_desc[] */ |
76 | struct sg_mapping_iter sg_miter; /* for highmem in PIO mode */ | 76 | struct sg_mapping_iter sg_miter; /* for highmem in PIO mode */ |
77 | bool use_sg; /* to track urb using sglist */ | ||
77 | }; | 78 | }; |
78 | 79 | ||
79 | /* map from control or bulk queue head to the first qh on that ring */ | 80 | /* map from control or bulk queue head to the first qh on that ring */ |
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 3551f1a30c65..628b93fe5ccc 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c | |||
@@ -549,7 +549,8 @@ static int omap2430_probe(struct platform_device *pdev) | |||
549 | glue->control_otghs = omap_get_control_dev(); | 549 | glue->control_otghs = omap_get_control_dev(); |
550 | if (IS_ERR(glue->control_otghs)) { | 550 | if (IS_ERR(glue->control_otghs)) { |
551 | dev_vdbg(&pdev->dev, "Failed to get control device\n"); | 551 | dev_vdbg(&pdev->dev, "Failed to get control device\n"); |
552 | return -ENODEV; | 552 | ret = PTR_ERR(glue->control_otghs); |
553 | goto err2; | ||
553 | } | 554 | } |
554 | } else { | 555 | } else { |
555 | glue->control_otghs = ERR_PTR(-ENODEV); | 556 | glue->control_otghs = ERR_PTR(-ENODEV); |
diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig index 371d0e74e909..2311b1e4e43c 100644 --- a/drivers/usb/phy/Kconfig +++ b/drivers/usb/phy/Kconfig | |||
@@ -4,11 +4,17 @@ | |||
4 | menuconfig USB_PHY | 4 | menuconfig USB_PHY |
5 | bool "USB Physical Layer drivers" | 5 | bool "USB Physical Layer drivers" |
6 | help | 6 | help |
7 | USB controllers (those which are host, device or DRD) need a | 7 | Most USB controllers have the physical layer signalling part |
8 | device to handle the physical layer signalling, commonly called | 8 | (commonly called a PHY) built in. However, dual-role devices |
9 | a PHY. | 9 | (a.k.a. USB on-the-go) which support being USB master or slave |
10 | with the same connector often use an external PHY. | ||
10 | 11 | ||
11 | The following drivers add support for such PHY devices. | 12 | The drivers in this submenu add support for such PHY devices. |
13 | They are not needed for standard master-only (or the vast | ||
14 | majority of slave-only) USB interfaces. | ||
15 | |||
16 | If you're not sure if this applies to you, it probably doesn't; | ||
17 | say N here. | ||
12 | 18 | ||
13 | if USB_PHY | 19 | if USB_PHY |
14 | 20 | ||
@@ -25,7 +31,7 @@ config AB8500_USB | |||
25 | 31 | ||
26 | config FSL_USB2_OTG | 32 | config FSL_USB2_OTG |
27 | bool "Freescale USB OTG Transceiver Driver" | 33 | bool "Freescale USB OTG Transceiver Driver" |
28 | depends on USB_EHCI_FSL && USB_FSL_USB2 && USB_SUSPEND | 34 | depends on USB_EHCI_FSL && USB_FSL_USB2 && PM_RUNTIME |
29 | select USB_OTG | 35 | select USB_OTG |
30 | help | 36 | help |
31 | Enable this to support Freescale USB OTG transceiver. | 37 | Enable this to support Freescale USB OTG transceiver. |
@@ -139,7 +145,6 @@ config USB_ISP1301 | |||
139 | tristate "NXP ISP1301 USB transceiver support" | 145 | tristate "NXP ISP1301 USB transceiver support" |
140 | depends on USB || USB_GADGET | 146 | depends on USB || USB_GADGET |
141 | depends on I2C | 147 | depends on I2C |
142 | select USB_OTG_UTILS | ||
143 | help | 148 | help |
144 | Say Y here to add support for the NXP ISP1301 USB transceiver driver. | 149 | Say Y here to add support for the NXP ISP1301 USB transceiver driver. |
145 | This chip is typically used as USB transceiver for USB host, gadget | 150 | This chip is typically used as USB transceiver for USB host, gadget |
@@ -162,7 +167,7 @@ config USB_MSM_OTG | |||
162 | 167 | ||
163 | config USB_MV_OTG | 168 | config USB_MV_OTG |
164 | tristate "Marvell USB OTG support" | 169 | tristate "Marvell USB OTG support" |
165 | depends on USB_EHCI_MV && USB_MV_UDC && USB_SUSPEND | 170 | depends on USB_EHCI_MV && USB_MV_UDC && PM_RUNTIME |
166 | select USB_OTG | 171 | select USB_OTG |
167 | help | 172 | help |
168 | Say Y here if you want to build Marvell USB OTG transciever | 173 | Say Y here if you want to build Marvell USB OTG transciever |
diff --git a/drivers/usb/phy/phy-ab8500-usb.c b/drivers/usb/phy/phy-ab8500-usb.c index 4acef26a2ef5..e5eb1b5a04eb 100644 --- a/drivers/usb/phy/phy-ab8500-usb.c +++ b/drivers/usb/phy/phy-ab8500-usb.c | |||
@@ -892,8 +892,6 @@ static int ab8500_usb_remove(struct platform_device *pdev) | |||
892 | else if (ab->mode == USB_PERIPHERAL) | 892 | else if (ab->mode == USB_PERIPHERAL) |
893 | ab8500_usb_peri_phy_dis(ab); | 893 | ab8500_usb_peri_phy_dis(ab); |
894 | 894 | ||
895 | platform_set_drvdata(pdev, NULL); | ||
896 | |||
897 | return 0; | 895 | return 0; |
898 | } | 896 | } |
899 | 897 | ||
diff --git a/drivers/usb/phy/phy-fsl-usb.c b/drivers/usb/phy/phy-fsl-usb.c index 97b9308507c3..e771bafb9f1d 100644 --- a/drivers/usb/phy/phy-fsl-usb.c +++ b/drivers/usb/phy/phy-fsl-usb.c | |||
@@ -799,6 +799,7 @@ static int fsl_otg_conf(struct platform_device *pdev) | |||
799 | 799 | ||
800 | /* initialize the otg structure */ | 800 | /* initialize the otg structure */ |
801 | fsl_otg_tc->phy.label = DRIVER_DESC; | 801 | fsl_otg_tc->phy.label = DRIVER_DESC; |
802 | fsl_otg_tc->phy.dev = &pdev->dev; | ||
802 | fsl_otg_tc->phy.set_power = fsl_otg_set_power; | 803 | fsl_otg_tc->phy.set_power = fsl_otg_set_power; |
803 | 804 | ||
804 | fsl_otg_tc->phy.otg->phy = &fsl_otg_tc->phy; | 805 | fsl_otg_tc->phy.otg->phy = &fsl_otg_tc->phy; |
diff --git a/drivers/usb/phy/phy-gpio-vbus-usb.c b/drivers/usb/phy/phy-gpio-vbus-usb.c index 4c76074e518d..8443335c2ea0 100644 --- a/drivers/usb/phy/phy-gpio-vbus-usb.c +++ b/drivers/usb/phy/phy-gpio-vbus-usb.c | |||
@@ -266,6 +266,7 @@ static int __init gpio_vbus_probe(struct platform_device *pdev) | |||
266 | platform_set_drvdata(pdev, gpio_vbus); | 266 | platform_set_drvdata(pdev, gpio_vbus); |
267 | gpio_vbus->dev = &pdev->dev; | 267 | gpio_vbus->dev = &pdev->dev; |
268 | gpio_vbus->phy.label = "gpio-vbus"; | 268 | gpio_vbus->phy.label = "gpio-vbus"; |
269 | gpio_vbus->phy.dev = gpio_vbus->dev; | ||
269 | gpio_vbus->phy.set_power = gpio_vbus_set_power; | 270 | gpio_vbus->phy.set_power = gpio_vbus_set_power; |
270 | gpio_vbus->phy.set_suspend = gpio_vbus_set_suspend; | 271 | gpio_vbus->phy.set_suspend = gpio_vbus_set_suspend; |
271 | gpio_vbus->phy.state = OTG_STATE_UNDEFINED; | 272 | gpio_vbus->phy.state = OTG_STATE_UNDEFINED; |
@@ -343,7 +344,6 @@ err_irq: | |||
343 | gpio_free(pdata->gpio_pullup); | 344 | gpio_free(pdata->gpio_pullup); |
344 | gpio_free(pdata->gpio_vbus); | 345 | gpio_free(pdata->gpio_vbus); |
345 | err_gpio: | 346 | err_gpio: |
346 | platform_set_drvdata(pdev, NULL); | ||
347 | kfree(gpio_vbus->phy.otg); | 347 | kfree(gpio_vbus->phy.otg); |
348 | kfree(gpio_vbus); | 348 | kfree(gpio_vbus); |
349 | return err; | 349 | return err; |
@@ -365,7 +365,6 @@ static int __exit gpio_vbus_remove(struct platform_device *pdev) | |||
365 | if (gpio_is_valid(pdata->gpio_pullup)) | 365 | if (gpio_is_valid(pdata->gpio_pullup)) |
366 | gpio_free(pdata->gpio_pullup); | 366 | gpio_free(pdata->gpio_pullup); |
367 | gpio_free(gpio); | 367 | gpio_free(gpio); |
368 | platform_set_drvdata(pdev, NULL); | ||
369 | kfree(gpio_vbus->phy.otg); | 368 | kfree(gpio_vbus->phy.otg); |
370 | kfree(gpio_vbus); | 369 | kfree(gpio_vbus); |
371 | 370 | ||
diff --git a/drivers/usb/phy/phy-isp1301.c b/drivers/usb/phy/phy-isp1301.c index 225ae6c97eeb..8a55b37d1a02 100644 --- a/drivers/usb/phy/phy-isp1301.c +++ b/drivers/usb/phy/phy-isp1301.c | |||
@@ -102,6 +102,7 @@ static int isp1301_probe(struct i2c_client *client, | |||
102 | mutex_init(&isp->mutex); | 102 | mutex_init(&isp->mutex); |
103 | 103 | ||
104 | phy = &isp->phy; | 104 | phy = &isp->phy; |
105 | phy->dev = &client->dev; | ||
105 | phy->label = DRV_NAME; | 106 | phy->label = DRV_NAME; |
106 | phy->init = isp1301_phy_init; | 107 | phy->init = isp1301_phy_init; |
107 | phy->set_vbus = isp1301_phy_set_vbus; | 108 | phy->set_vbus = isp1301_phy_set_vbus; |
diff --git a/drivers/usb/phy/phy-mv-u3d-usb.c b/drivers/usb/phy/phy-mv-u3d-usb.c index f7838a43347c..1568ea63e338 100644 --- a/drivers/usb/phy/phy-mv-u3d-usb.c +++ b/drivers/usb/phy/phy-mv-u3d-usb.c | |||
@@ -278,11 +278,6 @@ static int mv_u3d_phy_probe(struct platform_device *pdev) | |||
278 | } | 278 | } |
279 | 279 | ||
280 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 280 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
281 | if (!res) { | ||
282 | dev_err(dev, "missing mem resource\n"); | ||
283 | return -ENODEV; | ||
284 | } | ||
285 | |||
286 | phy_base = devm_ioremap_resource(dev, res); | 281 | phy_base = devm_ioremap_resource(dev, res); |
287 | if (IS_ERR(phy_base)) | 282 | if (IS_ERR(phy_base)) |
288 | return PTR_ERR(phy_base); | 283 | return PTR_ERR(phy_base); |
diff --git a/drivers/usb/phy/phy-mv-usb.c b/drivers/usb/phy/phy-mv-usb.c index c987bbe27851..4a6b03c73876 100644 --- a/drivers/usb/phy/phy-mv-usb.c +++ b/drivers/usb/phy/phy-mv-usb.c | |||
@@ -667,7 +667,6 @@ int mv_otg_remove(struct platform_device *pdev) | |||
667 | mv_otg_disable(mvotg); | 667 | mv_otg_disable(mvotg); |
668 | 668 | ||
669 | usb_remove_phy(&mvotg->phy); | 669 | usb_remove_phy(&mvotg->phy); |
670 | platform_set_drvdata(pdev, NULL); | ||
671 | 670 | ||
672 | return 0; | 671 | return 0; |
673 | } | 672 | } |
@@ -850,8 +849,6 @@ err_destroy_workqueue: | |||
850 | flush_workqueue(mvotg->qwork); | 849 | flush_workqueue(mvotg->qwork); |
851 | destroy_workqueue(mvotg->qwork); | 850 | destroy_workqueue(mvotg->qwork); |
852 | 851 | ||
853 | platform_set_drvdata(pdev, NULL); | ||
854 | |||
855 | return retval; | 852 | return retval; |
856 | } | 853 | } |
857 | 854 | ||
diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c index 9d4381e64d51..bd601c537c8d 100644 --- a/drivers/usb/phy/phy-mxs-usb.c +++ b/drivers/usb/phy/phy-mxs-usb.c | |||
@@ -130,11 +130,6 @@ static int mxs_phy_probe(struct platform_device *pdev) | |||
130 | int ret; | 130 | int ret; |
131 | 131 | ||
132 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 132 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
133 | if (!res) { | ||
134 | dev_err(&pdev->dev, "can't get device resources\n"); | ||
135 | return -ENOENT; | ||
136 | } | ||
137 | |||
138 | base = devm_ioremap_resource(&pdev->dev, res); | 133 | base = devm_ioremap_resource(&pdev->dev, res); |
139 | if (IS_ERR(base)) | 134 | if (IS_ERR(base)) |
140 | return PTR_ERR(base); | 135 | return PTR_ERR(base); |
@@ -160,6 +155,7 @@ static int mxs_phy_probe(struct platform_device *pdev) | |||
160 | mxs_phy->phy.set_suspend = mxs_phy_suspend; | 155 | mxs_phy->phy.set_suspend = mxs_phy_suspend; |
161 | mxs_phy->phy.notify_connect = mxs_phy_on_connect; | 156 | mxs_phy->phy.notify_connect = mxs_phy_on_connect; |
162 | mxs_phy->phy.notify_disconnect = mxs_phy_on_disconnect; | 157 | mxs_phy->phy.notify_disconnect = mxs_phy_on_disconnect; |
158 | mxs_phy->phy.type = USB_PHY_TYPE_USB2; | ||
163 | 159 | ||
164 | ATOMIC_INIT_NOTIFIER_HEAD(&mxs_phy->phy.notifier); | 160 | ATOMIC_INIT_NOTIFIER_HEAD(&mxs_phy->phy.notifier); |
165 | 161 | ||
@@ -180,8 +176,6 @@ static int mxs_phy_remove(struct platform_device *pdev) | |||
180 | 176 | ||
181 | usb_remove_phy(&mxs_phy->phy); | 177 | usb_remove_phy(&mxs_phy->phy); |
182 | 178 | ||
183 | platform_set_drvdata(pdev, NULL); | ||
184 | |||
185 | return 0; | 179 | return 0; |
186 | } | 180 | } |
187 | 181 | ||
diff --git a/drivers/usb/phy/phy-nop.c b/drivers/usb/phy/phy-nop.c index 2b10cc969bbb..638cc5dade35 100644 --- a/drivers/usb/phy/phy-nop.c +++ b/drivers/usb/phy/phy-nop.c | |||
@@ -254,8 +254,6 @@ static int nop_usb_xceiv_remove(struct platform_device *pdev) | |||
254 | 254 | ||
255 | usb_remove_phy(&nop->phy); | 255 | usb_remove_phy(&nop->phy); |
256 | 256 | ||
257 | platform_set_drvdata(pdev, NULL); | ||
258 | |||
259 | return 0; | 257 | return 0; |
260 | } | 258 | } |
261 | 259 | ||
diff --git a/drivers/usb/phy/phy-samsung-usb2.c b/drivers/usb/phy/phy-samsung-usb2.c index 45ffe036dacc..9d5e273abcc7 100644 --- a/drivers/usb/phy/phy-samsung-usb2.c +++ b/drivers/usb/phy/phy-samsung-usb2.c | |||
@@ -363,11 +363,6 @@ static int samsung_usb2phy_probe(struct platform_device *pdev) | |||
363 | int ret; | 363 | int ret; |
364 | 364 | ||
365 | phy_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 365 | phy_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
366 | if (!phy_mem) { | ||
367 | dev_err(dev, "%s: missing mem resource\n", __func__); | ||
368 | return -ENODEV; | ||
369 | } | ||
370 | |||
371 | phy_base = devm_ioremap_resource(dev, phy_mem); | 366 | phy_base = devm_ioremap_resource(dev, phy_mem); |
372 | if (IS_ERR(phy_base)) | 367 | if (IS_ERR(phy_base)) |
373 | return PTR_ERR(phy_base); | 368 | return PTR_ERR(phy_base); |
diff --git a/drivers/usb/phy/phy-samsung-usb3.c b/drivers/usb/phy/phy-samsung-usb3.c index 133f3d0c554f..5a9efcbcb532 100644 --- a/drivers/usb/phy/phy-samsung-usb3.c +++ b/drivers/usb/phy/phy-samsung-usb3.c | |||
@@ -239,11 +239,6 @@ static int samsung_usb3phy_probe(struct platform_device *pdev) | |||
239 | int ret; | 239 | int ret; |
240 | 240 | ||
241 | phy_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 241 | phy_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
242 | if (!phy_mem) { | ||
243 | dev_err(dev, "%s: missing mem resource\n", __func__); | ||
244 | return -ENODEV; | ||
245 | } | ||
246 | |||
247 | phy_base = devm_ioremap_resource(dev, phy_mem); | 242 | phy_base = devm_ioremap_resource(dev, phy_mem); |
248 | if (IS_ERR(phy_base)) | 243 | if (IS_ERR(phy_base)) |
249 | return PTR_ERR(phy_base); | 244 | return PTR_ERR(phy_base); |
diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c index 3b16118cbf62..40e7fd94646f 100644 --- a/drivers/usb/serial/ark3116.c +++ b/drivers/usb/serial/ark3116.c | |||
@@ -43,7 +43,7 @@ | |||
43 | #define DRIVER_NAME "ark3116" | 43 | #define DRIVER_NAME "ark3116" |
44 | 44 | ||
45 | /* usb timeout of 1 second */ | 45 | /* usb timeout of 1 second */ |
46 | #define ARK_TIMEOUT (1*HZ) | 46 | #define ARK_TIMEOUT 1000 |
47 | 47 | ||
48 | static const struct usb_device_id id_table[] = { | 48 | static const struct usb_device_id id_table[] = { |
49 | { USB_DEVICE(0x6547, 0x0232) }, | 49 | { USB_DEVICE(0x6547, 0x0232) }, |
diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c index d341555d37d8..082120198f87 100644 --- a/drivers/usb/serial/cypress_m8.c +++ b/drivers/usb/serial/cypress_m8.c | |||
@@ -65,6 +65,7 @@ static const struct usb_device_id id_table_earthmate[] = { | |||
65 | static const struct usb_device_id id_table_cyphidcomrs232[] = { | 65 | static const struct usb_device_id id_table_cyphidcomrs232[] = { |
66 | { USB_DEVICE(VENDOR_ID_CYPRESS, PRODUCT_ID_CYPHIDCOM) }, | 66 | { USB_DEVICE(VENDOR_ID_CYPRESS, PRODUCT_ID_CYPHIDCOM) }, |
67 | { USB_DEVICE(VENDOR_ID_POWERCOM, PRODUCT_ID_UPS) }, | 67 | { USB_DEVICE(VENDOR_ID_POWERCOM, PRODUCT_ID_UPS) }, |
68 | { USB_DEVICE(VENDOR_ID_FRWD, PRODUCT_ID_CYPHIDCOM_FRWD) }, | ||
68 | { } /* Terminating entry */ | 69 | { } /* Terminating entry */ |
69 | }; | 70 | }; |
70 | 71 | ||
@@ -78,6 +79,7 @@ static const struct usb_device_id id_table_combined[] = { | |||
78 | { USB_DEVICE(VENDOR_ID_DELORME, PRODUCT_ID_EARTHMATEUSB_LT20) }, | 79 | { USB_DEVICE(VENDOR_ID_DELORME, PRODUCT_ID_EARTHMATEUSB_LT20) }, |
79 | { USB_DEVICE(VENDOR_ID_CYPRESS, PRODUCT_ID_CYPHIDCOM) }, | 80 | { USB_DEVICE(VENDOR_ID_CYPRESS, PRODUCT_ID_CYPHIDCOM) }, |
80 | { USB_DEVICE(VENDOR_ID_POWERCOM, PRODUCT_ID_UPS) }, | 81 | { USB_DEVICE(VENDOR_ID_POWERCOM, PRODUCT_ID_UPS) }, |
82 | { USB_DEVICE(VENDOR_ID_FRWD, PRODUCT_ID_CYPHIDCOM_FRWD) }, | ||
81 | { USB_DEVICE(VENDOR_ID_DAZZLE, PRODUCT_ID_CA42) }, | 83 | { USB_DEVICE(VENDOR_ID_DAZZLE, PRODUCT_ID_CA42) }, |
82 | { } /* Terminating entry */ | 84 | { } /* Terminating entry */ |
83 | }; | 85 | }; |
@@ -229,6 +231,12 @@ static struct usb_serial_driver * const serial_drivers[] = { | |||
229 | * Cypress serial helper functions | 231 | * Cypress serial helper functions |
230 | *****************************************************************************/ | 232 | *****************************************************************************/ |
231 | 233 | ||
234 | /* FRWD Dongle hidcom needs to skip reset and speed checks */ | ||
235 | static inline bool is_frwd(struct usb_device *dev) | ||
236 | { | ||
237 | return ((le16_to_cpu(dev->descriptor.idVendor) == VENDOR_ID_FRWD) && | ||
238 | (le16_to_cpu(dev->descriptor.idProduct) == PRODUCT_ID_CYPHIDCOM_FRWD)); | ||
239 | } | ||
232 | 240 | ||
233 | static int analyze_baud_rate(struct usb_serial_port *port, speed_t new_rate) | 241 | static int analyze_baud_rate(struct usb_serial_port *port, speed_t new_rate) |
234 | { | 242 | { |
@@ -238,6 +246,10 @@ static int analyze_baud_rate(struct usb_serial_port *port, speed_t new_rate) | |||
238 | if (unstable_bauds) | 246 | if (unstable_bauds) |
239 | return new_rate; | 247 | return new_rate; |
240 | 248 | ||
249 | /* FRWD Dongle uses 115200 bps */ | ||
250 | if (is_frwd(port->serial->dev)) | ||
251 | return new_rate; | ||
252 | |||
241 | /* | 253 | /* |
242 | * The general purpose firmware for the Cypress M8 allows for | 254 | * The general purpose firmware for the Cypress M8 allows for |
243 | * a maximum speed of 57600bps (I have no idea whether DeLorme | 255 | * a maximum speed of 57600bps (I have no idea whether DeLorme |
@@ -448,7 +460,11 @@ static int cypress_generic_port_probe(struct usb_serial_port *port) | |||
448 | return -ENOMEM; | 460 | return -ENOMEM; |
449 | } | 461 | } |
450 | 462 | ||
451 | usb_reset_configuration(serial->dev); | 463 | /* Skip reset for FRWD device. It is a workaound: |
464 | device hangs if it receives SET_CONFIGURE in Configured | ||
465 | state. */ | ||
466 | if (!is_frwd(serial->dev)) | ||
467 | usb_reset_configuration(serial->dev); | ||
452 | 468 | ||
453 | priv->cmd_ctrl = 0; | 469 | priv->cmd_ctrl = 0; |
454 | priv->line_control = 0; | 470 | priv->line_control = 0; |
diff --git a/drivers/usb/serial/cypress_m8.h b/drivers/usb/serial/cypress_m8.h index 67cf60826884..b461311a2ae7 100644 --- a/drivers/usb/serial/cypress_m8.h +++ b/drivers/usb/serial/cypress_m8.h | |||
@@ -24,6 +24,10 @@ | |||
24 | #define VENDOR_ID_CYPRESS 0x04b4 | 24 | #define VENDOR_ID_CYPRESS 0x04b4 |
25 | #define PRODUCT_ID_CYPHIDCOM 0x5500 | 25 | #define PRODUCT_ID_CYPHIDCOM 0x5500 |
26 | 26 | ||
27 | /* FRWD Dongle - a GPS sports watch */ | ||
28 | #define VENDOR_ID_FRWD 0x6737 | ||
29 | #define PRODUCT_ID_CYPHIDCOM_FRWD 0x0001 | ||
30 | |||
27 | /* Powercom UPS, chip CY7C63723 */ | 31 | /* Powercom UPS, chip CY7C63723 */ |
28 | #define VENDOR_ID_POWERCOM 0x0d9f | 32 | #define VENDOR_ID_POWERCOM 0x0d9f |
29 | #define PRODUCT_ID_UPS 0x0002 | 33 | #define PRODUCT_ID_UPS 0x0002 |
diff --git a/drivers/usb/serial/f81232.c b/drivers/usb/serial/f81232.c index 090b411d893f..7d8dd5aad236 100644 --- a/drivers/usb/serial/f81232.c +++ b/drivers/usb/serial/f81232.c | |||
@@ -165,11 +165,12 @@ static void f81232_set_termios(struct tty_struct *tty, | |||
165 | /* FIXME - Stubbed out for now */ | 165 | /* FIXME - Stubbed out for now */ |
166 | 166 | ||
167 | /* Don't change anything if nothing has changed */ | 167 | /* Don't change anything if nothing has changed */ |
168 | if (!tty_termios_hw_change(&tty->termios, old_termios)) | 168 | if (old_termios && !tty_termios_hw_change(&tty->termios, old_termios)) |
169 | return; | 169 | return; |
170 | 170 | ||
171 | /* Do the real work here... */ | 171 | /* Do the real work here... */ |
172 | tty_termios_copy_hw(&tty->termios, old_termios); | 172 | if (old_termios) |
173 | tty_termios_copy_hw(&tty->termios, old_termios); | ||
173 | } | 174 | } |
174 | 175 | ||
175 | static int f81232_tiocmget(struct tty_struct *tty) | 176 | static int f81232_tiocmget(struct tty_struct *tty) |
@@ -187,12 +188,11 @@ static int f81232_tiocmset(struct tty_struct *tty, | |||
187 | 188 | ||
188 | static int f81232_open(struct tty_struct *tty, struct usb_serial_port *port) | 189 | static int f81232_open(struct tty_struct *tty, struct usb_serial_port *port) |
189 | { | 190 | { |
190 | struct ktermios tmp_termios; | ||
191 | int result; | 191 | int result; |
192 | 192 | ||
193 | /* Setup termios */ | 193 | /* Setup termios */ |
194 | if (tty) | 194 | if (tty) |
195 | f81232_set_termios(tty, port, &tmp_termios); | 195 | f81232_set_termios(tty, port, NULL); |
196 | 196 | ||
197 | result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); | 197 | result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); |
198 | if (result) { | 198 | if (result) { |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 242b5776648a..7260ec660347 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -189,6 +189,8 @@ static struct usb_device_id id_table_combined [] = { | |||
189 | { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GBM_PID) }, | 189 | { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GBM_PID) }, |
190 | { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GBM_BOOST_PID) }, | 190 | { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GBM_BOOST_PID) }, |
191 | { USB_DEVICE(NEWPORT_VID, NEWPORT_AGILIS_PID) }, | 191 | { USB_DEVICE(NEWPORT_VID, NEWPORT_AGILIS_PID) }, |
192 | { USB_DEVICE(NEWPORT_VID, NEWPORT_CONEX_CC_PID) }, | ||
193 | { USB_DEVICE(NEWPORT_VID, NEWPORT_CONEX_AGP_PID) }, | ||
192 | { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) }, | 194 | { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) }, |
193 | { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) }, | 195 | { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) }, |
194 | { USB_DEVICE(FTDI_VID, FTDI_SPROG_II) }, | 196 | { USB_DEVICE(FTDI_VID, FTDI_SPROG_II) }, |
@@ -924,8 +926,8 @@ static int ftdi_tiocmset(struct tty_struct *tty, | |||
924 | static int ftdi_ioctl(struct tty_struct *tty, | 926 | static int ftdi_ioctl(struct tty_struct *tty, |
925 | unsigned int cmd, unsigned long arg); | 927 | unsigned int cmd, unsigned long arg); |
926 | static void ftdi_break_ctl(struct tty_struct *tty, int break_state); | 928 | static void ftdi_break_ctl(struct tty_struct *tty, int break_state); |
927 | static int ftdi_chars_in_buffer(struct tty_struct *tty); | 929 | static bool ftdi_tx_empty(struct usb_serial_port *port); |
928 | static int ftdi_get_modem_status(struct tty_struct *tty, | 930 | static int ftdi_get_modem_status(struct usb_serial_port *port, |
929 | unsigned char status[2]); | 931 | unsigned char status[2]); |
930 | 932 | ||
931 | static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base); | 933 | static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base); |
@@ -961,7 +963,7 @@ static struct usb_serial_driver ftdi_sio_device = { | |||
961 | .ioctl = ftdi_ioctl, | 963 | .ioctl = ftdi_ioctl, |
962 | .set_termios = ftdi_set_termios, | 964 | .set_termios = ftdi_set_termios, |
963 | .break_ctl = ftdi_break_ctl, | 965 | .break_ctl = ftdi_break_ctl, |
964 | .chars_in_buffer = ftdi_chars_in_buffer, | 966 | .tx_empty = ftdi_tx_empty, |
965 | }; | 967 | }; |
966 | 968 | ||
967 | static struct usb_serial_driver * const serial_drivers[] = { | 969 | static struct usb_serial_driver * const serial_drivers[] = { |
@@ -2056,27 +2058,18 @@ static void ftdi_break_ctl(struct tty_struct *tty, int break_state) | |||
2056 | 2058 | ||
2057 | } | 2059 | } |
2058 | 2060 | ||
2059 | static int ftdi_chars_in_buffer(struct tty_struct *tty) | 2061 | static bool ftdi_tx_empty(struct usb_serial_port *port) |
2060 | { | 2062 | { |
2061 | struct usb_serial_port *port = tty->driver_data; | ||
2062 | int chars; | ||
2063 | unsigned char buf[2]; | 2063 | unsigned char buf[2]; |
2064 | int ret; | 2064 | int ret; |
2065 | 2065 | ||
2066 | chars = usb_serial_generic_chars_in_buffer(tty); | 2066 | ret = ftdi_get_modem_status(port, buf); |
2067 | if (chars) | ||
2068 | goto out; | ||
2069 | |||
2070 | /* Check if hardware buffer is empty. */ | ||
2071 | ret = ftdi_get_modem_status(tty, buf); | ||
2072 | if (ret == 2) { | 2067 | if (ret == 2) { |
2073 | if (!(buf[1] & FTDI_RS_TEMT)) | 2068 | if (!(buf[1] & FTDI_RS_TEMT)) |
2074 | chars = 1; | 2069 | return false; |
2075 | } | 2070 | } |
2076 | out: | ||
2077 | dev_dbg(&port->dev, "%s - %d\n", __func__, chars); | ||
2078 | 2071 | ||
2079 | return chars; | 2072 | return true; |
2080 | } | 2073 | } |
2081 | 2074 | ||
2082 | /* old_termios contains the original termios settings and tty->termios contains | 2075 | /* old_termios contains the original termios settings and tty->termios contains |
@@ -2268,10 +2261,9 @@ no_c_cflag_changes: | |||
2268 | * Returns the number of status bytes retrieved (device dependant), or | 2261 | * Returns the number of status bytes retrieved (device dependant), or |
2269 | * negative error code. | 2262 | * negative error code. |
2270 | */ | 2263 | */ |
2271 | static int ftdi_get_modem_status(struct tty_struct *tty, | 2264 | static int ftdi_get_modem_status(struct usb_serial_port *port, |
2272 | unsigned char status[2]) | 2265 | unsigned char status[2]) |
2273 | { | 2266 | { |
2274 | struct usb_serial_port *port = tty->driver_data; | ||
2275 | struct ftdi_private *priv = usb_get_serial_port_data(port); | 2267 | struct ftdi_private *priv = usb_get_serial_port_data(port); |
2276 | unsigned char *buf; | 2268 | unsigned char *buf; |
2277 | int len; | 2269 | int len; |
@@ -2336,7 +2328,7 @@ static int ftdi_tiocmget(struct tty_struct *tty) | |||
2336 | unsigned char buf[2]; | 2328 | unsigned char buf[2]; |
2337 | int ret; | 2329 | int ret; |
2338 | 2330 | ||
2339 | ret = ftdi_get_modem_status(tty, buf); | 2331 | ret = ftdi_get_modem_status(port, buf); |
2340 | if (ret < 0) | 2332 | if (ret < 0) |
2341 | return ret; | 2333 | return ret; |
2342 | 2334 | ||
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h index 98528270c43c..6dd79253205d 100644 --- a/drivers/usb/serial/ftdi_sio_ids.h +++ b/drivers/usb/serial/ftdi_sio_ids.h | |||
@@ -772,6 +772,8 @@ | |||
772 | */ | 772 | */ |
773 | #define NEWPORT_VID 0x104D | 773 | #define NEWPORT_VID 0x104D |
774 | #define NEWPORT_AGILIS_PID 0x3000 | 774 | #define NEWPORT_AGILIS_PID 0x3000 |
775 | #define NEWPORT_CONEX_CC_PID 0x3002 | ||
776 | #define NEWPORT_CONEX_AGP_PID 0x3006 | ||
775 | 777 | ||
776 | /* Interbiometrics USB I/O Board */ | 778 | /* Interbiometrics USB I/O Board */ |
777 | /* Developed for Interbiometrics by Rudolf Gugler */ | 779 | /* Developed for Interbiometrics by Rudolf Gugler */ |
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c index 297665fdd16d..ba45170c78e5 100644 --- a/drivers/usb/serial/generic.c +++ b/drivers/usb/serial/generic.c | |||
@@ -253,6 +253,37 @@ int usb_serial_generic_chars_in_buffer(struct tty_struct *tty) | |||
253 | } | 253 | } |
254 | EXPORT_SYMBOL_GPL(usb_serial_generic_chars_in_buffer); | 254 | EXPORT_SYMBOL_GPL(usb_serial_generic_chars_in_buffer); |
255 | 255 | ||
256 | void usb_serial_generic_wait_until_sent(struct tty_struct *tty, long timeout) | ||
257 | { | ||
258 | struct usb_serial_port *port = tty->driver_data; | ||
259 | unsigned int bps; | ||
260 | unsigned long period; | ||
261 | unsigned long expire; | ||
262 | |||
263 | bps = tty_get_baud_rate(tty); | ||
264 | if (!bps) | ||
265 | bps = 9600; /* B0 */ | ||
266 | /* | ||
267 | * Use a poll-period of roughly the time it takes to send one | ||
268 | * character or at least one jiffy. | ||
269 | */ | ||
270 | period = max_t(unsigned long, (10 * HZ / bps), 1); | ||
271 | period = min_t(unsigned long, period, timeout); | ||
272 | |||
273 | dev_dbg(&port->dev, "%s - timeout = %u ms, period = %u ms\n", | ||
274 | __func__, jiffies_to_msecs(timeout), | ||
275 | jiffies_to_msecs(period)); | ||
276 | expire = jiffies + timeout; | ||
277 | while (!port->serial->type->tx_empty(port)) { | ||
278 | schedule_timeout_interruptible(period); | ||
279 | if (signal_pending(current)) | ||
280 | break; | ||
281 | if (time_after(jiffies, expire)) | ||
282 | break; | ||
283 | } | ||
284 | } | ||
285 | EXPORT_SYMBOL_GPL(usb_serial_generic_wait_until_sent); | ||
286 | |||
256 | static int usb_serial_generic_submit_read_urb(struct usb_serial_port *port, | 287 | static int usb_serial_generic_submit_read_urb(struct usb_serial_port *port, |
257 | int index, gfp_t mem_flags) | 288 | int index, gfp_t mem_flags) |
258 | { | 289 | { |
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c index 158bf4bc29cc..1be6ba7bee27 100644 --- a/drivers/usb/serial/io_ti.c +++ b/drivers/usb/serial/io_ti.c | |||
@@ -2019,8 +2019,6 @@ static int edge_chars_in_buffer(struct tty_struct *tty) | |||
2019 | struct edgeport_port *edge_port = usb_get_serial_port_data(port); | 2019 | struct edgeport_port *edge_port = usb_get_serial_port_data(port); |
2020 | int chars = 0; | 2020 | int chars = 0; |
2021 | unsigned long flags; | 2021 | unsigned long flags; |
2022 | int ret; | ||
2023 | |||
2024 | if (edge_port == NULL) | 2022 | if (edge_port == NULL) |
2025 | return 0; | 2023 | return 0; |
2026 | 2024 | ||
@@ -2028,16 +2026,22 @@ static int edge_chars_in_buffer(struct tty_struct *tty) | |||
2028 | chars = kfifo_len(&edge_port->write_fifo); | 2026 | chars = kfifo_len(&edge_port->write_fifo); |
2029 | spin_unlock_irqrestore(&edge_port->ep_lock, flags); | 2027 | spin_unlock_irqrestore(&edge_port->ep_lock, flags); |
2030 | 2028 | ||
2031 | if (!chars) { | ||
2032 | ret = tx_active(edge_port); | ||
2033 | if (ret > 0) | ||
2034 | chars = ret; | ||
2035 | } | ||
2036 | |||
2037 | dev_dbg(&port->dev, "%s - returns %d\n", __func__, chars); | 2029 | dev_dbg(&port->dev, "%s - returns %d\n", __func__, chars); |
2038 | return chars; | 2030 | return chars; |
2039 | } | 2031 | } |
2040 | 2032 | ||
2033 | static bool edge_tx_empty(struct usb_serial_port *port) | ||
2034 | { | ||
2035 | struct edgeport_port *edge_port = usb_get_serial_port_data(port); | ||
2036 | int ret; | ||
2037 | |||
2038 | ret = tx_active(edge_port); | ||
2039 | if (ret > 0) | ||
2040 | return false; | ||
2041 | |||
2042 | return true; | ||
2043 | } | ||
2044 | |||
2041 | static void edge_throttle(struct tty_struct *tty) | 2045 | static void edge_throttle(struct tty_struct *tty) |
2042 | { | 2046 | { |
2043 | struct usb_serial_port *port = tty->driver_data; | 2047 | struct usb_serial_port *port = tty->driver_data; |
@@ -2557,6 +2561,7 @@ static struct usb_serial_driver edgeport_1port_device = { | |||
2557 | .write = edge_write, | 2561 | .write = edge_write, |
2558 | .write_room = edge_write_room, | 2562 | .write_room = edge_write_room, |
2559 | .chars_in_buffer = edge_chars_in_buffer, | 2563 | .chars_in_buffer = edge_chars_in_buffer, |
2564 | .tx_empty = edge_tx_empty, | ||
2560 | .break_ctl = edge_break, | 2565 | .break_ctl = edge_break, |
2561 | .read_int_callback = edge_interrupt_callback, | 2566 | .read_int_callback = edge_interrupt_callback, |
2562 | .read_bulk_callback = edge_bulk_in_callback, | 2567 | .read_bulk_callback = edge_bulk_in_callback, |
@@ -2589,6 +2594,7 @@ static struct usb_serial_driver edgeport_2port_device = { | |||
2589 | .write = edge_write, | 2594 | .write = edge_write, |
2590 | .write_room = edge_write_room, | 2595 | .write_room = edge_write_room, |
2591 | .chars_in_buffer = edge_chars_in_buffer, | 2596 | .chars_in_buffer = edge_chars_in_buffer, |
2597 | .tx_empty = edge_tx_empty, | ||
2592 | .break_ctl = edge_break, | 2598 | .break_ctl = edge_break, |
2593 | .read_int_callback = edge_interrupt_callback, | 2599 | .read_int_callback = edge_interrupt_callback, |
2594 | .read_bulk_callback = edge_bulk_in_callback, | 2600 | .read_bulk_callback = edge_bulk_in_callback, |
diff --git a/drivers/usb/serial/iuu_phoenix.c b/drivers/usb/serial/iuu_phoenix.c index 9d74c278b7b5..790673e5faa7 100644 --- a/drivers/usb/serial/iuu_phoenix.c +++ b/drivers/usb/serial/iuu_phoenix.c | |||
@@ -287,7 +287,7 @@ static int bulk_immediate(struct usb_serial_port *port, u8 *buf, u8 count) | |||
287 | usb_bulk_msg(serial->dev, | 287 | usb_bulk_msg(serial->dev, |
288 | usb_sndbulkpipe(serial->dev, | 288 | usb_sndbulkpipe(serial->dev, |
289 | port->bulk_out_endpointAddress), buf, | 289 | port->bulk_out_endpointAddress), buf, |
290 | count, &actual, HZ * 1); | 290 | count, &actual, 1000); |
291 | 291 | ||
292 | if (status != IUU_OPERATION_OK) | 292 | if (status != IUU_OPERATION_OK) |
293 | dev_dbg(&port->dev, "%s - error = %2x\n", __func__, status); | 293 | dev_dbg(&port->dev, "%s - error = %2x\n", __func__, status); |
@@ -307,7 +307,7 @@ static int read_immediate(struct usb_serial_port *port, u8 *buf, u8 count) | |||
307 | usb_bulk_msg(serial->dev, | 307 | usb_bulk_msg(serial->dev, |
308 | usb_rcvbulkpipe(serial->dev, | 308 | usb_rcvbulkpipe(serial->dev, |
309 | port->bulk_in_endpointAddress), buf, | 309 | port->bulk_in_endpointAddress), buf, |
310 | count, &actual, HZ * 1); | 310 | count, &actual, 1000); |
311 | 311 | ||
312 | if (status != IUU_OPERATION_OK) | 312 | if (status != IUU_OPERATION_OK) |
313 | dev_dbg(&port->dev, "%s - error = %2x\n", __func__, status); | 313 | dev_dbg(&port->dev, "%s - error = %2x\n", __func__, status); |
diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c index eb30d7b01f36..3549d073df22 100644 --- a/drivers/usb/serial/keyspan.c +++ b/drivers/usb/serial/keyspan.c | |||
@@ -1548,7 +1548,6 @@ static int keyspan_usa26_send_setup(struct usb_serial *serial, | |||
1548 | struct keyspan_serial_private *s_priv; | 1548 | struct keyspan_serial_private *s_priv; |
1549 | struct keyspan_port_private *p_priv; | 1549 | struct keyspan_port_private *p_priv; |
1550 | const struct keyspan_device_details *d_details; | 1550 | const struct keyspan_device_details *d_details; |
1551 | int outcont_urb; | ||
1552 | struct urb *this_urb; | 1551 | struct urb *this_urb; |
1553 | int device_port, err; | 1552 | int device_port, err; |
1554 | 1553 | ||
@@ -1559,7 +1558,6 @@ static int keyspan_usa26_send_setup(struct usb_serial *serial, | |||
1559 | d_details = s_priv->device_details; | 1558 | d_details = s_priv->device_details; |
1560 | device_port = port->number - port->serial->minor; | 1559 | device_port = port->number - port->serial->minor; |
1561 | 1560 | ||
1562 | outcont_urb = d_details->outcont_endpoints[port->number]; | ||
1563 | this_urb = p_priv->outcont_urb; | 1561 | this_urb = p_priv->outcont_urb; |
1564 | 1562 | ||
1565 | dev_dbg(&port->dev, "%s - endpoint %d\n", __func__, usb_pipeendpoint(this_urb->pipe)); | 1563 | dev_dbg(&port->dev, "%s - endpoint %d\n", __func__, usb_pipeendpoint(this_urb->pipe)); |
@@ -1685,14 +1683,6 @@ static int keyspan_usa26_send_setup(struct usb_serial *serial, | |||
1685 | err = usb_submit_urb(this_urb, GFP_ATOMIC); | 1683 | err = usb_submit_urb(this_urb, GFP_ATOMIC); |
1686 | if (err != 0) | 1684 | if (err != 0) |
1687 | dev_dbg(&port->dev, "%s - usb_submit_urb(setup) failed (%d)\n", __func__, err); | 1685 | dev_dbg(&port->dev, "%s - usb_submit_urb(setup) failed (%d)\n", __func__, err); |
1688 | #if 0 | ||
1689 | else { | ||
1690 | dev_dbg(&port->dev, "%s - usb_submit_urb(%d) OK %d bytes (end %d)\n", __func__ | ||
1691 | outcont_urb, this_urb->transfer_buffer_length, | ||
1692 | usb_pipeendpoint(this_urb->pipe)); | ||
1693 | } | ||
1694 | #endif | ||
1695 | |||
1696 | return 0; | 1686 | return 0; |
1697 | } | 1687 | } |
1698 | 1688 | ||
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c index cc0e54345df9..f27c621a9297 100644 --- a/drivers/usb/serial/mos7720.c +++ b/drivers/usb/serial/mos7720.c | |||
@@ -40,7 +40,7 @@ | |||
40 | #define DRIVER_DESC "Moschip USB Serial Driver" | 40 | #define DRIVER_DESC "Moschip USB Serial Driver" |
41 | 41 | ||
42 | /* default urb timeout */ | 42 | /* default urb timeout */ |
43 | #define MOS_WDR_TIMEOUT (HZ * 5) | 43 | #define MOS_WDR_TIMEOUT 5000 |
44 | 44 | ||
45 | #define MOS_MAX_PORT 0x02 | 45 | #define MOS_MAX_PORT 0x02 |
46 | #define MOS_WRITE 0x0E | 46 | #define MOS_WRITE 0x0E |
@@ -227,11 +227,22 @@ static int read_mos_reg(struct usb_serial *serial, unsigned int serial_portnum, | |||
227 | __u8 requesttype = (__u8)0xc0; | 227 | __u8 requesttype = (__u8)0xc0; |
228 | __u16 index = get_reg_index(reg); | 228 | __u16 index = get_reg_index(reg); |
229 | __u16 value = get_reg_value(reg, serial_portnum); | 229 | __u16 value = get_reg_value(reg, serial_portnum); |
230 | int status = usb_control_msg(usbdev, pipe, request, requesttype, value, | 230 | u8 *buf; |
231 | index, data, 1, MOS_WDR_TIMEOUT); | 231 | int status; |
232 | if (status < 0) | 232 | |
233 | buf = kmalloc(1, GFP_KERNEL); | ||
234 | if (!buf) | ||
235 | return -ENOMEM; | ||
236 | |||
237 | status = usb_control_msg(usbdev, pipe, request, requesttype, value, | ||
238 | index, buf, 1, MOS_WDR_TIMEOUT); | ||
239 | if (status == 1) | ||
240 | *data = *buf; | ||
241 | else if (status < 0) | ||
233 | dev_err(&usbdev->dev, | 242 | dev_err(&usbdev->dev, |
234 | "mos7720: usb_control_msg() failed: %d", status); | 243 | "mos7720: usb_control_msg() failed: %d", status); |
244 | kfree(buf); | ||
245 | |||
235 | return status; | 246 | return status; |
236 | } | 247 | } |
237 | 248 | ||
@@ -1618,7 +1629,7 @@ static void change_port_settings(struct tty_struct *tty, | |||
1618 | mos7720_port->shadowMCR |= (UART_MCR_XONANY); | 1629 | mos7720_port->shadowMCR |= (UART_MCR_XONANY); |
1619 | /* To set hardware flow control to the specified * | 1630 | /* To set hardware flow control to the specified * |
1620 | * serial port, in SP1/2_CONTROL_REG */ | 1631 | * serial port, in SP1/2_CONTROL_REG */ |
1621 | if (port->number) | 1632 | if (port_number) |
1622 | write_mos_reg(serial, dummy, SP_CONTROL_REG, 0x01); | 1633 | write_mos_reg(serial, dummy, SP_CONTROL_REG, 0x01); |
1623 | else | 1634 | else |
1624 | write_mos_reg(serial, dummy, SP_CONTROL_REG, 0x02); | 1635 | write_mos_reg(serial, dummy, SP_CONTROL_REG, 0x02); |
@@ -1927,7 +1938,7 @@ static int mos7720_startup(struct usb_serial *serial) | |||
1927 | 1938 | ||
1928 | /* setting configuration feature to one */ | 1939 | /* setting configuration feature to one */ |
1929 | usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), | 1940 | usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), |
1930 | (__u8)0x03, 0x00, 0x01, 0x00, NULL, 0x00, 5*HZ); | 1941 | (__u8)0x03, 0x00, 0x01, 0x00, NULL, 0x00, 5000); |
1931 | 1942 | ||
1932 | /* start the interrupt urb */ | 1943 | /* start the interrupt urb */ |
1933 | ret_val = usb_submit_urb(serial->port[0]->interrupt_in_urb, GFP_KERNEL); | 1944 | ret_val = usb_submit_urb(serial->port[0]->interrupt_in_urb, GFP_KERNEL); |
@@ -1970,7 +1981,7 @@ static void mos7720_release(struct usb_serial *serial) | |||
1970 | /* wait for synchronous usb calls to return */ | 1981 | /* wait for synchronous usb calls to return */ |
1971 | if (mos_parport->msg_pending) | 1982 | if (mos_parport->msg_pending) |
1972 | wait_for_completion_timeout(&mos_parport->syncmsg_compl, | 1983 | wait_for_completion_timeout(&mos_parport->syncmsg_compl, |
1973 | MOS_WDR_TIMEOUT); | 1984 | msecs_to_jiffies(MOS_WDR_TIMEOUT)); |
1974 | 1985 | ||
1975 | parport_remove_port(mos_parport->pp); | 1986 | parport_remove_port(mos_parport->pp); |
1976 | usb_set_serial_data(serial, NULL); | 1987 | usb_set_serial_data(serial, NULL); |
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index a0d5ea545982..7e998081e1cd 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c | |||
@@ -2142,13 +2142,21 @@ static int mos7840_ioctl(struct tty_struct *tty, | |||
2142 | static int mos7810_check(struct usb_serial *serial) | 2142 | static int mos7810_check(struct usb_serial *serial) |
2143 | { | 2143 | { |
2144 | int i, pass_count = 0; | 2144 | int i, pass_count = 0; |
2145 | u8 *buf; | ||
2145 | __u16 data = 0, mcr_data = 0; | 2146 | __u16 data = 0, mcr_data = 0; |
2146 | __u16 test_pattern = 0x55AA; | 2147 | __u16 test_pattern = 0x55AA; |
2148 | int res; | ||
2149 | |||
2150 | buf = kmalloc(VENDOR_READ_LENGTH, GFP_KERNEL); | ||
2151 | if (!buf) | ||
2152 | return 0; /* failed to identify 7810 */ | ||
2147 | 2153 | ||
2148 | /* Store MCR setting */ | 2154 | /* Store MCR setting */ |
2149 | usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), | 2155 | res = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), |
2150 | MCS_RDREQ, MCS_RD_RTYPE, 0x0300, MODEM_CONTROL_REGISTER, | 2156 | MCS_RDREQ, MCS_RD_RTYPE, 0x0300, MODEM_CONTROL_REGISTER, |
2151 | &mcr_data, VENDOR_READ_LENGTH, MOS_WDR_TIMEOUT); | 2157 | buf, VENDOR_READ_LENGTH, MOS_WDR_TIMEOUT); |
2158 | if (res == VENDOR_READ_LENGTH) | ||
2159 | mcr_data = *buf; | ||
2152 | 2160 | ||
2153 | for (i = 0; i < 16; i++) { | 2161 | for (i = 0; i < 16; i++) { |
2154 | /* Send the 1-bit test pattern out to MCS7810 test pin */ | 2162 | /* Send the 1-bit test pattern out to MCS7810 test pin */ |
@@ -2158,9 +2166,12 @@ static int mos7810_check(struct usb_serial *serial) | |||
2158 | MODEM_CONTROL_REGISTER, NULL, 0, MOS_WDR_TIMEOUT); | 2166 | MODEM_CONTROL_REGISTER, NULL, 0, MOS_WDR_TIMEOUT); |
2159 | 2167 | ||
2160 | /* Read the test pattern back */ | 2168 | /* Read the test pattern back */ |
2161 | usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), | 2169 | res = usb_control_msg(serial->dev, |
2162 | MCS_RDREQ, MCS_RD_RTYPE, 0, GPIO_REGISTER, &data, | 2170 | usb_rcvctrlpipe(serial->dev, 0), MCS_RDREQ, |
2163 | VENDOR_READ_LENGTH, MOS_WDR_TIMEOUT); | 2171 | MCS_RD_RTYPE, 0, GPIO_REGISTER, buf, |
2172 | VENDOR_READ_LENGTH, MOS_WDR_TIMEOUT); | ||
2173 | if (res == VENDOR_READ_LENGTH) | ||
2174 | data = *buf; | ||
2164 | 2175 | ||
2165 | /* If this is a MCS7810 device, both test patterns must match */ | 2176 | /* If this is a MCS7810 device, both test patterns must match */ |
2166 | if (((test_pattern >> i) ^ (~data >> 1)) & 0x0001) | 2177 | if (((test_pattern >> i) ^ (~data >> 1)) & 0x0001) |
@@ -2174,6 +2185,8 @@ static int mos7810_check(struct usb_serial *serial) | |||
2174 | MCS_WR_RTYPE, 0x0300 | mcr_data, MODEM_CONTROL_REGISTER, NULL, | 2185 | MCS_WR_RTYPE, 0x0300 | mcr_data, MODEM_CONTROL_REGISTER, NULL, |
2175 | 0, MOS_WDR_TIMEOUT); | 2186 | 0, MOS_WDR_TIMEOUT); |
2176 | 2187 | ||
2188 | kfree(buf); | ||
2189 | |||
2177 | if (pass_count == 16) | 2190 | if (pass_count == 16) |
2178 | return 1; | 2191 | return 1; |
2179 | 2192 | ||
@@ -2183,11 +2196,17 @@ static int mos7810_check(struct usb_serial *serial) | |||
2183 | static int mos7840_calc_num_ports(struct usb_serial *serial) | 2196 | static int mos7840_calc_num_ports(struct usb_serial *serial) |
2184 | { | 2197 | { |
2185 | __u16 data = 0x00; | 2198 | __u16 data = 0x00; |
2199 | u8 *buf; | ||
2186 | int mos7840_num_ports; | 2200 | int mos7840_num_ports; |
2187 | 2201 | ||
2188 | usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), | 2202 | buf = kzalloc(VENDOR_READ_LENGTH, GFP_KERNEL); |
2189 | MCS_RDREQ, MCS_RD_RTYPE, 0, GPIO_REGISTER, &data, | 2203 | if (buf) { |
2190 | VENDOR_READ_LENGTH, MOS_WDR_TIMEOUT); | 2204 | usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), |
2205 | MCS_RDREQ, MCS_RD_RTYPE, 0, GPIO_REGISTER, buf, | ||
2206 | VENDOR_READ_LENGTH, MOS_WDR_TIMEOUT); | ||
2207 | data = *buf; | ||
2208 | kfree(buf); | ||
2209 | } | ||
2191 | 2210 | ||
2192 | if (serial->dev->descriptor.idProduct == MOSCHIP_DEVICE_ID_7810 || | 2211 | if (serial->dev->descriptor.idProduct == MOSCHIP_DEVICE_ID_7810 || |
2193 | serial->dev->descriptor.idProduct == MOSCHIP_DEVICE_ID_7820) { | 2212 | serial->dev->descriptor.idProduct == MOSCHIP_DEVICE_ID_7820) { |
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 734372846abb..bd4323ddae1a 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -196,6 +196,7 @@ static void option_instat_callback(struct urb *urb); | |||
196 | 196 | ||
197 | #define DELL_PRODUCT_5800_MINICARD_VZW 0x8195 /* Novatel E362 */ | 197 | #define DELL_PRODUCT_5800_MINICARD_VZW 0x8195 /* Novatel E362 */ |
198 | #define DELL_PRODUCT_5800_V2_MINICARD_VZW 0x8196 /* Novatel E362 */ | 198 | #define DELL_PRODUCT_5800_V2_MINICARD_VZW 0x8196 /* Novatel E362 */ |
199 | #define DELL_PRODUCT_5804_MINICARD_ATT 0x819b /* Novatel E371 */ | ||
199 | 200 | ||
200 | #define KYOCERA_VENDOR_ID 0x0c88 | 201 | #define KYOCERA_VENDOR_ID 0x0c88 |
201 | #define KYOCERA_PRODUCT_KPC650 0x17da | 202 | #define KYOCERA_PRODUCT_KPC650 0x17da |
@@ -249,13 +250,7 @@ static void option_instat_callback(struct urb *urb); | |||
249 | #define ZTE_PRODUCT_MF622 0x0001 | 250 | #define ZTE_PRODUCT_MF622 0x0001 |
250 | #define ZTE_PRODUCT_MF628 0x0015 | 251 | #define ZTE_PRODUCT_MF628 0x0015 |
251 | #define ZTE_PRODUCT_MF626 0x0031 | 252 | #define ZTE_PRODUCT_MF626 0x0031 |
252 | #define ZTE_PRODUCT_CDMA_TECH 0xfffe | ||
253 | #define ZTE_PRODUCT_AC8710 0xfff1 | ||
254 | #define ZTE_PRODUCT_AC2726 0xfff5 | ||
255 | #define ZTE_PRODUCT_AC8710T 0xffff | ||
256 | #define ZTE_PRODUCT_MC2718 0xffe8 | 253 | #define ZTE_PRODUCT_MC2718 0xffe8 |
257 | #define ZTE_PRODUCT_AD3812 0xffeb | ||
258 | #define ZTE_PRODUCT_MC2716 0xffed | ||
259 | 254 | ||
260 | #define BENQ_VENDOR_ID 0x04a5 | 255 | #define BENQ_VENDOR_ID 0x04a5 |
261 | #define BENQ_PRODUCT_H10 0x4068 | 256 | #define BENQ_PRODUCT_H10 0x4068 |
@@ -341,8 +336,8 @@ static void option_instat_callback(struct urb *urb); | |||
341 | #define CINTERION_PRODUCT_EU3_E 0x0051 | 336 | #define CINTERION_PRODUCT_EU3_E 0x0051 |
342 | #define CINTERION_PRODUCT_EU3_P 0x0052 | 337 | #define CINTERION_PRODUCT_EU3_P 0x0052 |
343 | #define CINTERION_PRODUCT_PH8 0x0053 | 338 | #define CINTERION_PRODUCT_PH8 0x0053 |
344 | #define CINTERION_PRODUCT_AH6 0x0055 | 339 | #define CINTERION_PRODUCT_AHXX 0x0055 |
345 | #define CINTERION_PRODUCT_PLS8 0x0060 | 340 | #define CINTERION_PRODUCT_PLXX 0x0060 |
346 | 341 | ||
347 | /* Olivetti products */ | 342 | /* Olivetti products */ |
348 | #define OLIVETTI_VENDOR_ID 0x0b3c | 343 | #define OLIVETTI_VENDOR_ID 0x0b3c |
@@ -494,18 +489,10 @@ static const struct option_blacklist_info zte_k3765_z_blacklist = { | |||
494 | .reserved = BIT(4), | 489 | .reserved = BIT(4), |
495 | }; | 490 | }; |
496 | 491 | ||
497 | static const struct option_blacklist_info zte_ad3812_z_blacklist = { | ||
498 | .sendsetup = BIT(0) | BIT(1) | BIT(2), | ||
499 | }; | ||
500 | |||
501 | static const struct option_blacklist_info zte_mc2718_z_blacklist = { | 492 | static const struct option_blacklist_info zte_mc2718_z_blacklist = { |
502 | .sendsetup = BIT(1) | BIT(2) | BIT(3) | BIT(4), | 493 | .sendsetup = BIT(1) | BIT(2) | BIT(3) | BIT(4), |
503 | }; | 494 | }; |
504 | 495 | ||
505 | static const struct option_blacklist_info zte_mc2716_z_blacklist = { | ||
506 | .sendsetup = BIT(1) | BIT(2) | BIT(3), | ||
507 | }; | ||
508 | |||
509 | static const struct option_blacklist_info huawei_cdc12_blacklist = { | 496 | static const struct option_blacklist_info huawei_cdc12_blacklist = { |
510 | .reserved = BIT(1) | BIT(2), | 497 | .reserved = BIT(1) | BIT(2), |
511 | }; | 498 | }; |
@@ -592,6 +579,8 @@ static const struct usb_device_id option_ids[] = { | |||
592 | .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist }, | 579 | .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist }, |
593 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3765, 0xff, 0xff, 0xff), | 580 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3765, 0xff, 0xff, 0xff), |
594 | .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist }, | 581 | .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist }, |
582 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x14ac, 0xff, 0xff, 0xff), /* Huawei E1820 */ | ||
583 | .driver_info = (kernel_ulong_t) &net_intf1_blacklist }, | ||
595 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4605, 0xff, 0xff, 0xff), | 584 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4605, 0xff, 0xff, 0xff), |
596 | .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist }, | 585 | .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist }, |
597 | { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0xff, 0xff) }, | 586 | { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0xff, 0xff) }, |
@@ -771,6 +760,7 @@ static const struct usb_device_id option_ids[] = { | |||
771 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_VZW) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */ | 760 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_VZW) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */ |
772 | { USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, DELL_PRODUCT_5800_MINICARD_VZW, 0xff, 0xff, 0xff) }, | 761 | { USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, DELL_PRODUCT_5800_MINICARD_VZW, 0xff, 0xff, 0xff) }, |
773 | { USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, DELL_PRODUCT_5800_V2_MINICARD_VZW, 0xff, 0xff, 0xff) }, | 762 | { USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, DELL_PRODUCT_5800_V2_MINICARD_VZW, 0xff, 0xff, 0xff) }, |
763 | { USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, DELL_PRODUCT_5804_MINICARD_ATT, 0xff, 0xff, 0xff) }, | ||
774 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, /* ADU-E100, ADU-310 */ | 764 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, /* ADU-E100, ADU-310 */ |
775 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) }, | 765 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) }, |
776 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_620UW) }, | 766 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_620UW) }, |
@@ -795,7 +785,6 @@ static const struct usb_device_id option_ids[] = { | |||
795 | { USB_DEVICE_INTERFACE_CLASS(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1012, 0xff) }, | 785 | { USB_DEVICE_INTERFACE_CLASS(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1012, 0xff) }, |
796 | { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC650) }, | 786 | { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC650) }, |
797 | { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) }, | 787 | { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) }, |
798 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6000)}, /* ZTE AC8700 */ | ||
799 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ | 788 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ |
800 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */ | 789 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */ |
801 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6280) }, /* BP3-USB & BP3-EXT HSDPA */ | 790 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6280) }, /* BP3-USB & BP3-EXT HSDPA */ |
@@ -966,6 +955,8 @@ static const struct usb_device_id option_ids[] = { | |||
966 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, | 955 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, |
967 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0330, 0xff, 0xff, 0xff) }, | 956 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0330, 0xff, 0xff, 0xff) }, |
968 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0395, 0xff, 0xff, 0xff) }, | 957 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0395, 0xff, 0xff, 0xff) }, |
958 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0412, 0xff, 0xff, 0xff), /* Telewell TW-LTE 4G */ | ||
959 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, | ||
969 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0414, 0xff, 0xff, 0xff) }, | 960 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0414, 0xff, 0xff, 0xff) }, |
970 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0417, 0xff, 0xff, 0xff) }, | 961 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0417, 0xff, 0xff, 0xff) }, |
971 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1008, 0xff, 0xff, 0xff), | 962 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1008, 0xff, 0xff, 0xff), |
@@ -1195,16 +1186,9 @@ static const struct usb_device_id option_ids[] = { | |||
1195 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0178, 0xff, 0xff, 0xff), | 1186 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0178, 0xff, 0xff, 0xff), |
1196 | .driver_info = (kernel_ulong_t)&net_intf3_blacklist }, | 1187 | .driver_info = (kernel_ulong_t)&net_intf3_blacklist }, |
1197 | 1188 | ||
1198 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) }, | 1189 | /* NOTE: most ZTE CDMA devices should be driven by zte_ev, not option */ |
1199 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) }, | ||
1200 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) }, | ||
1201 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710T, 0xff, 0xff, 0xff) }, | ||
1202 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MC2718, 0xff, 0xff, 0xff), | 1190 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MC2718, 0xff, 0xff, 0xff), |
1203 | .driver_info = (kernel_ulong_t)&zte_mc2718_z_blacklist }, | 1191 | .driver_info = (kernel_ulong_t)&zte_mc2718_z_blacklist }, |
1204 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AD3812, 0xff, 0xff, 0xff), | ||
1205 | .driver_info = (kernel_ulong_t)&zte_ad3812_z_blacklist }, | ||
1206 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MC2716, 0xff, 0xff, 0xff), | ||
1207 | .driver_info = (kernel_ulong_t)&zte_mc2716_z_blacklist }, | ||
1208 | { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x01) }, | 1192 | { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x01) }, |
1209 | { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x05) }, | 1193 | { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x05) }, |
1210 | { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x86, 0x10) }, | 1194 | { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x86, 0x10) }, |
@@ -1264,8 +1248,9 @@ static const struct usb_device_id option_ids[] = { | |||
1264 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_E) }, | 1248 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_E) }, |
1265 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_P) }, | 1249 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_P) }, |
1266 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PH8) }, | 1250 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PH8) }, |
1267 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_AH6) }, | 1251 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_AHXX) }, |
1268 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PLS8) }, | 1252 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PLXX), |
1253 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, | ||
1269 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) }, | 1254 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) }, |
1270 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDMNET) }, | 1255 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDMNET) }, |
1271 | { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC25_MDM) }, | 1256 | { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC25_MDM) }, |
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index 7151659367a0..048cd44d51b1 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c | |||
@@ -284,7 +284,7 @@ static void pl2303_set_termios(struct tty_struct *tty, | |||
284 | serial settings even to the same values as before. Thus | 284 | serial settings even to the same values as before. Thus |
285 | we actually need to filter in this specific case */ | 285 | we actually need to filter in this specific case */ |
286 | 286 | ||
287 | if (!tty_termios_hw_change(&tty->termios, old_termios)) | 287 | if (old_termios && !tty_termios_hw_change(&tty->termios, old_termios)) |
288 | return; | 288 | return; |
289 | 289 | ||
290 | cflag = tty->termios.c_cflag; | 290 | cflag = tty->termios.c_cflag; |
@@ -293,7 +293,8 @@ static void pl2303_set_termios(struct tty_struct *tty, | |||
293 | if (!buf) { | 293 | if (!buf) { |
294 | dev_err(&port->dev, "%s - out of memory.\n", __func__); | 294 | dev_err(&port->dev, "%s - out of memory.\n", __func__); |
295 | /* Report back no change occurred */ | 295 | /* Report back no change occurred */ |
296 | tty->termios = *old_termios; | 296 | if (old_termios) |
297 | tty->termios = *old_termios; | ||
297 | return; | 298 | return; |
298 | } | 299 | } |
299 | 300 | ||
@@ -433,7 +434,7 @@ static void pl2303_set_termios(struct tty_struct *tty, | |||
433 | control = priv->line_control; | 434 | control = priv->line_control; |
434 | if ((cflag & CBAUD) == B0) | 435 | if ((cflag & CBAUD) == B0) |
435 | priv->line_control &= ~(CONTROL_DTR | CONTROL_RTS); | 436 | priv->line_control &= ~(CONTROL_DTR | CONTROL_RTS); |
436 | else if ((old_termios->c_cflag & CBAUD) == B0) | 437 | else if (old_termios && (old_termios->c_cflag & CBAUD) == B0) |
437 | priv->line_control |= (CONTROL_DTR | CONTROL_RTS); | 438 | priv->line_control |= (CONTROL_DTR | CONTROL_RTS); |
438 | if (control != priv->line_control) { | 439 | if (control != priv->line_control) { |
439 | control = priv->line_control; | 440 | control = priv->line_control; |
@@ -492,7 +493,6 @@ static void pl2303_close(struct usb_serial_port *port) | |||
492 | 493 | ||
493 | static int pl2303_open(struct tty_struct *tty, struct usb_serial_port *port) | 494 | static int pl2303_open(struct tty_struct *tty, struct usb_serial_port *port) |
494 | { | 495 | { |
495 | struct ktermios tmp_termios; | ||
496 | struct usb_serial *serial = port->serial; | 496 | struct usb_serial *serial = port->serial; |
497 | struct pl2303_serial_private *spriv = usb_get_serial_data(serial); | 497 | struct pl2303_serial_private *spriv = usb_get_serial_data(serial); |
498 | int result; | 498 | int result; |
@@ -508,7 +508,7 @@ static int pl2303_open(struct tty_struct *tty, struct usb_serial_port *port) | |||
508 | 508 | ||
509 | /* Setup termios */ | 509 | /* Setup termios */ |
510 | if (tty) | 510 | if (tty) |
511 | pl2303_set_termios(tty, port, &tmp_termios); | 511 | pl2303_set_termios(tty, port, NULL); |
512 | 512 | ||
513 | result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); | 513 | result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); |
514 | if (result) { | 514 | if (result) { |
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c index 59b32b782126..bd794b43898c 100644 --- a/drivers/usb/serial/qcserial.c +++ b/drivers/usb/serial/qcserial.c | |||
@@ -118,6 +118,7 @@ static const struct usb_device_id id_table[] = { | |||
118 | {USB_DEVICE(0x1199, 0x901b)}, /* Sierra Wireless MC7770 */ | 118 | {USB_DEVICE(0x1199, 0x901b)}, /* Sierra Wireless MC7770 */ |
119 | {USB_DEVICE(0x12D1, 0x14F0)}, /* Sony Gobi 3000 QDL */ | 119 | {USB_DEVICE(0x12D1, 0x14F0)}, /* Sony Gobi 3000 QDL */ |
120 | {USB_DEVICE(0x12D1, 0x14F1)}, /* Sony Gobi 3000 Composite */ | 120 | {USB_DEVICE(0x12D1, 0x14F1)}, /* Sony Gobi 3000 Composite */ |
121 | {USB_DEVICE(0x0AF0, 0x8120)}, /* Option GTM681W */ | ||
121 | 122 | ||
122 | /* non Gobi Qualcomm serial devices */ | 123 | /* non Gobi Qualcomm serial devices */ |
123 | {USB_DEVICE_INTERFACE_NUMBER(0x0f3d, 0x68a2, 0)}, /* Sierra Wireless MC7700 Device Management */ | 124 | {USB_DEVICE_INTERFACE_NUMBER(0x0f3d, 0x68a2, 0)}, /* Sierra Wireless MC7700 Device Management */ |
diff --git a/drivers/usb/serial/spcp8x5.c b/drivers/usb/serial/spcp8x5.c index cf3df793c2b7..ddf6c47137dc 100644 --- a/drivers/usb/serial/spcp8x5.c +++ b/drivers/usb/serial/spcp8x5.c | |||
@@ -291,7 +291,6 @@ static void spcp8x5_set_termios(struct tty_struct *tty, | |||
291 | struct spcp8x5_private *priv = usb_get_serial_port_data(port); | 291 | struct spcp8x5_private *priv = usb_get_serial_port_data(port); |
292 | unsigned long flags; | 292 | unsigned long flags; |
293 | unsigned int cflag = tty->termios.c_cflag; | 293 | unsigned int cflag = tty->termios.c_cflag; |
294 | unsigned int old_cflag = old_termios->c_cflag; | ||
295 | unsigned short uartdata; | 294 | unsigned short uartdata; |
296 | unsigned char buf[2] = {0, 0}; | 295 | unsigned char buf[2] = {0, 0}; |
297 | int baud; | 296 | int baud; |
@@ -299,15 +298,15 @@ static void spcp8x5_set_termios(struct tty_struct *tty, | |||
299 | u8 control; | 298 | u8 control; |
300 | 299 | ||
301 | /* check that they really want us to change something */ | 300 | /* check that they really want us to change something */ |
302 | if (!tty_termios_hw_change(&tty->termios, old_termios)) | 301 | if (old_termios && !tty_termios_hw_change(&tty->termios, old_termios)) |
303 | return; | 302 | return; |
304 | 303 | ||
305 | /* set DTR/RTS active */ | 304 | /* set DTR/RTS active */ |
306 | spin_lock_irqsave(&priv->lock, flags); | 305 | spin_lock_irqsave(&priv->lock, flags); |
307 | control = priv->line_control; | 306 | control = priv->line_control; |
308 | if ((old_cflag & CBAUD) == B0) { | 307 | if (old_termios && (old_termios->c_cflag & CBAUD) == B0) { |
309 | priv->line_control |= MCR_DTR; | 308 | priv->line_control |= MCR_DTR; |
310 | if (!(old_cflag & CRTSCTS)) | 309 | if (!(old_termios->c_cflag & CRTSCTS)) |
311 | priv->line_control |= MCR_RTS; | 310 | priv->line_control |= MCR_RTS; |
312 | } | 311 | } |
313 | if (control != priv->line_control) { | 312 | if (control != priv->line_control) { |
@@ -394,7 +393,6 @@ static void spcp8x5_set_termios(struct tty_struct *tty, | |||
394 | 393 | ||
395 | static int spcp8x5_open(struct tty_struct *tty, struct usb_serial_port *port) | 394 | static int spcp8x5_open(struct tty_struct *tty, struct usb_serial_port *port) |
396 | { | 395 | { |
397 | struct ktermios tmp_termios; | ||
398 | struct usb_serial *serial = port->serial; | 396 | struct usb_serial *serial = port->serial; |
399 | struct spcp8x5_private *priv = usb_get_serial_port_data(port); | 397 | struct spcp8x5_private *priv = usb_get_serial_port_data(port); |
400 | int ret; | 398 | int ret; |
@@ -411,7 +409,7 @@ static int spcp8x5_open(struct tty_struct *tty, struct usb_serial_port *port) | |||
411 | spcp8x5_set_ctrl_line(port, priv->line_control); | 409 | spcp8x5_set_ctrl_line(port, priv->line_control); |
412 | 410 | ||
413 | if (tty) | 411 | if (tty) |
414 | spcp8x5_set_termios(tty, port, &tmp_termios); | 412 | spcp8x5_set_termios(tty, port, NULL); |
415 | 413 | ||
416 | port->port.drain_delay = 256; | 414 | port->port.drain_delay = 256; |
417 | 415 | ||
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index cac47aef2918..e581c2549a57 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.c +++ b/drivers/usb/serial/ti_usb_3410_5052.c | |||
@@ -101,6 +101,7 @@ static int ti_write(struct tty_struct *tty, struct usb_serial_port *port, | |||
101 | const unsigned char *data, int count); | 101 | const unsigned char *data, int count); |
102 | static int ti_write_room(struct tty_struct *tty); | 102 | static int ti_write_room(struct tty_struct *tty); |
103 | static int ti_chars_in_buffer(struct tty_struct *tty); | 103 | static int ti_chars_in_buffer(struct tty_struct *tty); |
104 | static bool ti_tx_empty(struct usb_serial_port *port); | ||
104 | static void ti_throttle(struct tty_struct *tty); | 105 | static void ti_throttle(struct tty_struct *tty); |
105 | static void ti_unthrottle(struct tty_struct *tty); | 106 | static void ti_unthrottle(struct tty_struct *tty); |
106 | static int ti_ioctl(struct tty_struct *tty, | 107 | static int ti_ioctl(struct tty_struct *tty, |
@@ -171,7 +172,8 @@ static struct usb_device_id ti_id_table_3410[15+TI_EXTRA_VID_PID_COUNT+1] = { | |||
171 | { USB_DEVICE(IBM_VENDOR_ID, IBM_4543_PRODUCT_ID) }, | 172 | { USB_DEVICE(IBM_VENDOR_ID, IBM_4543_PRODUCT_ID) }, |
172 | { USB_DEVICE(IBM_VENDOR_ID, IBM_454B_PRODUCT_ID) }, | 173 | { USB_DEVICE(IBM_VENDOR_ID, IBM_454B_PRODUCT_ID) }, |
173 | { USB_DEVICE(IBM_VENDOR_ID, IBM_454C_PRODUCT_ID) }, | 174 | { USB_DEVICE(IBM_VENDOR_ID, IBM_454C_PRODUCT_ID) }, |
174 | { USB_DEVICE(ABBOTT_VENDOR_ID, ABBOTT_PRODUCT_ID) }, | 175 | { USB_DEVICE(ABBOTT_VENDOR_ID, ABBOTT_STEREO_PLUG_ID) }, |
176 | { USB_DEVICE(ABBOTT_VENDOR_ID, ABBOTT_STRIP_PORT_ID) }, | ||
175 | { USB_DEVICE(TI_VENDOR_ID, FRI2_PRODUCT_ID) }, | 177 | { USB_DEVICE(TI_VENDOR_ID, FRI2_PRODUCT_ID) }, |
176 | }; | 178 | }; |
177 | 179 | ||
@@ -222,6 +224,7 @@ static struct usb_serial_driver ti_1port_device = { | |||
222 | .write = ti_write, | 224 | .write = ti_write, |
223 | .write_room = ti_write_room, | 225 | .write_room = ti_write_room, |
224 | .chars_in_buffer = ti_chars_in_buffer, | 226 | .chars_in_buffer = ti_chars_in_buffer, |
227 | .tx_empty = ti_tx_empty, | ||
225 | .throttle = ti_throttle, | 228 | .throttle = ti_throttle, |
226 | .unthrottle = ti_unthrottle, | 229 | .unthrottle = ti_unthrottle, |
227 | .ioctl = ti_ioctl, | 230 | .ioctl = ti_ioctl, |
@@ -253,6 +256,7 @@ static struct usb_serial_driver ti_2port_device = { | |||
253 | .write = ti_write, | 256 | .write = ti_write, |
254 | .write_room = ti_write_room, | 257 | .write_room = ti_write_room, |
255 | .chars_in_buffer = ti_chars_in_buffer, | 258 | .chars_in_buffer = ti_chars_in_buffer, |
259 | .tx_empty = ti_tx_empty, | ||
256 | .throttle = ti_throttle, | 260 | .throttle = ti_throttle, |
257 | .unthrottle = ti_unthrottle, | 261 | .unthrottle = ti_unthrottle, |
258 | .ioctl = ti_ioctl, | 262 | .ioctl = ti_ioctl, |
@@ -684,8 +688,6 @@ static int ti_chars_in_buffer(struct tty_struct *tty) | |||
684 | struct ti_port *tport = usb_get_serial_port_data(port); | 688 | struct ti_port *tport = usb_get_serial_port_data(port); |
685 | int chars = 0; | 689 | int chars = 0; |
686 | unsigned long flags; | 690 | unsigned long flags; |
687 | int ret; | ||
688 | u8 lsr; | ||
689 | 691 | ||
690 | if (tport == NULL) | 692 | if (tport == NULL) |
691 | return 0; | 693 | return 0; |
@@ -694,16 +696,22 @@ static int ti_chars_in_buffer(struct tty_struct *tty) | |||
694 | chars = kfifo_len(&tport->write_fifo); | 696 | chars = kfifo_len(&tport->write_fifo); |
695 | spin_unlock_irqrestore(&tport->tp_lock, flags); | 697 | spin_unlock_irqrestore(&tport->tp_lock, flags); |
696 | 698 | ||
697 | if (!chars) { | ||
698 | ret = ti_get_lsr(tport, &lsr); | ||
699 | if (!ret && !(lsr & TI_LSR_TX_EMPTY)) | ||
700 | chars = 1; | ||
701 | } | ||
702 | |||
703 | dev_dbg(&port->dev, "%s - returns %d\n", __func__, chars); | 699 | dev_dbg(&port->dev, "%s - returns %d\n", __func__, chars); |
704 | return chars; | 700 | return chars; |
705 | } | 701 | } |
706 | 702 | ||
703 | static bool ti_tx_empty(struct usb_serial_port *port) | ||
704 | { | ||
705 | struct ti_port *tport = usb_get_serial_port_data(port); | ||
706 | int ret; | ||
707 | u8 lsr; | ||
708 | |||
709 | ret = ti_get_lsr(tport, &lsr); | ||
710 | if (!ret && !(lsr & TI_LSR_TX_EMPTY)) | ||
711 | return false; | ||
712 | |||
713 | return true; | ||
714 | } | ||
707 | 715 | ||
708 | static void ti_throttle(struct tty_struct *tty) | 716 | static void ti_throttle(struct tty_struct *tty) |
709 | { | 717 | { |
diff --git a/drivers/usb/serial/ti_usb_3410_5052.h b/drivers/usb/serial/ti_usb_3410_5052.h index b353e7e3d480..4a2423e84d55 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.h +++ b/drivers/usb/serial/ti_usb_3410_5052.h | |||
@@ -52,7 +52,9 @@ | |||
52 | 52 | ||
53 | /* Abbott Diabetics vendor and product ids */ | 53 | /* Abbott Diabetics vendor and product ids */ |
54 | #define ABBOTT_VENDOR_ID 0x1a61 | 54 | #define ABBOTT_VENDOR_ID 0x1a61 |
55 | #define ABBOTT_PRODUCT_ID 0x3410 | 55 | #define ABBOTT_STEREO_PLUG_ID 0x3410 |
56 | #define ABBOTT_PRODUCT_ID ABBOTT_STEREO_PLUG_ID | ||
57 | #define ABBOTT_STRIP_PORT_ID 0x3420 | ||
56 | 58 | ||
57 | /* Commands */ | 59 | /* Commands */ |
58 | #define TI_GET_VERSION 0x01 | 60 | #define TI_GET_VERSION 0x01 |
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index cf75beb1251b..5f6b1ff9d29e 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -359,20 +359,29 @@ static int serial_chars_in_buffer(struct tty_struct *tty) | |||
359 | { | 359 | { |
360 | struct usb_serial_port *port = tty->driver_data; | 360 | struct usb_serial_port *port = tty->driver_data; |
361 | struct usb_serial *serial = port->serial; | 361 | struct usb_serial *serial = port->serial; |
362 | int count = 0; | ||
363 | 362 | ||
364 | dev_dbg(tty->dev, "%s\n", __func__); | 363 | dev_dbg(tty->dev, "%s\n", __func__); |
365 | 364 | ||
366 | mutex_lock(&serial->disc_mutex); | ||
367 | /* if the device was unplugged then any remaining characters | ||
368 | fell out of the connector ;) */ | ||
369 | if (serial->disconnected) | 365 | if (serial->disconnected) |
370 | count = 0; | 366 | return 0; |
371 | else | ||
372 | count = serial->type->chars_in_buffer(tty); | ||
373 | mutex_unlock(&serial->disc_mutex); | ||
374 | 367 | ||
375 | return count; | 368 | return serial->type->chars_in_buffer(tty); |
369 | } | ||
370 | |||
371 | static void serial_wait_until_sent(struct tty_struct *tty, int timeout) | ||
372 | { | ||
373 | struct usb_serial_port *port = tty->driver_data; | ||
374 | struct usb_serial *serial = port->serial; | ||
375 | |||
376 | dev_dbg(tty->dev, "%s\n", __func__); | ||
377 | |||
378 | if (!port->serial->type->wait_until_sent) | ||
379 | return; | ||
380 | |||
381 | mutex_lock(&serial->disc_mutex); | ||
382 | if (!serial->disconnected) | ||
383 | port->serial->type->wait_until_sent(tty, timeout); | ||
384 | mutex_unlock(&serial->disc_mutex); | ||
376 | } | 385 | } |
377 | 386 | ||
378 | static void serial_throttle(struct tty_struct *tty) | 387 | static void serial_throttle(struct tty_struct *tty) |
@@ -399,7 +408,7 @@ static int serial_ioctl(struct tty_struct *tty, | |||
399 | unsigned int cmd, unsigned long arg) | 408 | unsigned int cmd, unsigned long arg) |
400 | { | 409 | { |
401 | struct usb_serial_port *port = tty->driver_data; | 410 | struct usb_serial_port *port = tty->driver_data; |
402 | int retval = -ENODEV; | 411 | int retval = -ENOIOCTLCMD; |
403 | 412 | ||
404 | dev_dbg(tty->dev, "%s - cmd 0x%.4x\n", __func__, cmd); | 413 | dev_dbg(tty->dev, "%s - cmd 0x%.4x\n", __func__, cmd); |
405 | 414 | ||
@@ -411,8 +420,6 @@ static int serial_ioctl(struct tty_struct *tty, | |||
411 | default: | 420 | default: |
412 | if (port->serial->type->ioctl) | 421 | if (port->serial->type->ioctl) |
413 | retval = port->serial->type->ioctl(tty, cmd, arg); | 422 | retval = port->serial->type->ioctl(tty, cmd, arg); |
414 | else | ||
415 | retval = -ENOIOCTLCMD; | ||
416 | } | 423 | } |
417 | 424 | ||
418 | return retval; | 425 | return retval; |
@@ -1191,6 +1198,7 @@ static const struct tty_operations serial_ops = { | |||
1191 | .unthrottle = serial_unthrottle, | 1198 | .unthrottle = serial_unthrottle, |
1192 | .break_ctl = serial_break, | 1199 | .break_ctl = serial_break, |
1193 | .chars_in_buffer = serial_chars_in_buffer, | 1200 | .chars_in_buffer = serial_chars_in_buffer, |
1201 | .wait_until_sent = serial_wait_until_sent, | ||
1194 | .tiocmget = serial_tiocmget, | 1202 | .tiocmget = serial_tiocmget, |
1195 | .tiocmset = serial_tiocmset, | 1203 | .tiocmset = serial_tiocmset, |
1196 | .get_icount = serial_get_icount, | 1204 | .get_icount = serial_get_icount, |
@@ -1316,6 +1324,8 @@ static void usb_serial_operations_init(struct usb_serial_driver *device) | |||
1316 | set_to_generic_if_null(device, close); | 1324 | set_to_generic_if_null(device, close); |
1317 | set_to_generic_if_null(device, write_room); | 1325 | set_to_generic_if_null(device, write_room); |
1318 | set_to_generic_if_null(device, chars_in_buffer); | 1326 | set_to_generic_if_null(device, chars_in_buffer); |
1327 | if (device->tx_empty) | ||
1328 | set_to_generic_if_null(device, wait_until_sent); | ||
1319 | set_to_generic_if_null(device, read_bulk_callback); | 1329 | set_to_generic_if_null(device, read_bulk_callback); |
1320 | set_to_generic_if_null(device, write_bulk_callback); | 1330 | set_to_generic_if_null(device, write_bulk_callback); |
1321 | set_to_generic_if_null(device, process_read_urb); | 1331 | set_to_generic_if_null(device, process_read_urb); |
diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c index 7573ec8a084f..9910aa2edf4b 100644 --- a/drivers/usb/serial/visor.c +++ b/drivers/usb/serial/visor.c | |||
@@ -560,10 +560,19 @@ static int treo_attach(struct usb_serial *serial) | |||
560 | */ | 560 | */ |
561 | #define COPY_PORT(dest, src) \ | 561 | #define COPY_PORT(dest, src) \ |
562 | do { \ | 562 | do { \ |
563 | int i; \ | ||
564 | \ | ||
565 | for (i = 0; i < ARRAY_SIZE(src->read_urbs); ++i) { \ | ||
566 | dest->read_urbs[i] = src->read_urbs[i]; \ | ||
567 | dest->read_urbs[i]->context = dest; \ | ||
568 | dest->bulk_in_buffers[i] = src->bulk_in_buffers[i]; \ | ||
569 | } \ | ||
563 | dest->read_urb = src->read_urb; \ | 570 | dest->read_urb = src->read_urb; \ |
564 | dest->bulk_in_endpointAddress = src->bulk_in_endpointAddress;\ | 571 | dest->bulk_in_endpointAddress = src->bulk_in_endpointAddress;\ |
565 | dest->bulk_in_buffer = src->bulk_in_buffer; \ | 572 | dest->bulk_in_buffer = src->bulk_in_buffer; \ |
573 | dest->bulk_in_size = src->bulk_in_size; \ | ||
566 | dest->interrupt_in_urb = src->interrupt_in_urb; \ | 574 | dest->interrupt_in_urb = src->interrupt_in_urb; \ |
575 | dest->interrupt_in_urb->context = dest; \ | ||
567 | dest->interrupt_in_endpointAddress = \ | 576 | dest->interrupt_in_endpointAddress = \ |
568 | src->interrupt_in_endpointAddress;\ | 577 | src->interrupt_in_endpointAddress;\ |
569 | dest->interrupt_in_buffer = src->interrupt_in_buffer; \ | 578 | dest->interrupt_in_buffer = src->interrupt_in_buffer; \ |
diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c index b9fca3586d74..347caad47a12 100644 --- a/drivers/usb/serial/whiteheat.c +++ b/drivers/usb/serial/whiteheat.c | |||
@@ -649,7 +649,7 @@ static void firm_setup_port(struct tty_struct *tty) | |||
649 | struct whiteheat_port_settings port_settings; | 649 | struct whiteheat_port_settings port_settings; |
650 | unsigned int cflag = tty->termios.c_cflag; | 650 | unsigned int cflag = tty->termios.c_cflag; |
651 | 651 | ||
652 | port_settings.port = port->number + 1; | 652 | port_settings.port = port->number - port->serial->minor + 1; |
653 | 653 | ||
654 | /* get the byte size */ | 654 | /* get the byte size */ |
655 | switch (cflag & CSIZE) { | 655 | switch (cflag & CSIZE) { |
diff --git a/drivers/usb/serial/zte_ev.c b/drivers/usb/serial/zte_ev.c index 39ee7373b4ee..fca4c752a4ed 100644 --- a/drivers/usb/serial/zte_ev.c +++ b/drivers/usb/serial/zte_ev.c | |||
@@ -41,9 +41,6 @@ static int zte_ev_usb_serial_open(struct tty_struct *tty, | |||
41 | int len; | 41 | int len; |
42 | unsigned char *buf; | 42 | unsigned char *buf; |
43 | 43 | ||
44 | if (port->number != 0) | ||
45 | return -ENODEV; | ||
46 | |||
47 | buf = kmalloc(MAX_SETUP_DATA_SIZE, GFP_KERNEL); | 44 | buf = kmalloc(MAX_SETUP_DATA_SIZE, GFP_KERNEL); |
48 | if (!buf) | 45 | if (!buf) |
49 | return -ENOMEM; | 46 | return -ENOMEM; |
@@ -53,7 +50,7 @@ static int zte_ev_usb_serial_open(struct tty_struct *tty, | |||
53 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), | 50 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), |
54 | 0x22, 0x21, | 51 | 0x22, 0x21, |
55 | 0x0001, 0x0000, NULL, len, | 52 | 0x0001, 0x0000, NULL, len, |
56 | HZ * USB_CTRL_GET_TIMEOUT); | 53 | USB_CTRL_GET_TIMEOUT); |
57 | dev_dbg(dev, "result = %d\n", result); | 54 | dev_dbg(dev, "result = %d\n", result); |
58 | 55 | ||
59 | /* send 2st cmd and recieve data */ | 56 | /* send 2st cmd and recieve data */ |
@@ -65,7 +62,7 @@ static int zte_ev_usb_serial_open(struct tty_struct *tty, | |||
65 | result = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), | 62 | result = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), |
66 | 0x21, 0xa1, | 63 | 0x21, 0xa1, |
67 | 0x0000, 0x0000, buf, len, | 64 | 0x0000, 0x0000, buf, len, |
68 | HZ * USB_CTRL_GET_TIMEOUT); | 65 | USB_CTRL_GET_TIMEOUT); |
69 | debug_data(dev, __func__, len, buf, result); | 66 | debug_data(dev, __func__, len, buf, result); |
70 | 67 | ||
71 | /* send 3 cmd */ | 68 | /* send 3 cmd */ |
@@ -84,7 +81,7 @@ static int zte_ev_usb_serial_open(struct tty_struct *tty, | |||
84 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), | 81 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), |
85 | 0x20, 0x21, | 82 | 0x20, 0x21, |
86 | 0x0000, 0x0000, buf, len, | 83 | 0x0000, 0x0000, buf, len, |
87 | HZ * USB_CTRL_GET_TIMEOUT); | 84 | USB_CTRL_GET_TIMEOUT); |
88 | debug_data(dev, __func__, len, buf, result); | 85 | debug_data(dev, __func__, len, buf, result); |
89 | 86 | ||
90 | /* send 4 cmd */ | 87 | /* send 4 cmd */ |
@@ -95,7 +92,7 @@ static int zte_ev_usb_serial_open(struct tty_struct *tty, | |||
95 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), | 92 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), |
96 | 0x22, 0x21, | 93 | 0x22, 0x21, |
97 | 0x0003, 0x0000, NULL, len, | 94 | 0x0003, 0x0000, NULL, len, |
98 | HZ * USB_CTRL_GET_TIMEOUT); | 95 | USB_CTRL_GET_TIMEOUT); |
99 | dev_dbg(dev, "result = %d\n", result); | 96 | dev_dbg(dev, "result = %d\n", result); |
100 | 97 | ||
101 | /* send 5 cmd */ | 98 | /* send 5 cmd */ |
@@ -107,7 +104,7 @@ static int zte_ev_usb_serial_open(struct tty_struct *tty, | |||
107 | result = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), | 104 | result = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), |
108 | 0x21, 0xa1, | 105 | 0x21, 0xa1, |
109 | 0x0000, 0x0000, buf, len, | 106 | 0x0000, 0x0000, buf, len, |
110 | HZ * USB_CTRL_GET_TIMEOUT); | 107 | USB_CTRL_GET_TIMEOUT); |
111 | debug_data(dev, __func__, len, buf, result); | 108 | debug_data(dev, __func__, len, buf, result); |
112 | 109 | ||
113 | /* send 6 cmd */ | 110 | /* send 6 cmd */ |
@@ -126,7 +123,7 @@ static int zte_ev_usb_serial_open(struct tty_struct *tty, | |||
126 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), | 123 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), |
127 | 0x20, 0x21, | 124 | 0x20, 0x21, |
128 | 0x0000, 0x0000, buf, len, | 125 | 0x0000, 0x0000, buf, len, |
129 | HZ * USB_CTRL_GET_TIMEOUT); | 126 | USB_CTRL_GET_TIMEOUT); |
130 | debug_data(dev, __func__, len, buf, result); | 127 | debug_data(dev, __func__, len, buf, result); |
131 | kfree(buf); | 128 | kfree(buf); |
132 | 129 | ||
@@ -166,9 +163,6 @@ static void zte_ev_usb_serial_close(struct usb_serial_port *port) | |||
166 | int len; | 163 | int len; |
167 | unsigned char *buf; | 164 | unsigned char *buf; |
168 | 165 | ||
169 | if (port->number != 0) | ||
170 | return; | ||
171 | |||
172 | buf = kmalloc(MAX_SETUP_DATA_SIZE, GFP_KERNEL); | 166 | buf = kmalloc(MAX_SETUP_DATA_SIZE, GFP_KERNEL); |
173 | if (!buf) | 167 | if (!buf) |
174 | return; | 168 | return; |
@@ -178,7 +172,7 @@ static void zte_ev_usb_serial_close(struct usb_serial_port *port) | |||
178 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), | 172 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), |
179 | 0x22, 0x21, | 173 | 0x22, 0x21, |
180 | 0x0002, 0x0000, NULL, len, | 174 | 0x0002, 0x0000, NULL, len, |
181 | HZ * USB_CTRL_GET_TIMEOUT); | 175 | USB_CTRL_GET_TIMEOUT); |
182 | dev_dbg(dev, "result = %d\n", result); | 176 | dev_dbg(dev, "result = %d\n", result); |
183 | 177 | ||
184 | /* send 2st ctl cmd(CTL 21 22 03 00 00 00 00 00 ) */ | 178 | /* send 2st ctl cmd(CTL 21 22 03 00 00 00 00 00 ) */ |
@@ -186,7 +180,7 @@ static void zte_ev_usb_serial_close(struct usb_serial_port *port) | |||
186 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), | 180 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), |
187 | 0x22, 0x21, | 181 | 0x22, 0x21, |
188 | 0x0003, 0x0000, NULL, len, | 182 | 0x0003, 0x0000, NULL, len, |
189 | HZ * USB_CTRL_GET_TIMEOUT); | 183 | USB_CTRL_GET_TIMEOUT); |
190 | dev_dbg(dev, "result = %d\n", result); | 184 | dev_dbg(dev, "result = %d\n", result); |
191 | 185 | ||
192 | /* send 3st cmd and recieve data */ | 186 | /* send 3st cmd and recieve data */ |
@@ -198,7 +192,7 @@ static void zte_ev_usb_serial_close(struct usb_serial_port *port) | |||
198 | result = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), | 192 | result = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), |
199 | 0x21, 0xa1, | 193 | 0x21, 0xa1, |
200 | 0x0000, 0x0000, buf, len, | 194 | 0x0000, 0x0000, buf, len, |
201 | HZ * USB_CTRL_GET_TIMEOUT); | 195 | USB_CTRL_GET_TIMEOUT); |
202 | debug_data(dev, __func__, len, buf, result); | 196 | debug_data(dev, __func__, len, buf, result); |
203 | 197 | ||
204 | /* send 4 cmd */ | 198 | /* send 4 cmd */ |
@@ -217,7 +211,7 @@ static void zte_ev_usb_serial_close(struct usb_serial_port *port) | |||
217 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), | 211 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), |
218 | 0x20, 0x21, | 212 | 0x20, 0x21, |
219 | 0x0000, 0x0000, buf, len, | 213 | 0x0000, 0x0000, buf, len, |
220 | HZ * USB_CTRL_GET_TIMEOUT); | 214 | USB_CTRL_GET_TIMEOUT); |
221 | debug_data(dev, __func__, len, buf, result); | 215 | debug_data(dev, __func__, len, buf, result); |
222 | 216 | ||
223 | /* send 5 cmd */ | 217 | /* send 5 cmd */ |
@@ -228,7 +222,7 @@ static void zte_ev_usb_serial_close(struct usb_serial_port *port) | |||
228 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), | 222 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), |
229 | 0x22, 0x21, | 223 | 0x22, 0x21, |
230 | 0x0003, 0x0000, NULL, len, | 224 | 0x0003, 0x0000, NULL, len, |
231 | HZ * USB_CTRL_GET_TIMEOUT); | 225 | USB_CTRL_GET_TIMEOUT); |
232 | dev_dbg(dev, "result = %d\n", result); | 226 | dev_dbg(dev, "result = %d\n", result); |
233 | 227 | ||
234 | /* send 6 cmd */ | 228 | /* send 6 cmd */ |
@@ -240,7 +234,7 @@ static void zte_ev_usb_serial_close(struct usb_serial_port *port) | |||
240 | result = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), | 234 | result = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), |
241 | 0x21, 0xa1, | 235 | 0x21, 0xa1, |
242 | 0x0000, 0x0000, buf, len, | 236 | 0x0000, 0x0000, buf, len, |
243 | HZ * USB_CTRL_GET_TIMEOUT); | 237 | USB_CTRL_GET_TIMEOUT); |
244 | debug_data(dev, __func__, len, buf, result); | 238 | debug_data(dev, __func__, len, buf, result); |
245 | 239 | ||
246 | /* send 7 cmd */ | 240 | /* send 7 cmd */ |
@@ -259,7 +253,7 @@ static void zte_ev_usb_serial_close(struct usb_serial_port *port) | |||
259 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), | 253 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), |
260 | 0x20, 0x21, | 254 | 0x20, 0x21, |
261 | 0x0000, 0x0000, buf, len, | 255 | 0x0000, 0x0000, buf, len, |
262 | HZ * USB_CTRL_GET_TIMEOUT); | 256 | USB_CTRL_GET_TIMEOUT); |
263 | debug_data(dev, __func__, len, buf, result); | 257 | debug_data(dev, __func__, len, buf, result); |
264 | 258 | ||
265 | /* send 8 cmd */ | 259 | /* send 8 cmd */ |
@@ -270,7 +264,7 @@ static void zte_ev_usb_serial_close(struct usb_serial_port *port) | |||
270 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), | 264 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), |
271 | 0x22, 0x21, | 265 | 0x22, 0x21, |
272 | 0x0003, 0x0000, NULL, len, | 266 | 0x0003, 0x0000, NULL, len, |
273 | HZ * USB_CTRL_GET_TIMEOUT); | 267 | USB_CTRL_GET_TIMEOUT); |
274 | dev_dbg(dev, "result = %d\n", result); | 268 | dev_dbg(dev, "result = %d\n", result); |
275 | 269 | ||
276 | kfree(buf); | 270 | kfree(buf); |
@@ -279,11 +273,29 @@ static void zte_ev_usb_serial_close(struct usb_serial_port *port) | |||
279 | } | 273 | } |
280 | 274 | ||
281 | static const struct usb_device_id id_table[] = { | 275 | static const struct usb_device_id id_table[] = { |
282 | { USB_DEVICE(0x19d2, 0xffff) }, /* AC8700 */ | 276 | /* AC8710, AC8710T */ |
283 | { USB_DEVICE(0x19d2, 0xfffe) }, | 277 | { USB_DEVICE_AND_INTERFACE_INFO(0x19d2, 0xffff, 0xff, 0xff, 0xff) }, |
284 | { USB_DEVICE(0x19d2, 0xfffd) }, /* MG880 */ | 278 | /* AC8700 */ |
279 | { USB_DEVICE_AND_INTERFACE_INFO(0x19d2, 0xfffe, 0xff, 0xff, 0xff) }, | ||
280 | /* MG880 */ | ||
281 | { USB_DEVICE(0x19d2, 0xfffd) }, | ||
282 | { USB_DEVICE(0x19d2, 0xfffc) }, | ||
283 | { USB_DEVICE(0x19d2, 0xfffb) }, | ||
284 | /* AC2726, AC8710_V3 */ | ||
285 | { USB_DEVICE_AND_INTERFACE_INFO(0x19d2, 0xfff1, 0xff, 0xff, 0xff) }, | ||
286 | { USB_DEVICE(0x19d2, 0xfff6) }, | ||
287 | { USB_DEVICE(0x19d2, 0xfff7) }, | ||
288 | { USB_DEVICE(0x19d2, 0xfff8) }, | ||
289 | { USB_DEVICE(0x19d2, 0xfff9) }, | ||
290 | { USB_DEVICE(0x19d2, 0xffee) }, | ||
291 | /* AC2716, MC2716 */ | ||
292 | { USB_DEVICE_AND_INTERFACE_INFO(0x19d2, 0xffed, 0xff, 0xff, 0xff) }, | ||
293 | /* AD3812 */ | ||
294 | { USB_DEVICE_AND_INTERFACE_INFO(0x19d2, 0xffeb, 0xff, 0xff, 0xff) }, | ||
295 | { USB_DEVICE(0x19d2, 0xffec) }, | ||
285 | { USB_DEVICE(0x05C6, 0x3197) }, | 296 | { USB_DEVICE(0x05C6, 0x3197) }, |
286 | { USB_DEVICE(0x05C6, 0x6000) }, | 297 | { USB_DEVICE(0x05C6, 0x6000) }, |
298 | { USB_DEVICE(0x05C6, 0x9008) }, | ||
287 | { }, | 299 | { }, |
288 | }; | 300 | }; |
289 | MODULE_DEVICE_TABLE(usb, id_table); | 301 | MODULE_DEVICE_TABLE(usb, id_table); |
diff --git a/drivers/usb/storage/realtek_cr.c b/drivers/usb/storage/realtek_cr.c index 8623577bbbe7..281be56d5648 100644 --- a/drivers/usb/storage/realtek_cr.c +++ b/drivers/usb/storage/realtek_cr.c | |||
@@ -105,8 +105,9 @@ struct rts51x_chip { | |||
105 | int status_len; | 105 | int status_len; |
106 | 106 | ||
107 | u32 flag; | 107 | u32 flag; |
108 | #ifdef CONFIG_REALTEK_AUTOPM | ||
109 | struct us_data *us; | 108 | struct us_data *us; |
109 | |||
110 | #ifdef CONFIG_REALTEK_AUTOPM | ||
110 | struct timer_list rts51x_suspend_timer; | 111 | struct timer_list rts51x_suspend_timer; |
111 | unsigned long timer_expires; | 112 | unsigned long timer_expires; |
112 | int pwr_state; | 113 | int pwr_state; |
@@ -988,6 +989,7 @@ static int init_realtek_cr(struct us_data *us) | |||
988 | us->extra = chip; | 989 | us->extra = chip; |
989 | us->extra_destructor = realtek_cr_destructor; | 990 | us->extra_destructor = realtek_cr_destructor; |
990 | us->max_lun = chip->max_lun = rts51x_get_max_lun(us); | 991 | us->max_lun = chip->max_lun = rts51x_get_max_lun(us); |
992 | chip->us = us; | ||
991 | 993 | ||
992 | usb_stor_dbg(us, "chip->max_lun = %d\n", chip->max_lun); | 994 | usb_stor_dbg(us, "chip->max_lun = %d\n", chip->max_lun); |
993 | 995 | ||
@@ -1010,10 +1012,8 @@ static int init_realtek_cr(struct us_data *us) | |||
1010 | SET_AUTO_DELINK(chip); | 1012 | SET_AUTO_DELINK(chip); |
1011 | } | 1013 | } |
1012 | #ifdef CONFIG_REALTEK_AUTOPM | 1014 | #ifdef CONFIG_REALTEK_AUTOPM |
1013 | if (ss_en) { | 1015 | if (ss_en) |
1014 | chip->us = us; | ||
1015 | realtek_cr_autosuspend_setup(us); | 1016 | realtek_cr_autosuspend_setup(us); |
1016 | } | ||
1017 | #endif | 1017 | #endif |
1018 | 1018 | ||
1019 | usb_stor_dbg(us, "chip->flag = 0x%x\n", chip->flag); | 1019 | usb_stor_dbg(us, "chip->flag = 0x%x\n", chip->flag); |