aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/dwc3/Kconfig1
-rw-r--r--drivers/usb/dwc3/dwc3-pci.c2
-rw-r--r--drivers/usb/dwc3/gadget.c6
-rw-r--r--drivers/usb/gadget/cdc2.c19
-rw-r--r--drivers/usb/gadget/dummy_hcd.c7
-rw-r--r--drivers/usb/gadget/f_ecm.c2
-rw-r--r--drivers/usb/gadget/f_eem.c2
-rw-r--r--drivers/usb/gadget/f_mass_storage.c2
-rw-r--r--drivers/usb/gadget/fotg210-udc.c2
-rw-r--r--drivers/usb/gadget/fusb300_udc.c2
-rw-r--r--drivers/usb/gadget/multi.c8
-rw-r--r--drivers/usb/gadget/mv_u3d_core.c3
-rw-r--r--drivers/usb/gadget/s3c-hsotg.c13
-rw-r--r--drivers/usb/host/ehci-fsl.c2
-rw-r--r--drivers/usb/host/ehci-grlib.c2
-rw-r--r--drivers/usb/host/ehci-hcd.c2
-rw-r--r--drivers/usb/host/ehci-mv.c2
-rw-r--r--drivers/usb/host/ehci-octeon.c2
-rw-r--r--drivers/usb/host/ehci-pmcmsp.c2
-rw-r--r--drivers/usb/host/ehci-ppc-of.c2
-rw-r--r--drivers/usb/host/ehci-ps3.c2
-rw-r--r--drivers/usb/host/ehci-q.c5
-rw-r--r--drivers/usb/host/ehci-sead3.c2
-rw-r--r--drivers/usb/host/ehci-sh.c2
-rw-r--r--drivers/usb/host/ehci-tilegx.c2
-rw-r--r--drivers/usb/host/ehci-w90x900.c2
-rw-r--r--drivers/usb/host/ehci-xilinx-of.c2
-rw-r--r--drivers/usb/host/fsl-mph-dr-of.c6
-rw-r--r--drivers/usb/phy/phy-omap-usb3.c2
-rw-r--r--drivers/usb/serial/Kconfig2
-rw-r--r--drivers/usb/serial/pl2303.c43
31 files changed, 81 insertions, 72 deletions
diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
index b870872e020f..70fc43027a5c 100644
--- a/drivers/usb/dwc3/Kconfig
+++ b/drivers/usb/dwc3/Kconfig
@@ -1,7 +1,6 @@
1config USB_DWC3 1config USB_DWC3
2 tristate "DesignWare USB3 DRD Core Support" 2 tristate "DesignWare USB3 DRD Core Support"
3 depends on (USB || USB_GADGET) && HAS_DMA 3 depends on (USB || USB_GADGET) && HAS_DMA
4 depends on EXTCON
5 select USB_XHCI_PLATFORM if USB_SUPPORT && USB_XHCI_HCD 4 select USB_XHCI_PLATFORM if USB_SUPPORT && USB_XHCI_HCD
6 help 5 help
7 Say Y or M here if your system has a Dual Role SuperSpeed 6 Say Y or M here if your system has a Dual Role SuperSpeed
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
index 9b138129e856..997ebe420bc9 100644
--- a/drivers/usb/dwc3/dwc3-pci.c
+++ b/drivers/usb/dwc3/dwc3-pci.c
@@ -28,6 +28,7 @@
28/* FIXME define these in <linux/pci_ids.h> */ 28/* FIXME define these in <linux/pci_ids.h> */
29#define PCI_VENDOR_ID_SYNOPSYS 0x16c3 29#define PCI_VENDOR_ID_SYNOPSYS 0x16c3
30#define PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3 0xabcd 30#define PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3 0xabcd
31#define PCI_DEVICE_ID_INTEL_BYT 0x0f37
31 32
32struct dwc3_pci { 33struct dwc3_pci {
33 struct device *dev; 34 struct device *dev;
@@ -187,6 +188,7 @@ static DEFINE_PCI_DEVICE_TABLE(dwc3_pci_id_table) = {
187 PCI_DEVICE(PCI_VENDOR_ID_SYNOPSYS, 188 PCI_DEVICE(PCI_VENDOR_ID_SYNOPSYS,
188 PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3), 189 PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3),
189 }, 190 },
191 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BYT), },
190 { } /* Terminating Entry */ 192 { } /* Terminating Entry */
191}; 193};
192MODULE_DEVICE_TABLE(pci, dwc3_pci_id_table); 194MODULE_DEVICE_TABLE(pci, dwc3_pci_id_table);
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index f168eaebdef8..5452c0fce360 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2611,15 +2611,13 @@ int dwc3_gadget_init(struct dwc3 *dwc)
2611 ret = usb_add_gadget_udc(dwc->dev, &dwc->gadget); 2611 ret = usb_add_gadget_udc(dwc->dev, &dwc->gadget);
2612 if (ret) { 2612 if (ret) {
2613 dev_err(dwc->dev, "failed to register udc\n"); 2613 dev_err(dwc->dev, "failed to register udc\n");
2614 goto err5; 2614 goto err4;
2615 } 2615 }
2616 2616
2617 return 0; 2617 return 0;
2618 2618
2619err5:
2620 dwc3_gadget_free_endpoints(dwc);
2621
2622err4: 2619err4:
2620 dwc3_gadget_free_endpoints(dwc);
2623 dma_free_coherent(dwc->dev, DWC3_EP0_BOUNCE_SIZE, 2621 dma_free_coherent(dwc->dev, DWC3_EP0_BOUNCE_SIZE,
2624 dwc->ep0_bounce, dwc->ep0_bounce_addr); 2622 dwc->ep0_bounce, dwc->ep0_bounce_addr);
2625 2623
diff --git a/drivers/usb/gadget/cdc2.c b/drivers/usb/gadget/cdc2.c
index 5a5acf22c694..e126b6b248e6 100644
--- a/drivers/usb/gadget/cdc2.c
+++ b/drivers/usb/gadget/cdc2.c
@@ -113,12 +113,6 @@ static int __init cdc_do_config(struct usb_configuration *c)
113 c->bmAttributes |= USB_CONFIG_ATT_WAKEUP; 113 c->bmAttributes |= USB_CONFIG_ATT_WAKEUP;
114 } 114 }
115 115
116 fi_ecm = usb_get_function_instance("ecm");
117 if (IS_ERR(fi_ecm)) {
118 status = PTR_ERR(fi_ecm);
119 goto err_func_ecm;
120 }
121
122 f_ecm = usb_get_function(fi_ecm); 116 f_ecm = usb_get_function(fi_ecm);
123 if (IS_ERR(f_ecm)) { 117 if (IS_ERR(f_ecm)) {
124 status = PTR_ERR(f_ecm); 118 status = PTR_ERR(f_ecm);
@@ -129,35 +123,24 @@ static int __init cdc_do_config(struct usb_configuration *c)
129 if (status) 123 if (status)
130 goto err_add_ecm; 124 goto err_add_ecm;
131 125
132 fi_serial = usb_get_function_instance("acm");
133 if (IS_ERR(fi_serial)) {
134 status = PTR_ERR(fi_serial);
135 goto err_get_acm;
136 }
137
138 f_acm = usb_get_function(fi_serial); 126 f_acm = usb_get_function(fi_serial);
139 if (IS_ERR(f_acm)) { 127 if (IS_ERR(f_acm)) {
140 status = PTR_ERR(f_acm); 128 status = PTR_ERR(f_acm);
141 goto err_func_acm; 129 goto err_get_acm;
142 } 130 }
143 131
144 status = usb_add_function(c, f_acm); 132 status = usb_add_function(c, f_acm);
145 if (status) 133 if (status)
146 goto err_add_acm; 134 goto err_add_acm;
147
148 return 0; 135 return 0;
149 136
150err_add_acm: 137err_add_acm:
151 usb_put_function(f_acm); 138 usb_put_function(f_acm);
152err_func_acm:
153 usb_put_function_instance(fi_serial);
154err_get_acm: 139err_get_acm:
155 usb_remove_function(c, f_ecm); 140 usb_remove_function(c, f_ecm);
156err_add_ecm: 141err_add_ecm:
157 usb_put_function(f_ecm); 142 usb_put_function(f_ecm);
158err_get_ecm: 143err_get_ecm:
159 usb_put_function_instance(fi_ecm);
160err_func_ecm:
161 return status; 144 return status;
162} 145}
163 146
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index 06ecd08fd57a..b8a2376971a4 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -923,8 +923,9 @@ static int dummy_udc_stop(struct usb_gadget *g,
923 struct dummy_hcd *dum_hcd = gadget_to_dummy_hcd(g); 923 struct dummy_hcd *dum_hcd = gadget_to_dummy_hcd(g);
924 struct dummy *dum = dum_hcd->dum; 924 struct dummy *dum = dum_hcd->dum;
925 925
926 dev_dbg(udc_dev(dum), "unregister gadget driver '%s'\n", 926 if (driver)
927 driver->driver.name); 927 dev_dbg(udc_dev(dum), "unregister gadget driver '%s'\n",
928 driver->driver.name);
928 929
929 dum->driver = NULL; 930 dum->driver = NULL;
930 931
@@ -1000,8 +1001,8 @@ static int dummy_udc_remove(struct platform_device *pdev)
1000{ 1001{
1001 struct dummy *dum = platform_get_drvdata(pdev); 1002 struct dummy *dum = platform_get_drvdata(pdev);
1002 1003
1003 usb_del_gadget_udc(&dum->gadget);
1004 device_remove_file(&dum->gadget.dev, &dev_attr_function); 1004 device_remove_file(&dum->gadget.dev, &dev_attr_function);
1005 usb_del_gadget_udc(&dum->gadget);
1005 return 0; 1006 return 0;
1006} 1007}
1007 1008
diff --git a/drivers/usb/gadget/f_ecm.c b/drivers/usb/gadget/f_ecm.c
index edab45da3741..8d9e6f7e8f1a 100644
--- a/drivers/usb/gadget/f_ecm.c
+++ b/drivers/usb/gadget/f_ecm.c
@@ -995,7 +995,7 @@ static void ecm_unbind(struct usb_configuration *c, struct usb_function *f)
995 usb_ep_free_request(ecm->notify, ecm->notify_req); 995 usb_ep_free_request(ecm->notify, ecm->notify_req);
996} 996}
997 997
998struct usb_function *ecm_alloc(struct usb_function_instance *fi) 998static struct usb_function *ecm_alloc(struct usb_function_instance *fi)
999{ 999{
1000 struct f_ecm *ecm; 1000 struct f_ecm *ecm;
1001 struct f_ecm_opts *opts; 1001 struct f_ecm_opts *opts;
diff --git a/drivers/usb/gadget/f_eem.c b/drivers/usb/gadget/f_eem.c
index d00392d879db..d61c11d765d0 100644
--- a/drivers/usb/gadget/f_eem.c
+++ b/drivers/usb/gadget/f_eem.c
@@ -624,7 +624,7 @@ static void eem_unbind(struct usb_configuration *c, struct usb_function *f)
624 usb_free_all_descriptors(f); 624 usb_free_all_descriptors(f);
625} 625}
626 626
627struct usb_function *eem_alloc(struct usb_function_instance *fi) 627static struct usb_function *eem_alloc(struct usb_function_instance *fi)
628{ 628{
629 struct f_eem *eem; 629 struct f_eem *eem;
630 struct f_eem_opts *opts; 630 struct f_eem_opts *opts;
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index 313b835eedfd..a01d7d38c016 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -2260,10 +2260,12 @@ reset:
2260 /* Disable the endpoints */ 2260 /* Disable the endpoints */
2261 if (fsg->bulk_in_enabled) { 2261 if (fsg->bulk_in_enabled) {
2262 usb_ep_disable(fsg->bulk_in); 2262 usb_ep_disable(fsg->bulk_in);
2263 fsg->bulk_in->driver_data = NULL;
2263 fsg->bulk_in_enabled = 0; 2264 fsg->bulk_in_enabled = 0;
2264 } 2265 }
2265 if (fsg->bulk_out_enabled) { 2266 if (fsg->bulk_out_enabled) {
2266 usb_ep_disable(fsg->bulk_out); 2267 usb_ep_disable(fsg->bulk_out);
2268 fsg->bulk_out->driver_data = NULL;
2267 fsg->bulk_out_enabled = 0; 2269 fsg->bulk_out_enabled = 0;
2268 } 2270 }
2269 2271
diff --git a/drivers/usb/gadget/fotg210-udc.c b/drivers/usb/gadget/fotg210-udc.c
index 32db2eee2d87..bbbfd1948778 100644
--- a/drivers/usb/gadget/fotg210-udc.c
+++ b/drivers/usb/gadget/fotg210-udc.c
@@ -1214,6 +1214,6 @@ static struct platform_driver fotg210_driver = {
1214 1214
1215module_platform_driver(fotg210_driver); 1215module_platform_driver(fotg210_driver);
1216 1216
1217MODULE_AUTHOR("Yuan-Hsin Chen <yhchen@faraday-tech.com>"); 1217MODULE_AUTHOR("Yuan-Hsin Chen, Feng-Hsin Chiang <john453@faraday-tech.com>");
1218MODULE_LICENSE("GPL"); 1218MODULE_LICENSE("GPL");
1219MODULE_DESCRIPTION(DRIVER_DESC); 1219MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/gadget/fusb300_udc.c b/drivers/usb/gadget/fusb300_udc.c
index f1dd6daabe21..b278abe52453 100644
--- a/drivers/usb/gadget/fusb300_udc.c
+++ b/drivers/usb/gadget/fusb300_udc.c
@@ -22,7 +22,7 @@
22 22
23MODULE_DESCRIPTION("FUSB300 USB gadget driver"); 23MODULE_DESCRIPTION("FUSB300 USB gadget driver");
24MODULE_LICENSE("GPL"); 24MODULE_LICENSE("GPL");
25MODULE_AUTHOR("Yuan Hsin Chen <yhchen@faraday-tech.com>"); 25MODULE_AUTHOR("Yuan-Hsin Chen, Feng-Hsin Chiang <john453@faraday-tech.com>");
26MODULE_ALIAS("platform:fusb300_udc"); 26MODULE_ALIAS("platform:fusb300_udc");
27 27
28#define DRIVER_VERSION "20 October 2010" 28#define DRIVER_VERSION "20 October 2010"
diff --git a/drivers/usb/gadget/multi.c b/drivers/usb/gadget/multi.c
index 2a1ebefd8f9e..23393254a8a3 100644
--- a/drivers/usb/gadget/multi.c
+++ b/drivers/usb/gadget/multi.c
@@ -179,7 +179,7 @@ err_conf:
179 return ret; 179 return ret;
180} 180}
181 181
182static int rndis_config_register(struct usb_composite_dev *cdev) 182static __ref int rndis_config_register(struct usb_composite_dev *cdev)
183{ 183{
184 static struct usb_configuration config = { 184 static struct usb_configuration config = {
185 .bConfigurationValue = MULTI_RNDIS_CONFIG_NUM, 185 .bConfigurationValue = MULTI_RNDIS_CONFIG_NUM,
@@ -194,7 +194,7 @@ static int rndis_config_register(struct usb_composite_dev *cdev)
194 194
195#else 195#else
196 196
197static int rndis_config_register(struct usb_composite_dev *cdev) 197static __ref int rndis_config_register(struct usb_composite_dev *cdev)
198{ 198{
199 return 0; 199 return 0;
200} 200}
@@ -241,7 +241,7 @@ err_conf:
241 return ret; 241 return ret;
242} 242}
243 243
244static int cdc_config_register(struct usb_composite_dev *cdev) 244static __ref int cdc_config_register(struct usb_composite_dev *cdev)
245{ 245{
246 static struct usb_configuration config = { 246 static struct usb_configuration config = {
247 .bConfigurationValue = MULTI_CDC_CONFIG_NUM, 247 .bConfigurationValue = MULTI_CDC_CONFIG_NUM,
@@ -256,7 +256,7 @@ static int cdc_config_register(struct usb_composite_dev *cdev)
256 256
257#else 257#else
258 258
259static int cdc_config_register(struct usb_composite_dev *cdev) 259static __ref int cdc_config_register(struct usb_composite_dev *cdev)
260{ 260{
261 return 0; 261 return 0;
262} 262}
diff --git a/drivers/usb/gadget/mv_u3d_core.c b/drivers/usb/gadget/mv_u3d_core.c
index bbb6e98c4384..561b30efb8ee 100644
--- a/drivers/usb/gadget/mv_u3d_core.c
+++ b/drivers/usb/gadget/mv_u3d_core.c
@@ -645,6 +645,7 @@ static int mv_u3d_ep_disable(struct usb_ep *_ep)
645 struct mv_u3d_ep *ep; 645 struct mv_u3d_ep *ep;
646 struct mv_u3d_ep_context *ep_context; 646 struct mv_u3d_ep_context *ep_context;
647 u32 epxcr, direction; 647 u32 epxcr, direction;
648 unsigned long flags;
648 649
649 if (!_ep) 650 if (!_ep)
650 return -EINVAL; 651 return -EINVAL;
@@ -661,7 +662,9 @@ static int mv_u3d_ep_disable(struct usb_ep *_ep)
661 direction = mv_u3d_ep_dir(ep); 662 direction = mv_u3d_ep_dir(ep);
662 663
663 /* nuke all pending requests (does flush) */ 664 /* nuke all pending requests (does flush) */
665 spin_lock_irqsave(&u3d->lock, flags);
664 mv_u3d_nuke(ep, -ESHUTDOWN); 666 mv_u3d_nuke(ep, -ESHUTDOWN);
667 spin_unlock_irqrestore(&u3d->lock, flags);
665 668
666 /* Disable the endpoint for Rx or Tx and reset the endpoint type */ 669 /* Disable the endpoint for Rx or Tx and reset the endpoint type */
667 if (direction == MV_U3D_EP_DIR_OUT) { 670 if (direction == MV_U3D_EP_DIR_OUT) {
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c
index d69b36a99dbc..6bddf1aa2347 100644
--- a/drivers/usb/gadget/s3c-hsotg.c
+++ b/drivers/usb/gadget/s3c-hsotg.c
@@ -2475,8 +2475,6 @@ irq_retry:
2475 if (gintsts & GINTSTS_ErlySusp) { 2475 if (gintsts & GINTSTS_ErlySusp) {
2476 dev_dbg(hsotg->dev, "GINTSTS_ErlySusp\n"); 2476 dev_dbg(hsotg->dev, "GINTSTS_ErlySusp\n");
2477 writel(GINTSTS_ErlySusp, hsotg->regs + GINTSTS); 2477 writel(GINTSTS_ErlySusp, hsotg->regs + GINTSTS);
2478
2479 s3c_hsotg_disconnect(hsotg);
2480 } 2478 }
2481 2479
2482 /* 2480 /*
@@ -2962,9 +2960,6 @@ static int s3c_hsotg_udc_stop(struct usb_gadget *gadget,
2962 if (!hsotg) 2960 if (!hsotg)
2963 return -ENODEV; 2961 return -ENODEV;
2964 2962
2965 if (!driver || driver != hsotg->driver || !driver->unbind)
2966 return -EINVAL;
2967
2968 /* all endpoints should be shutdown */ 2963 /* all endpoints should be shutdown */
2969 for (ep = 0; ep < hsotg->num_of_eps; ep++) 2964 for (ep = 0; ep < hsotg->num_of_eps; ep++)
2970 s3c_hsotg_ep_disable(&hsotg->eps[ep].ep); 2965 s3c_hsotg_ep_disable(&hsotg->eps[ep].ep);
@@ -2972,15 +2967,15 @@ static int s3c_hsotg_udc_stop(struct usb_gadget *gadget,
2972 spin_lock_irqsave(&hsotg->lock, flags); 2967 spin_lock_irqsave(&hsotg->lock, flags);
2973 2968
2974 s3c_hsotg_phy_disable(hsotg); 2969 s3c_hsotg_phy_disable(hsotg);
2975 regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies), hsotg->supplies);
2976 2970
2977 hsotg->driver = NULL; 2971 if (!driver)
2972 hsotg->driver = NULL;
2973
2978 hsotg->gadget.speed = USB_SPEED_UNKNOWN; 2974 hsotg->gadget.speed = USB_SPEED_UNKNOWN;
2979 2975
2980 spin_unlock_irqrestore(&hsotg->lock, flags); 2976 spin_unlock_irqrestore(&hsotg->lock, flags);
2981 2977
2982 dev_info(hsotg->dev, "unregistered gadget driver '%s'\n", 2978 regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies), hsotg->supplies);
2983 driver->driver.name);
2984 2979
2985 return 0; 2980 return 0;
2986} 2981}
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index e41cfdc9bf93..848fc46ad80c 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -669,7 +669,7 @@ static const struct hc_driver ehci_fsl_hc_driver = {
669 * generic hardware linkage 669 * generic hardware linkage
670 */ 670 */
671 .irq = ehci_irq, 671 .irq = ehci_irq,
672 .flags = HCD_USB2 | HCD_MEMORY | HCD_BH, 672 .flags = HCD_USB2 | HCD_MEMORY,
673 673
674 /* 674 /*
675 * basic lifecycle operations 675 * basic lifecycle operations
diff --git a/drivers/usb/host/ehci-grlib.c b/drivers/usb/host/ehci-grlib.c
index b52a66ce92e8..83ab51af250f 100644
--- a/drivers/usb/host/ehci-grlib.c
+++ b/drivers/usb/host/ehci-grlib.c
@@ -43,7 +43,7 @@ static const struct hc_driver ehci_grlib_hc_driver = {
43 * generic hardware linkage 43 * generic hardware linkage
44 */ 44 */
45 .irq = ehci_irq, 45 .irq = ehci_irq,
46 .flags = HCD_MEMORY | HCD_USB2 | HCD_BH, 46 .flags = HCD_MEMORY | HCD_USB2,
47 47
48 /* 48 /*
49 * basic lifecycle operations 49 * basic lifecycle operations
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 5d6022f30ebe..86ab9fd9fe9e 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1158,7 +1158,7 @@ static const struct hc_driver ehci_hc_driver = {
1158 * generic hardware linkage 1158 * generic hardware linkage
1159 */ 1159 */
1160 .irq = ehci_irq, 1160 .irq = ehci_irq,
1161 .flags = HCD_MEMORY | HCD_USB2 | HCD_BH, 1161 .flags = HCD_MEMORY | HCD_USB2,
1162 1162
1163 /* 1163 /*
1164 * basic lifecycle operations 1164 * basic lifecycle operations
diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c
index 417c10da9450..35cdbd88bbbe 100644
--- a/drivers/usb/host/ehci-mv.c
+++ b/drivers/usb/host/ehci-mv.c
@@ -96,7 +96,7 @@ static const struct hc_driver mv_ehci_hc_driver = {
96 * generic hardware linkage 96 * generic hardware linkage
97 */ 97 */
98 .irq = ehci_irq, 98 .irq = ehci_irq,
99 .flags = HCD_MEMORY | HCD_USB2 | HCD_BH, 99 .flags = HCD_MEMORY | HCD_USB2,
100 100
101 /* 101 /*
102 * basic lifecycle operations 102 * basic lifecycle operations
diff --git a/drivers/usb/host/ehci-octeon.c b/drivers/usb/host/ehci-octeon.c
index ab0397e4d8f3..45cc00158412 100644
--- a/drivers/usb/host/ehci-octeon.c
+++ b/drivers/usb/host/ehci-octeon.c
@@ -51,7 +51,7 @@ static const struct hc_driver ehci_octeon_hc_driver = {
51 * generic hardware linkage 51 * generic hardware linkage
52 */ 52 */
53 .irq = ehci_irq, 53 .irq = ehci_irq,
54 .flags = HCD_MEMORY | HCD_USB2 | HCD_BH, 54 .flags = HCD_MEMORY | HCD_USB2,
55 55
56 /* 56 /*
57 * basic lifecycle operations 57 * basic lifecycle operations
diff --git a/drivers/usb/host/ehci-pmcmsp.c b/drivers/usb/host/ehci-pmcmsp.c
index 893b707f0000..601e208bd782 100644
--- a/drivers/usb/host/ehci-pmcmsp.c
+++ b/drivers/usb/host/ehci-pmcmsp.c
@@ -286,7 +286,7 @@ static const struct hc_driver ehci_msp_hc_driver = {
286#else 286#else
287 .irq = ehci_irq, 287 .irq = ehci_irq,
288#endif 288#endif
289 .flags = HCD_MEMORY | HCD_USB2 | HCD_BH, 289 .flags = HCD_MEMORY | HCD_USB2,
290 290
291 /* 291 /*
292 * basic lifecycle operations 292 * basic lifecycle operations
diff --git a/drivers/usb/host/ehci-ppc-of.c b/drivers/usb/host/ehci-ppc-of.c
index 6cc5567bf9c8..932293fa32de 100644
--- a/drivers/usb/host/ehci-ppc-of.c
+++ b/drivers/usb/host/ehci-ppc-of.c
@@ -28,7 +28,7 @@ static const struct hc_driver ehci_ppc_of_hc_driver = {
28 * generic hardware linkage 28 * generic hardware linkage
29 */ 29 */
30 .irq = ehci_irq, 30 .irq = ehci_irq,
31 .flags = HCD_MEMORY | HCD_USB2 | HCD_BH, 31 .flags = HCD_MEMORY | HCD_USB2,
32 32
33 /* 33 /*
34 * basic lifecycle operations 34 * basic lifecycle operations
diff --git a/drivers/usb/host/ehci-ps3.c b/drivers/usb/host/ehci-ps3.c
index 8188542ba17e..fd983771b025 100644
--- a/drivers/usb/host/ehci-ps3.c
+++ b/drivers/usb/host/ehci-ps3.c
@@ -71,7 +71,7 @@ static const struct hc_driver ps3_ehci_hc_driver = {
71 .product_desc = "PS3 EHCI Host Controller", 71 .product_desc = "PS3 EHCI Host Controller",
72 .hcd_priv_size = sizeof(struct ehci_hcd), 72 .hcd_priv_size = sizeof(struct ehci_hcd),
73 .irq = ehci_irq, 73 .irq = ehci_irq,
74 .flags = HCD_MEMORY | HCD_USB2 | HCD_BH, 74 .flags = HCD_MEMORY | HCD_USB2,
75 .reset = ps3_ehci_hc_reset, 75 .reset = ps3_ehci_hc_reset,
76 .start = ehci_run, 76 .start = ehci_run,
77 .stop = ehci_stop, 77 .stop = ehci_stop,
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
index e321804c3475..a7f776a13eb1 100644
--- a/drivers/usb/host/ehci-q.c
+++ b/drivers/usb/host/ehci-q.c
@@ -247,6 +247,8 @@ static int qtd_copy_status (
247 247
248static void 248static void
249ehci_urb_done(struct ehci_hcd *ehci, struct urb *urb, int status) 249ehci_urb_done(struct ehci_hcd *ehci, struct urb *urb, int status)
250__releases(ehci->lock)
251__acquires(ehci->lock)
250{ 252{
251 if (usb_pipetype(urb->pipe) == PIPE_INTERRUPT) { 253 if (usb_pipetype(urb->pipe) == PIPE_INTERRUPT) {
252 /* ... update hc-wide periodic stats */ 254 /* ... update hc-wide periodic stats */
@@ -272,8 +274,11 @@ ehci_urb_done(struct ehci_hcd *ehci, struct urb *urb, int status)
272 urb->actual_length, urb->transfer_buffer_length); 274 urb->actual_length, urb->transfer_buffer_length);
273#endif 275#endif
274 276
277 /* complete() can reenter this HCD */
275 usb_hcd_unlink_urb_from_ep(ehci_to_hcd(ehci), urb); 278 usb_hcd_unlink_urb_from_ep(ehci_to_hcd(ehci), urb);
279 spin_unlock (&ehci->lock);
276 usb_hcd_giveback_urb(ehci_to_hcd(ehci), urb, status); 280 usb_hcd_giveback_urb(ehci_to_hcd(ehci), urb, status);
281 spin_lock (&ehci->lock);
277} 282}
278 283
279static int qh_schedule (struct ehci_hcd *ehci, struct ehci_qh *qh); 284static int qh_schedule (struct ehci_hcd *ehci, struct ehci_qh *qh);
diff --git a/drivers/usb/host/ehci-sead3.c b/drivers/usb/host/ehci-sead3.c
index 8a734498079b..b2de52d39614 100644
--- a/drivers/usb/host/ehci-sead3.c
+++ b/drivers/usb/host/ehci-sead3.c
@@ -55,7 +55,7 @@ const struct hc_driver ehci_sead3_hc_driver = {
55 * generic hardware linkage 55 * generic hardware linkage
56 */ 56 */
57 .irq = ehci_irq, 57 .irq = ehci_irq,
58 .flags = HCD_MEMORY | HCD_USB2 | HCD_BH, 58 .flags = HCD_MEMORY | HCD_USB2,
59 59
60 /* 60 /*
61 * basic lifecycle operations 61 * basic lifecycle operations
diff --git a/drivers/usb/host/ehci-sh.c b/drivers/usb/host/ehci-sh.c
index dc899eb2b861..93e59a13bc1f 100644
--- a/drivers/usb/host/ehci-sh.c
+++ b/drivers/usb/host/ehci-sh.c
@@ -36,7 +36,7 @@ static const struct hc_driver ehci_sh_hc_driver = {
36 * generic hardware linkage 36 * generic hardware linkage
37 */ 37 */
38 .irq = ehci_irq, 38 .irq = ehci_irq,
39 .flags = HCD_USB2 | HCD_MEMORY | HCD_BH, 39 .flags = HCD_USB2 | HCD_MEMORY,
40 40
41 /* 41 /*
42 * basic lifecycle operations 42 * basic lifecycle operations
diff --git a/drivers/usb/host/ehci-tilegx.c b/drivers/usb/host/ehci-tilegx.c
index 67026ffbf9a8..cca4be90a864 100644
--- a/drivers/usb/host/ehci-tilegx.c
+++ b/drivers/usb/host/ehci-tilegx.c
@@ -61,7 +61,7 @@ static const struct hc_driver ehci_tilegx_hc_driver = {
61 * Generic hardware linkage. 61 * Generic hardware linkage.
62 */ 62 */
63 .irq = ehci_irq, 63 .irq = ehci_irq,
64 .flags = HCD_MEMORY | HCD_USB2 | HCD_BH, 64 .flags = HCD_MEMORY | HCD_USB2,
65 65
66 /* 66 /*
67 * Basic lifecycle operations. 67 * Basic lifecycle operations.
diff --git a/drivers/usb/host/ehci-w90x900.c b/drivers/usb/host/ehci-w90x900.c
index 1c370dfbee0d..59e0e24c753f 100644
--- a/drivers/usb/host/ehci-w90x900.c
+++ b/drivers/usb/host/ehci-w90x900.c
@@ -108,7 +108,7 @@ static const struct hc_driver ehci_w90x900_hc_driver = {
108 * generic hardware linkage 108 * generic hardware linkage
109 */ 109 */
110 .irq = ehci_irq, 110 .irq = ehci_irq,
111 .flags = HCD_USB2|HCD_MEMORY|HCD_BH, 111 .flags = HCD_USB2|HCD_MEMORY,
112 112
113 /* 113 /*
114 * basic lifecycle operations 114 * basic lifecycle operations
diff --git a/drivers/usb/host/ehci-xilinx-of.c b/drivers/usb/host/ehci-xilinx-of.c
index 95979f9f4381..eba962e6ebfb 100644
--- a/drivers/usb/host/ehci-xilinx-of.c
+++ b/drivers/usb/host/ehci-xilinx-of.c
@@ -79,7 +79,7 @@ static const struct hc_driver ehci_xilinx_of_hc_driver = {
79 * generic hardware linkage 79 * generic hardware linkage
80 */ 80 */
81 .irq = ehci_irq, 81 .irq = ehci_irq,
82 .flags = HCD_MEMORY | HCD_USB2 | HCD_BH, 82 .flags = HCD_MEMORY | HCD_USB2,
83 83
84 /* 84 /*
85 * basic lifecycle operations 85 * basic lifecycle operations
diff --git a/drivers/usb/host/fsl-mph-dr-of.c b/drivers/usb/host/fsl-mph-dr-of.c
index 9e0020d9e4c8..abd5050a4899 100644
--- a/drivers/usb/host/fsl-mph-dr-of.c
+++ b/drivers/usb/host/fsl-mph-dr-of.c
@@ -24,7 +24,7 @@ struct fsl_usb2_dev_data {
24 enum fsl_usb2_operating_modes op_mode; /* operating mode */ 24 enum fsl_usb2_operating_modes op_mode; /* operating mode */
25}; 25};
26 26
27struct fsl_usb2_dev_data dr_mode_data[] = { 27static struct fsl_usb2_dev_data dr_mode_data[] = {
28 { 28 {
29 .dr_mode = "host", 29 .dr_mode = "host",
30 .drivers = { "fsl-ehci", NULL, NULL, }, 30 .drivers = { "fsl-ehci", NULL, NULL, },
@@ -42,7 +42,7 @@ struct fsl_usb2_dev_data dr_mode_data[] = {
42 }, 42 },
43}; 43};
44 44
45struct fsl_usb2_dev_data *get_dr_mode_data(struct device_node *np) 45static struct fsl_usb2_dev_data *get_dr_mode_data(struct device_node *np)
46{ 46{
47 const unsigned char *prop; 47 const unsigned char *prop;
48 int i; 48 int i;
@@ -75,7 +75,7 @@ static enum fsl_usb2_phy_modes determine_usb_phy(const char *phy_type)
75 return FSL_USB2_PHY_NONE; 75 return FSL_USB2_PHY_NONE;
76} 76}
77 77
78struct platform_device *fsl_usb2_device_register( 78static struct platform_device *fsl_usb2_device_register(
79 struct platform_device *ofdev, 79 struct platform_device *ofdev,
80 struct fsl_usb2_platform_data *pdata, 80 struct fsl_usb2_platform_data *pdata,
81 const char *name, int id) 81 const char *name, int id)
diff --git a/drivers/usb/phy/phy-omap-usb3.c b/drivers/usb/phy/phy-omap-usb3.c
index fc15694d3031..4e8a0405f956 100644
--- a/drivers/usb/phy/phy-omap-usb3.c
+++ b/drivers/usb/phy/phy-omap-usb3.c
@@ -79,7 +79,7 @@ static struct usb_dpll_params *omap_usb3_get_dpll_params(unsigned long rate)
79 return &dpll_map[i].params; 79 return &dpll_map[i].params;
80 } 80 }
81 81
82 return 0; 82 return NULL;
83} 83}
84 84
85static int omap_usb3_suspend(struct usb_phy *x, int suspend) 85static int omap_usb3_suspend(struct usb_phy *x, int suspend)
diff --git a/drivers/usb/serial/Kconfig b/drivers/usb/serial/Kconfig
index c454bfa22a10..ddb9c51f2c99 100644
--- a/drivers/usb/serial/Kconfig
+++ b/drivers/usb/serial/Kconfig
@@ -60,7 +60,7 @@ config USB_SERIAL_SIMPLE
60 - Suunto ANT+ USB device. 60 - Suunto ANT+ USB device.
61 - Fundamental Software dongle. 61 - Fundamental Software dongle.
62 - HP4x calculators 62 - HP4x calculators
63 - a number of Motoroloa phones 63 - a number of Motorola phones
64 - Siemens USB/MPI adapter. 64 - Siemens USB/MPI adapter.
65 - ViVOtech ViVOpay USB device. 65 - ViVOtech ViVOpay USB device.
66 - Infineon Modem Flashloader USB interface 66 - Infineon Modem Flashloader USB interface
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index e7a84f0f5179..bedf8e47713b 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -139,6 +139,7 @@ enum pl2303_type {
139 HX_TA, /* HX(A) / X(A) / TA version */ /* TODO: improve */ 139 HX_TA, /* HX(A) / X(A) / TA version */ /* TODO: improve */
140 HXD_EA_RA_SA, /* HXD / EA / RA / SA version */ /* TODO: improve */ 140 HXD_EA_RA_SA, /* HXD / EA / RA / SA version */ /* TODO: improve */
141 TB, /* TB version */ 141 TB, /* TB version */
142 HX_CLONE, /* Cheap and less functional clone of the HX chip */
142}; 143};
143/* 144/*
144 * NOTE: don't know the difference between type 0 and type 1, 145 * NOTE: don't know the difference between type 0 and type 1,
@@ -206,8 +207,23 @@ static int pl2303_startup(struct usb_serial *serial)
206 * the device descriptors of the X/HX, HXD, EA, RA, SA, TA, TB 207 * the device descriptors of the X/HX, HXD, EA, RA, SA, TA, TB
207 */ 208 */
208 if (le16_to_cpu(serial->dev->descriptor.bcdDevice) == 0x300) { 209 if (le16_to_cpu(serial->dev->descriptor.bcdDevice) == 0x300) {
209 type = HX_TA; 210 /* Check if the device is a clone */
210 type_str = "X/HX/TA"; 211 pl2303_vendor_read(0x9494, 0, serial, buf);
212 /*
213 * NOTE: Not sure if this read is really needed.
214 * The HX returns 0x00, the clone 0x02, but the Windows
215 * driver seems to ignore the value and continues.
216 */
217 pl2303_vendor_write(0x0606, 0xaa, serial);
218 pl2303_vendor_read(0x8686, 0, serial, buf);
219 if (buf[0] != 0xaa) {
220 type = HX_CLONE;
221 type_str = "X/HX clone (limited functionality)";
222 } else {
223 type = HX_TA;
224 type_str = "X/HX/TA";
225 }
226 pl2303_vendor_write(0x0606, 0x00, serial);
211 } else if (le16_to_cpu(serial->dev->descriptor.bcdDevice) 227 } else if (le16_to_cpu(serial->dev->descriptor.bcdDevice)
212 == 0x400) { 228 == 0x400) {
213 type = HXD_EA_RA_SA; 229 type = HXD_EA_RA_SA;
@@ -305,8 +321,9 @@ static int pl2303_baudrate_encode_direct(int baud, enum pl2303_type type,
305{ 321{
306 /* 322 /*
307 * NOTE: Only the values defined in baud_sup are supported ! 323 * NOTE: Only the values defined in baud_sup are supported !
308 * => if unsupported values are set, the PL2303 seems to 324 * => if unsupported values are set, the PL2303 uses 9600 baud instead
309 * use 9600 baud (at least my PL2303X always does) 325 * => HX clones just don't work at unsupported baud rates < 115200 baud,
326 * for baud rates > 115200 they run at 115200 baud
310 */ 327 */
311 const int baud_sup[] = { 75, 150, 300, 600, 1200, 1800, 2400, 3600, 328 const int baud_sup[] = { 75, 150, 300, 600, 1200, 1800, 2400, 3600,
312 4800, 7200, 9600, 14400, 19200, 28800, 38400, 329 4800, 7200, 9600, 14400, 19200, 28800, 38400,
@@ -316,14 +333,14 @@ static int pl2303_baudrate_encode_direct(int baud, enum pl2303_type type,
316 * NOTE: With the exception of type_0/1 devices, the following 333 * NOTE: With the exception of type_0/1 devices, the following
317 * additional baud rates are supported (tested with HX rev. 3A only): 334 * additional baud rates are supported (tested with HX rev. 3A only):
318 * 110*, 56000*, 128000, 134400, 161280, 201600, 256000*, 268800, 335 * 110*, 56000*, 128000, 134400, 161280, 201600, 256000*, 268800,
319 * 403200, 806400. (*: not HX) 336 * 403200, 806400. (*: not HX and HX clones)
320 * 337 *
321 * Maximum values: HXD, TB: 12000000; HX, TA: 6000000; 338 * Maximum values: HXD, TB: 12000000; HX, TA: 6000000;
322 * type_0+1: 1228800; RA: 921600; SA: 115200 339 * type_0+1: 1228800; RA: 921600; HX clones, SA: 115200
323 * 340 *
324 * As long as we are not using this encoding method for anything else 341 * As long as we are not using this encoding method for anything else
325 * than the type_0+1 and HX chips, there is no point in complicating 342 * than the type_0+1, HX and HX clone chips, there is no point in
326 * the code to support them. 343 * complicating the code to support them.
327 */ 344 */
328 int i; 345 int i;
329 346
@@ -347,6 +364,8 @@ static int pl2303_baudrate_encode_direct(int baud, enum pl2303_type type,
347 baud = min_t(int, baud, 6000000); 364 baud = min_t(int, baud, 6000000);
348 else if (type == type_0 || type == type_1) 365 else if (type == type_0 || type == type_1)
349 baud = min_t(int, baud, 1228800); 366 baud = min_t(int, baud, 1228800);
367 else if (type == HX_CLONE)
368 baud = min_t(int, baud, 115200);
350 /* Direct (standard) baud rate encoding method */ 369 /* Direct (standard) baud rate encoding method */
351 put_unaligned_le32(baud, buf); 370 put_unaligned_le32(baud, buf);
352 371
@@ -359,7 +378,8 @@ static int pl2303_baudrate_encode_divisor(int baud, enum pl2303_type type,
359 /* 378 /*
360 * Divisor based baud rate encoding method 379 * Divisor based baud rate encoding method
361 * 380 *
362 * NOTE: it's not clear if the type_0/1 chips support this method 381 * NOTE: HX clones do NOT support this method.
382 * It's not clear if the type_0/1 chips support it.
363 * 383 *
364 * divisor = 12MHz * 32 / baudrate = 2^A * B 384 * divisor = 12MHz * 32 / baudrate = 2^A * B
365 * 385 *
@@ -452,7 +472,7 @@ static void pl2303_encode_baudrate(struct tty_struct *tty,
452 * 1) Direct method: encodes the baud rate value directly 472 * 1) Direct method: encodes the baud rate value directly
453 * => supported by all chip types 473 * => supported by all chip types
454 * 2) Divisor based method: encodes a divisor to a base value (12MHz*32) 474 * 2) Divisor based method: encodes a divisor to a base value (12MHz*32)
455 * => supported by HX chips (and likely not by type_0/1 chips) 475 * => not supported by HX clones (and likely type_0/1 chips)
456 * 476 *
457 * NOTE: Although the divisor based baud rate encoding method is much 477 * NOTE: Although the divisor based baud rate encoding method is much
458 * more flexible, some of the standard baud rate values can not be 478 * more flexible, some of the standard baud rate values can not be
@@ -460,7 +480,7 @@ static void pl2303_encode_baudrate(struct tty_struct *tty,
460 * the device likely uses the same baud rate generator for both methods 480 * the device likely uses the same baud rate generator for both methods
461 * so that there is likley no difference. 481 * so that there is likley no difference.
462 */ 482 */
463 if (type == type_0 || type == type_1) 483 if (type == type_0 || type == type_1 || type == HX_CLONE)
464 baud = pl2303_baudrate_encode_direct(baud, type, buf); 484 baud = pl2303_baudrate_encode_direct(baud, type, buf);
465 else 485 else
466 baud = pl2303_baudrate_encode_divisor(baud, type, buf); 486 baud = pl2303_baudrate_encode_divisor(baud, type, buf);
@@ -813,6 +833,7 @@ static void pl2303_break_ctl(struct tty_struct *tty, int break_state)
813 result = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), 833 result = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
814 BREAK_REQUEST, BREAK_REQUEST_TYPE, state, 834 BREAK_REQUEST, BREAK_REQUEST_TYPE, state,
815 0, NULL, 0, 100); 835 0, NULL, 0, 100);
836 /* NOTE: HX clones don't support sending breaks, -EPIPE is returned */
816 if (result) 837 if (result)
817 dev_err(&port->dev, "error sending break = %d\n", result); 838 dev_err(&port->dev, "error sending break = %d\n", result);
818} 839}