diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2015-11-24 13:34:40 -0500 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-11-24 13:34:40 -0500 |
commit | 8bd142c01648cdb33e9bcafa0448ba2c20ed814c (patch) | |
tree | 9197c60d3f9d4036f38f281a183e94750ceea1d7 /drivers/usb | |
parent | d792abacaf1a1a8dfea353fab699b97fa6251c2a (diff) | |
parent | fbb4574ce9a37e15a9872860bf202f2be5bdf6c4 (diff) |
Merge tag 'kvm-arm-for-v4.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into kvm-master
KVM/ARM Fixes for v4.4-rc3.
Includes some timer fixes, properly unmapping PTEs, an errata fix, and two
tweaks to the EL2 panic code.
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/chipidea/ci_hdrc_imx.c | 142 | ||||
-rw-r--r-- | drivers/usb/chipidea/debug.c | 2 | ||||
-rw-r--r-- | drivers/usb/chipidea/udc.c | 17 | ||||
-rw-r--r-- | drivers/usb/chipidea/usbmisc_imx.c | 10 | ||||
-rw-r--r-- | drivers/usb/class/usblp.c | 2 | ||||
-rw-r--r-- | drivers/usb/core/Kconfig | 3 | ||||
-rw-r--r-- | drivers/usb/dwc2/hcd.c | 9 | ||||
-rw-r--r-- | drivers/usb/dwc2/platform.c | 3 | ||||
-rw-r--r-- | drivers/usb/dwc3/dwc3-pci.c | 4 | ||||
-rw-r--r-- | drivers/usb/dwc3/gadget.c | 24 | ||||
-rw-r--r-- | drivers/usb/gadget/function/f_loopback.c | 2 | ||||
-rw-r--r-- | drivers/usb/gadget/udc/atmel_usba_udc.c | 2 | ||||
-rw-r--r-- | drivers/usb/host/xhci-hub.c | 15 | ||||
-rw-r--r-- | drivers/usb/host/xhci-ring.c | 32 | ||||
-rw-r--r-- | drivers/usb/host/xhci.c | 10 | ||||
-rw-r--r-- | drivers/usb/musb/musb_core.c | 12 | ||||
-rw-r--r-- | drivers/usb/musb/musb_host.c | 22 | ||||
-rw-r--r-- | drivers/usb/phy/Kconfig | 4 | ||||
-rw-r--r-- | drivers/usb/phy/phy-mxs-usb.c | 7 | ||||
-rw-r--r-- | drivers/usb/phy/phy-omap-otg.c | 2 | ||||
-rw-r--r-- | drivers/usb/serial/option.c | 11 | ||||
-rw-r--r-- | drivers/usb/serial/qcserial.c | 94 | ||||
-rw-r--r-- | drivers/usb/serial/ti_usb_3410_5052.c | 2 | ||||
-rw-r--r-- | drivers/usb/serial/ti_usb_3410_5052.h | 4 |
24 files changed, 329 insertions, 106 deletions
diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c index 6ccbf60cdd5c..5a048b7b92e8 100644 --- a/drivers/usb/chipidea/ci_hdrc_imx.c +++ b/drivers/usb/chipidea/ci_hdrc_imx.c | |||
@@ -84,6 +84,12 @@ struct ci_hdrc_imx_data { | |||
84 | struct imx_usbmisc_data *usbmisc_data; | 84 | struct imx_usbmisc_data *usbmisc_data; |
85 | bool supports_runtime_pm; | 85 | bool supports_runtime_pm; |
86 | bool in_lpm; | 86 | bool in_lpm; |
87 | /* SoC before i.mx6 (except imx23/imx28) needs three clks */ | ||
88 | bool need_three_clks; | ||
89 | struct clk *clk_ipg; | ||
90 | struct clk *clk_ahb; | ||
91 | struct clk *clk_per; | ||
92 | /* --------------------------------- */ | ||
87 | }; | 93 | }; |
88 | 94 | ||
89 | /* Common functions shared by usbmisc drivers */ | 95 | /* Common functions shared by usbmisc drivers */ |
@@ -135,6 +141,102 @@ static struct imx_usbmisc_data *usbmisc_get_init_data(struct device *dev) | |||
135 | } | 141 | } |
136 | 142 | ||
137 | /* End of common functions shared by usbmisc drivers*/ | 143 | /* End of common functions shared by usbmisc drivers*/ |
144 | static int imx_get_clks(struct device *dev) | ||
145 | { | ||
146 | struct ci_hdrc_imx_data *data = dev_get_drvdata(dev); | ||
147 | int ret = 0; | ||
148 | |||
149 | data->clk_ipg = devm_clk_get(dev, "ipg"); | ||
150 | if (IS_ERR(data->clk_ipg)) { | ||
151 | /* If the platform only needs one clocks */ | ||
152 | data->clk = devm_clk_get(dev, NULL); | ||
153 | if (IS_ERR(data->clk)) { | ||
154 | ret = PTR_ERR(data->clk); | ||
155 | dev_err(dev, | ||
156 | "Failed to get clks, err=%ld,%ld\n", | ||
157 | PTR_ERR(data->clk), PTR_ERR(data->clk_ipg)); | ||
158 | return ret; | ||
159 | } | ||
160 | return ret; | ||
161 | } | ||
162 | |||
163 | data->clk_ahb = devm_clk_get(dev, "ahb"); | ||
164 | if (IS_ERR(data->clk_ahb)) { | ||
165 | ret = PTR_ERR(data->clk_ahb); | ||
166 | dev_err(dev, | ||
167 | "Failed to get ahb clock, err=%d\n", ret); | ||
168 | return ret; | ||
169 | } | ||
170 | |||
171 | data->clk_per = devm_clk_get(dev, "per"); | ||
172 | if (IS_ERR(data->clk_per)) { | ||
173 | ret = PTR_ERR(data->clk_per); | ||
174 | dev_err(dev, | ||
175 | "Failed to get per clock, err=%d\n", ret); | ||
176 | return ret; | ||
177 | } | ||
178 | |||
179 | data->need_three_clks = true; | ||
180 | return ret; | ||
181 | } | ||
182 | |||
183 | static int imx_prepare_enable_clks(struct device *dev) | ||
184 | { | ||
185 | struct ci_hdrc_imx_data *data = dev_get_drvdata(dev); | ||
186 | int ret = 0; | ||
187 | |||
188 | if (data->need_three_clks) { | ||
189 | ret = clk_prepare_enable(data->clk_ipg); | ||
190 | if (ret) { | ||
191 | dev_err(dev, | ||
192 | "Failed to prepare/enable ipg clk, err=%d\n", | ||
193 | ret); | ||
194 | return ret; | ||
195 | } | ||
196 | |||
197 | ret = clk_prepare_enable(data->clk_ahb); | ||
198 | if (ret) { | ||
199 | dev_err(dev, | ||
200 | "Failed to prepare/enable ahb clk, err=%d\n", | ||
201 | ret); | ||
202 | clk_disable_unprepare(data->clk_ipg); | ||
203 | return ret; | ||
204 | } | ||
205 | |||
206 | ret = clk_prepare_enable(data->clk_per); | ||
207 | if (ret) { | ||
208 | dev_err(dev, | ||
209 | "Failed to prepare/enable per clk, err=%d\n", | ||
210 | ret); | ||
211 | clk_disable_unprepare(data->clk_ahb); | ||
212 | clk_disable_unprepare(data->clk_ipg); | ||
213 | return ret; | ||
214 | } | ||
215 | } else { | ||
216 | ret = clk_prepare_enable(data->clk); | ||
217 | if (ret) { | ||
218 | dev_err(dev, | ||
219 | "Failed to prepare/enable clk, err=%d\n", | ||
220 | ret); | ||
221 | return ret; | ||
222 | } | ||
223 | } | ||
224 | |||
225 | return ret; | ||
226 | } | ||
227 | |||
228 | static void imx_disable_unprepare_clks(struct device *dev) | ||
229 | { | ||
230 | struct ci_hdrc_imx_data *data = dev_get_drvdata(dev); | ||
231 | |||
232 | if (data->need_three_clks) { | ||
233 | clk_disable_unprepare(data->clk_per); | ||
234 | clk_disable_unprepare(data->clk_ahb); | ||
235 | clk_disable_unprepare(data->clk_ipg); | ||
236 | } else { | ||
237 | clk_disable_unprepare(data->clk); | ||
238 | } | ||
239 | } | ||
138 | 240 | ||
139 | static int ci_hdrc_imx_probe(struct platform_device *pdev) | 241 | static int ci_hdrc_imx_probe(struct platform_device *pdev) |
140 | { | 242 | { |
@@ -145,31 +247,31 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) | |||
145 | .flags = CI_HDRC_SET_NON_ZERO_TTHA, | 247 | .flags = CI_HDRC_SET_NON_ZERO_TTHA, |
146 | }; | 248 | }; |
147 | int ret; | 249 | int ret; |
148 | const struct of_device_id *of_id = | 250 | const struct of_device_id *of_id; |
149 | of_match_device(ci_hdrc_imx_dt_ids, &pdev->dev); | 251 | const struct ci_hdrc_imx_platform_flag *imx_platform_flag; |
150 | const struct ci_hdrc_imx_platform_flag *imx_platform_flag = of_id->data; | 252 | |
253 | of_id = of_match_device(ci_hdrc_imx_dt_ids, &pdev->dev); | ||
254 | if (!of_id) | ||
255 | return -ENODEV; | ||
256 | |||
257 | imx_platform_flag = of_id->data; | ||
151 | 258 | ||
152 | data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); | 259 | data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); |
153 | if (!data) | 260 | if (!data) |
154 | return -ENOMEM; | 261 | return -ENOMEM; |
155 | 262 | ||
263 | platform_set_drvdata(pdev, data); | ||
156 | data->usbmisc_data = usbmisc_get_init_data(&pdev->dev); | 264 | data->usbmisc_data = usbmisc_get_init_data(&pdev->dev); |
157 | if (IS_ERR(data->usbmisc_data)) | 265 | if (IS_ERR(data->usbmisc_data)) |
158 | return PTR_ERR(data->usbmisc_data); | 266 | return PTR_ERR(data->usbmisc_data); |
159 | 267 | ||
160 | data->clk = devm_clk_get(&pdev->dev, NULL); | 268 | ret = imx_get_clks(&pdev->dev); |
161 | if (IS_ERR(data->clk)) { | 269 | if (ret) |
162 | dev_err(&pdev->dev, | 270 | return ret; |
163 | "Failed to get clock, err=%ld\n", PTR_ERR(data->clk)); | ||
164 | return PTR_ERR(data->clk); | ||
165 | } | ||
166 | 271 | ||
167 | ret = clk_prepare_enable(data->clk); | 272 | ret = imx_prepare_enable_clks(&pdev->dev); |
168 | if (ret) { | 273 | if (ret) |
169 | dev_err(&pdev->dev, | ||
170 | "Failed to prepare or enable clock, err=%d\n", ret); | ||
171 | return ret; | 274 | return ret; |
172 | } | ||
173 | 275 | ||
174 | data->phy = devm_usb_get_phy_by_phandle(&pdev->dev, "fsl,usbphy", 0); | 276 | data->phy = devm_usb_get_phy_by_phandle(&pdev->dev, "fsl,usbphy", 0); |
175 | if (IS_ERR(data->phy)) { | 277 | if (IS_ERR(data->phy)) { |
@@ -212,8 +314,6 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) | |||
212 | goto disable_device; | 314 | goto disable_device; |
213 | } | 315 | } |
214 | 316 | ||
215 | platform_set_drvdata(pdev, data); | ||
216 | |||
217 | if (data->supports_runtime_pm) { | 317 | if (data->supports_runtime_pm) { |
218 | pm_runtime_set_active(&pdev->dev); | 318 | pm_runtime_set_active(&pdev->dev); |
219 | pm_runtime_enable(&pdev->dev); | 319 | pm_runtime_enable(&pdev->dev); |
@@ -226,7 +326,7 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) | |||
226 | disable_device: | 326 | disable_device: |
227 | ci_hdrc_remove_device(data->ci_pdev); | 327 | ci_hdrc_remove_device(data->ci_pdev); |
228 | err_clk: | 328 | err_clk: |
229 | clk_disable_unprepare(data->clk); | 329 | imx_disable_unprepare_clks(&pdev->dev); |
230 | return ret; | 330 | return ret; |
231 | } | 331 | } |
232 | 332 | ||
@@ -240,7 +340,7 @@ static int ci_hdrc_imx_remove(struct platform_device *pdev) | |||
240 | pm_runtime_put_noidle(&pdev->dev); | 340 | pm_runtime_put_noidle(&pdev->dev); |
241 | } | 341 | } |
242 | ci_hdrc_remove_device(data->ci_pdev); | 342 | ci_hdrc_remove_device(data->ci_pdev); |
243 | clk_disable_unprepare(data->clk); | 343 | imx_disable_unprepare_clks(&pdev->dev); |
244 | 344 | ||
245 | return 0; | 345 | return 0; |
246 | } | 346 | } |
@@ -252,7 +352,7 @@ static int imx_controller_suspend(struct device *dev) | |||
252 | 352 | ||
253 | dev_dbg(dev, "at %s\n", __func__); | 353 | dev_dbg(dev, "at %s\n", __func__); |
254 | 354 | ||
255 | clk_disable_unprepare(data->clk); | 355 | imx_disable_unprepare_clks(dev); |
256 | data->in_lpm = true; | 356 | data->in_lpm = true; |
257 | 357 | ||
258 | return 0; | 358 | return 0; |
@@ -270,7 +370,7 @@ static int imx_controller_resume(struct device *dev) | |||
270 | return 0; | 370 | return 0; |
271 | } | 371 | } |
272 | 372 | ||
273 | ret = clk_prepare_enable(data->clk); | 373 | ret = imx_prepare_enable_clks(dev); |
274 | if (ret) | 374 | if (ret) |
275 | return ret; | 375 | return ret; |
276 | 376 | ||
@@ -285,7 +385,7 @@ static int imx_controller_resume(struct device *dev) | |||
285 | return 0; | 385 | return 0; |
286 | 386 | ||
287 | clk_disable: | 387 | clk_disable: |
288 | clk_disable_unprepare(data->clk); | 388 | imx_disable_unprepare_clks(dev); |
289 | return ret; | 389 | return ret; |
290 | } | 390 | } |
291 | 391 | ||
diff --git a/drivers/usb/chipidea/debug.c b/drivers/usb/chipidea/debug.c index 080b7be3daf0..58c8485a0715 100644 --- a/drivers/usb/chipidea/debug.c +++ b/drivers/usb/chipidea/debug.c | |||
@@ -322,8 +322,10 @@ static ssize_t ci_role_write(struct file *file, const char __user *ubuf, | |||
322 | return -EINVAL; | 322 | return -EINVAL; |
323 | 323 | ||
324 | pm_runtime_get_sync(ci->dev); | 324 | pm_runtime_get_sync(ci->dev); |
325 | disable_irq(ci->irq); | ||
325 | ci_role_stop(ci); | 326 | ci_role_stop(ci); |
326 | ret = ci_role_start(ci, role); | 327 | ret = ci_role_start(ci, role); |
328 | enable_irq(ci->irq); | ||
327 | pm_runtime_put_sync(ci->dev); | 329 | pm_runtime_put_sync(ci->dev); |
328 | 330 | ||
329 | return ret ? ret : count; | 331 | return ret ? ret : count; |
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index 8223fe73ea85..391a1225b0ba 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c | |||
@@ -1751,6 +1751,22 @@ static int ci_udc_start(struct usb_gadget *gadget, | |||
1751 | return retval; | 1751 | return retval; |
1752 | } | 1752 | } |
1753 | 1753 | ||
1754 | static void ci_udc_stop_for_otg_fsm(struct ci_hdrc *ci) | ||
1755 | { | ||
1756 | if (!ci_otg_is_fsm_mode(ci)) | ||
1757 | return; | ||
1758 | |||
1759 | mutex_lock(&ci->fsm.lock); | ||
1760 | if (ci->fsm.otg->state == OTG_STATE_A_PERIPHERAL) { | ||
1761 | ci->fsm.a_bidl_adis_tmout = 1; | ||
1762 | ci_hdrc_otg_fsm_start(ci); | ||
1763 | } else if (ci->fsm.otg->state == OTG_STATE_B_PERIPHERAL) { | ||
1764 | ci->fsm.protocol = PROTO_UNDEF; | ||
1765 | ci->fsm.otg->state = OTG_STATE_UNDEFINED; | ||
1766 | } | ||
1767 | mutex_unlock(&ci->fsm.lock); | ||
1768 | } | ||
1769 | |||
1754 | /** | 1770 | /** |
1755 | * ci_udc_stop: unregister a gadget driver | 1771 | * ci_udc_stop: unregister a gadget driver |
1756 | */ | 1772 | */ |
@@ -1775,6 +1791,7 @@ static int ci_udc_stop(struct usb_gadget *gadget) | |||
1775 | ci->driver = NULL; | 1791 | ci->driver = NULL; |
1776 | spin_unlock_irqrestore(&ci->lock, flags); | 1792 | spin_unlock_irqrestore(&ci->lock, flags); |
1777 | 1793 | ||
1794 | ci_udc_stop_for_otg_fsm(ci); | ||
1778 | return 0; | 1795 | return 0; |
1779 | } | 1796 | } |
1780 | 1797 | ||
diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c index fcea4eb36eee..ab8b027e8cc8 100644 --- a/drivers/usb/chipidea/usbmisc_imx.c +++ b/drivers/usb/chipidea/usbmisc_imx.c | |||
@@ -500,7 +500,11 @@ static int usbmisc_imx_probe(struct platform_device *pdev) | |||
500 | { | 500 | { |
501 | struct resource *res; | 501 | struct resource *res; |
502 | struct imx_usbmisc *data; | 502 | struct imx_usbmisc *data; |
503 | struct of_device_id *tmp_dev; | 503 | const struct of_device_id *of_id; |
504 | |||
505 | of_id = of_match_device(usbmisc_imx_dt_ids, &pdev->dev); | ||
506 | if (!of_id) | ||
507 | return -ENODEV; | ||
504 | 508 | ||
505 | data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); | 509 | data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); |
506 | if (!data) | 510 | if (!data) |
@@ -513,9 +517,7 @@ static int usbmisc_imx_probe(struct platform_device *pdev) | |||
513 | if (IS_ERR(data->base)) | 517 | if (IS_ERR(data->base)) |
514 | return PTR_ERR(data->base); | 518 | return PTR_ERR(data->base); |
515 | 519 | ||
516 | tmp_dev = (struct of_device_id *) | 520 | data->ops = (const struct usbmisc_ops *)of_id->data; |
517 | of_match_device(usbmisc_imx_dt_ids, &pdev->dev); | ||
518 | data->ops = (const struct usbmisc_ops *)tmp_dev->data; | ||
519 | platform_set_drvdata(pdev, data); | 521 | platform_set_drvdata(pdev, data); |
520 | 522 | ||
521 | return 0; | 523 | return 0; |
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c index 433bbc34a8a4..071964c7847f 100644 --- a/drivers/usb/class/usblp.c +++ b/drivers/usb/class/usblp.c | |||
@@ -884,11 +884,11 @@ static int usblp_wwait(struct usblp *usblp, int nonblock) | |||
884 | 884 | ||
885 | add_wait_queue(&usblp->wwait, &waita); | 885 | add_wait_queue(&usblp->wwait, &waita); |
886 | for (;;) { | 886 | for (;;) { |
887 | set_current_state(TASK_INTERRUPTIBLE); | ||
888 | if (mutex_lock_interruptible(&usblp->mut)) { | 887 | if (mutex_lock_interruptible(&usblp->mut)) { |
889 | rc = -EINTR; | 888 | rc = -EINTR; |
890 | break; | 889 | break; |
891 | } | 890 | } |
891 | set_current_state(TASK_INTERRUPTIBLE); | ||
892 | rc = usblp_wtest(usblp, nonblock); | 892 | rc = usblp_wtest(usblp, nonblock); |
893 | mutex_unlock(&usblp->mut); | 893 | mutex_unlock(&usblp->mut); |
894 | if (rc <= 0) | 894 | if (rc <= 0) |
diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig index a99c89e78126..dd280108758f 100644 --- a/drivers/usb/core/Kconfig +++ b/drivers/usb/core/Kconfig | |||
@@ -77,8 +77,7 @@ config USB_OTG_BLACKLIST_HUB | |||
77 | 77 | ||
78 | config USB_OTG_FSM | 78 | config USB_OTG_FSM |
79 | tristate "USB 2.0 OTG FSM implementation" | 79 | tristate "USB 2.0 OTG FSM implementation" |
80 | depends on USB | 80 | depends on USB && USB_OTG |
81 | select USB_OTG | ||
82 | select USB_PHY | 81 | select USB_PHY |
83 | help | 82 | help |
84 | Implements OTG Finite State Machine as specified in On-The-Go | 83 | Implements OTG Finite State Machine as specified in On-The-Go |
diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index e79baf73c234..571c21727ff9 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c | |||
@@ -324,12 +324,13 @@ void dwc2_hcd_disconnect(struct dwc2_hsotg *hsotg) | |||
324 | */ | 324 | */ |
325 | static void dwc2_hcd_rem_wakeup(struct dwc2_hsotg *hsotg) | 325 | static void dwc2_hcd_rem_wakeup(struct dwc2_hsotg *hsotg) |
326 | { | 326 | { |
327 | if (hsotg->lx_state == DWC2_L2) { | 327 | if (hsotg->bus_suspended) { |
328 | hsotg->flags.b.port_suspend_change = 1; | 328 | hsotg->flags.b.port_suspend_change = 1; |
329 | usb_hcd_resume_root_hub(hsotg->priv); | 329 | usb_hcd_resume_root_hub(hsotg->priv); |
330 | } else { | ||
331 | hsotg->flags.b.port_l1_change = 1; | ||
332 | } | 330 | } |
331 | |||
332 | if (hsotg->lx_state == DWC2_L1) | ||
333 | hsotg->flags.b.port_l1_change = 1; | ||
333 | } | 334 | } |
334 | 335 | ||
335 | /** | 336 | /** |
@@ -1428,8 +1429,8 @@ static void dwc2_wakeup_detected(unsigned long data) | |||
1428 | dev_dbg(hsotg->dev, "Clear Resume: HPRT0=%0x\n", | 1429 | dev_dbg(hsotg->dev, "Clear Resume: HPRT0=%0x\n", |
1429 | dwc2_readl(hsotg->regs + HPRT0)); | 1430 | dwc2_readl(hsotg->regs + HPRT0)); |
1430 | 1431 | ||
1431 | hsotg->bus_suspended = 0; | ||
1432 | dwc2_hcd_rem_wakeup(hsotg); | 1432 | dwc2_hcd_rem_wakeup(hsotg); |
1433 | hsotg->bus_suspended = 0; | ||
1433 | 1434 | ||
1434 | /* Change to L0 state */ | 1435 | /* Change to L0 state */ |
1435 | hsotg->lx_state = DWC2_L0; | 1436 | hsotg->lx_state = DWC2_L0; |
diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c index 5859b0fa19ee..e61d773cf65e 100644 --- a/drivers/usb/dwc2/platform.c +++ b/drivers/usb/dwc2/platform.c | |||
@@ -108,7 +108,8 @@ static const struct dwc2_core_params params_rk3066 = { | |||
108 | .host_ls_low_power_phy_clk = -1, | 108 | .host_ls_low_power_phy_clk = -1, |
109 | .ts_dline = -1, | 109 | .ts_dline = -1, |
110 | .reload_ctl = -1, | 110 | .reload_ctl = -1, |
111 | .ahbcfg = 0x7, /* INCR16 */ | 111 | .ahbcfg = GAHBCFG_HBSTLEN_INCR16 << |
112 | GAHBCFG_HBSTLEN_SHIFT, | ||
112 | .uframe_sched = -1, | 113 | .uframe_sched = -1, |
113 | .external_id_pin_ctl = -1, | 114 | .external_id_pin_ctl = -1, |
114 | .hibernation = -1, | 115 | .hibernation = -1, |
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c index 77a622cb48ab..009d83048c8c 100644 --- a/drivers/usb/dwc3/dwc3-pci.c +++ b/drivers/usb/dwc3/dwc3-pci.c | |||
@@ -34,6 +34,8 @@ | |||
34 | #define PCI_DEVICE_ID_INTEL_BSW 0x22b7 | 34 | #define PCI_DEVICE_ID_INTEL_BSW 0x22b7 |
35 | #define PCI_DEVICE_ID_INTEL_SPTLP 0x9d30 | 35 | #define PCI_DEVICE_ID_INTEL_SPTLP 0x9d30 |
36 | #define PCI_DEVICE_ID_INTEL_SPTH 0xa130 | 36 | #define PCI_DEVICE_ID_INTEL_SPTH 0xa130 |
37 | #define PCI_DEVICE_ID_INTEL_BXT 0x0aaa | ||
38 | #define PCI_DEVICE_ID_INTEL_APL 0x5aaa | ||
37 | 39 | ||
38 | static const struct acpi_gpio_params reset_gpios = { 0, 0, false }; | 40 | static const struct acpi_gpio_params reset_gpios = { 0, 0, false }; |
39 | static const struct acpi_gpio_params cs_gpios = { 1, 0, false }; | 41 | static const struct acpi_gpio_params cs_gpios = { 1, 0, false }; |
@@ -210,6 +212,8 @@ static const struct pci_device_id dwc3_pci_id_table[] = { | |||
210 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MRFLD), }, | 212 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MRFLD), }, |
211 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SPTLP), }, | 213 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SPTLP), }, |
212 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SPTH), }, | 214 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SPTH), }, |
215 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BXT), }, | ||
216 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_APL), }, | ||
213 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB), }, | 217 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB), }, |
214 | { } /* Terminating Entry */ | 218 | { } /* Terminating Entry */ |
215 | }; | 219 | }; |
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 55ba447fdf8b..e24a01cc98df 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c | |||
@@ -2744,12 +2744,34 @@ int dwc3_gadget_init(struct dwc3 *dwc) | |||
2744 | } | 2744 | } |
2745 | 2745 | ||
2746 | dwc->gadget.ops = &dwc3_gadget_ops; | 2746 | dwc->gadget.ops = &dwc3_gadget_ops; |
2747 | dwc->gadget.max_speed = USB_SPEED_SUPER; | ||
2748 | dwc->gadget.speed = USB_SPEED_UNKNOWN; | 2747 | dwc->gadget.speed = USB_SPEED_UNKNOWN; |
2749 | dwc->gadget.sg_supported = true; | 2748 | dwc->gadget.sg_supported = true; |
2750 | dwc->gadget.name = "dwc3-gadget"; | 2749 | dwc->gadget.name = "dwc3-gadget"; |
2751 | 2750 | ||
2752 | /* | 2751 | /* |
2752 | * FIXME We might be setting max_speed to <SUPER, however versions | ||
2753 | * <2.20a of dwc3 have an issue with metastability (documented | ||
2754 | * elsewhere in this driver) which tells us we can't set max speed to | ||
2755 | * anything lower than SUPER. | ||
2756 | * | ||
2757 | * Because gadget.max_speed is only used by composite.c and function | ||
2758 | * drivers (i.e. it won't go into dwc3's registers) we are allowing this | ||
2759 | * to happen so we avoid sending SuperSpeed Capability descriptor | ||
2760 | * together with our BOS descriptor as that could confuse host into | ||
2761 | * thinking we can handle super speed. | ||
2762 | * | ||
2763 | * Note that, in fact, we won't even support GetBOS requests when speed | ||
2764 | * is less than super speed because we don't have means, yet, to tell | ||
2765 | * composite.c that we are USB 2.0 + LPM ECN. | ||
2766 | */ | ||
2767 | if (dwc->revision < DWC3_REVISION_220A) | ||
2768 | dwc3_trace(trace_dwc3_gadget, | ||
2769 | "Changing max_speed on rev %08x\n", | ||
2770 | dwc->revision); | ||
2771 | |||
2772 | dwc->gadget.max_speed = dwc->maximum_speed; | ||
2773 | |||
2774 | /* | ||
2753 | * Per databook, DWC3 needs buffer size to be aligned to MaxPacketSize | 2775 | * Per databook, DWC3 needs buffer size to be aligned to MaxPacketSize |
2754 | * on ep out. | 2776 | * on ep out. |
2755 | */ | 2777 | */ |
diff --git a/drivers/usb/gadget/function/f_loopback.c b/drivers/usb/gadget/function/f_loopback.c index 23933bdf2d9d..ddc3aad886b7 100644 --- a/drivers/usb/gadget/function/f_loopback.c +++ b/drivers/usb/gadget/function/f_loopback.c | |||
@@ -329,7 +329,7 @@ static int alloc_requests(struct usb_composite_dev *cdev, | |||
329 | for (i = 0; i < loop->qlen && result == 0; i++) { | 329 | for (i = 0; i < loop->qlen && result == 0; i++) { |
330 | result = -ENOMEM; | 330 | result = -ENOMEM; |
331 | 331 | ||
332 | in_req = usb_ep_alloc_request(loop->in_ep, GFP_KERNEL); | 332 | in_req = usb_ep_alloc_request(loop->in_ep, GFP_ATOMIC); |
333 | if (!in_req) | 333 | if (!in_req) |
334 | goto fail; | 334 | goto fail; |
335 | 335 | ||
diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c index f0f2b066ac08..f92f5aff0dd5 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c | |||
@@ -1633,7 +1633,7 @@ static irqreturn_t usba_udc_irq(int irq, void *devid) | |||
1633 | spin_lock(&udc->lock); | 1633 | spin_lock(&udc->lock); |
1634 | 1634 | ||
1635 | int_enb = usba_int_enb_get(udc); | 1635 | int_enb = usba_int_enb_get(udc); |
1636 | status = usba_readl(udc, INT_STA) & int_enb; | 1636 | status = usba_readl(udc, INT_STA) & (int_enb | USBA_HIGH_SPEED); |
1637 | DBG(DBG_INT, "irq, status=%#08x\n", status); | 1637 | DBG(DBG_INT, "irq, status=%#08x\n", status); |
1638 | 1638 | ||
1639 | if (status & USBA_DET_SUSPEND) { | 1639 | if (status & USBA_DET_SUSPEND) { |
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c index 5d2d7e954bd4..0230965fb78c 100644 --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c | |||
@@ -782,12 +782,15 @@ static u32 xhci_get_port_status(struct usb_hcd *hcd, | |||
782 | status |= USB_PORT_STAT_SUSPEND; | 782 | status |= USB_PORT_STAT_SUSPEND; |
783 | } | 783 | } |
784 | } | 784 | } |
785 | if ((raw_port_status & PORT_PLS_MASK) == XDEV_U0 | 785 | if ((raw_port_status & PORT_PLS_MASK) == XDEV_U0 && |
786 | && (raw_port_status & PORT_POWER) | 786 | (raw_port_status & PORT_POWER)) { |
787 | && (bus_state->suspended_ports & (1 << wIndex))) { | 787 | if (bus_state->suspended_ports & (1 << wIndex)) { |
788 | bus_state->suspended_ports &= ~(1 << wIndex); | 788 | bus_state->suspended_ports &= ~(1 << wIndex); |
789 | if (hcd->speed < HCD_USB3) | 789 | if (hcd->speed < HCD_USB3) |
790 | bus_state->port_c_suspend |= 1 << wIndex; | 790 | bus_state->port_c_suspend |= 1 << wIndex; |
791 | } | ||
792 | bus_state->resume_done[wIndex] = 0; | ||
793 | clear_bit(wIndex, &bus_state->resuming_ports); | ||
791 | } | 794 | } |
792 | if (raw_port_status & PORT_CONNECT) { | 795 | if (raw_port_status & PORT_CONNECT) { |
793 | status |= USB_PORT_STAT_CONNECTION; | 796 | status |= USB_PORT_STAT_CONNECTION; |
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index fa836251ca21..6c5e8133cf87 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
@@ -3896,28 +3896,6 @@ cleanup: | |||
3896 | return ret; | 3896 | return ret; |
3897 | } | 3897 | } |
3898 | 3898 | ||
3899 | static int ep_ring_is_processing(struct xhci_hcd *xhci, | ||
3900 | int slot_id, unsigned int ep_index) | ||
3901 | { | ||
3902 | struct xhci_virt_device *xdev; | ||
3903 | struct xhci_ring *ep_ring; | ||
3904 | struct xhci_ep_ctx *ep_ctx; | ||
3905 | struct xhci_virt_ep *xep; | ||
3906 | dma_addr_t hw_deq; | ||
3907 | |||
3908 | xdev = xhci->devs[slot_id]; | ||
3909 | xep = &xhci->devs[slot_id]->eps[ep_index]; | ||
3910 | ep_ring = xep->ring; | ||
3911 | ep_ctx = xhci_get_ep_ctx(xhci, xdev->out_ctx, ep_index); | ||
3912 | |||
3913 | if ((le32_to_cpu(ep_ctx->ep_info) & EP_STATE_MASK) != EP_STATE_RUNNING) | ||
3914 | return 0; | ||
3915 | |||
3916 | hw_deq = le64_to_cpu(ep_ctx->deq) & ~EP_CTX_CYCLE_MASK; | ||
3917 | return (hw_deq != | ||
3918 | xhci_trb_virt_to_dma(ep_ring->enq_seg, ep_ring->enqueue)); | ||
3919 | } | ||
3920 | |||
3921 | /* | 3899 | /* |
3922 | * Check transfer ring to guarantee there is enough room for the urb. | 3900 | * Check transfer ring to guarantee there is enough room for the urb. |
3923 | * Update ISO URB start_frame and interval. | 3901 | * Update ISO URB start_frame and interval. |
@@ -3983,10 +3961,12 @@ int xhci_queue_isoc_tx_prepare(struct xhci_hcd *xhci, gfp_t mem_flags, | |||
3983 | } | 3961 | } |
3984 | 3962 | ||
3985 | /* Calculate the start frame and put it in urb->start_frame. */ | 3963 | /* Calculate the start frame and put it in urb->start_frame. */ |
3986 | if (HCC_CFC(xhci->hcc_params) && | 3964 | if (HCC_CFC(xhci->hcc_params) && !list_empty(&ep_ring->td_list)) { |
3987 | ep_ring_is_processing(xhci, slot_id, ep_index)) { | 3965 | if ((le32_to_cpu(ep_ctx->ep_info) & EP_STATE_MASK) == |
3988 | urb->start_frame = xep->next_frame_id; | 3966 | EP_STATE_RUNNING) { |
3989 | goto skip_start_over; | 3967 | urb->start_frame = xep->next_frame_id; |
3968 | goto skip_start_over; | ||
3969 | } | ||
3990 | } | 3970 | } |
3991 | 3971 | ||
3992 | start_frame = readl(&xhci->run_regs->microframe_index); | 3972 | start_frame = readl(&xhci->run_regs->microframe_index); |
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 6e7dc6f93978..dfa44d3e8eee 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
@@ -175,6 +175,16 @@ int xhci_reset(struct xhci_hcd *xhci) | |||
175 | command |= CMD_RESET; | 175 | command |= CMD_RESET; |
176 | writel(command, &xhci->op_regs->command); | 176 | writel(command, &xhci->op_regs->command); |
177 | 177 | ||
178 | /* Existing Intel xHCI controllers require a delay of 1 mS, | ||
179 | * after setting the CMD_RESET bit, and before accessing any | ||
180 | * HC registers. This allows the HC to complete the | ||
181 | * reset operation and be ready for HC register access. | ||
182 | * Without this delay, the subsequent HC register access, | ||
183 | * may result in a system hang very rarely. | ||
184 | */ | ||
185 | if (xhci->quirks & XHCI_INTEL_HOST) | ||
186 | udelay(1000); | ||
187 | |||
178 | ret = xhci_handshake(&xhci->op_regs->command, | 188 | ret = xhci_handshake(&xhci->op_regs->command, |
179 | CMD_RESET, 0, 10 * 1000 * 1000); | 189 | CMD_RESET, 0, 10 * 1000 * 1000); |
180 | if (ret) | 190 | if (ret) |
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index ba13529cbd52..18cfc0a361cb 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c | |||
@@ -132,7 +132,7 @@ static inline struct musb *dev_to_musb(struct device *dev) | |||
132 | /*-------------------------------------------------------------------------*/ | 132 | /*-------------------------------------------------------------------------*/ |
133 | 133 | ||
134 | #ifndef CONFIG_BLACKFIN | 134 | #ifndef CONFIG_BLACKFIN |
135 | static int musb_ulpi_read(struct usb_phy *phy, u32 offset) | 135 | static int musb_ulpi_read(struct usb_phy *phy, u32 reg) |
136 | { | 136 | { |
137 | void __iomem *addr = phy->io_priv; | 137 | void __iomem *addr = phy->io_priv; |
138 | int i = 0; | 138 | int i = 0; |
@@ -151,7 +151,7 @@ static int musb_ulpi_read(struct usb_phy *phy, u32 offset) | |||
151 | * ULPICarKitControlDisableUTMI after clearing POWER_SUSPENDM. | 151 | * ULPICarKitControlDisableUTMI after clearing POWER_SUSPENDM. |
152 | */ | 152 | */ |
153 | 153 | ||
154 | musb_writeb(addr, MUSB_ULPI_REG_ADDR, (u8)offset); | 154 | musb_writeb(addr, MUSB_ULPI_REG_ADDR, (u8)reg); |
155 | musb_writeb(addr, MUSB_ULPI_REG_CONTROL, | 155 | musb_writeb(addr, MUSB_ULPI_REG_CONTROL, |
156 | MUSB_ULPI_REG_REQ | MUSB_ULPI_RDN_WR); | 156 | MUSB_ULPI_REG_REQ | MUSB_ULPI_RDN_WR); |
157 | 157 | ||
@@ -176,7 +176,7 @@ out: | |||
176 | return ret; | 176 | return ret; |
177 | } | 177 | } |
178 | 178 | ||
179 | static int musb_ulpi_write(struct usb_phy *phy, u32 offset, u32 data) | 179 | static int musb_ulpi_write(struct usb_phy *phy, u32 val, u32 reg) |
180 | { | 180 | { |
181 | void __iomem *addr = phy->io_priv; | 181 | void __iomem *addr = phy->io_priv; |
182 | int i = 0; | 182 | int i = 0; |
@@ -191,8 +191,8 @@ static int musb_ulpi_write(struct usb_phy *phy, u32 offset, u32 data) | |||
191 | power &= ~MUSB_POWER_SUSPENDM; | 191 | power &= ~MUSB_POWER_SUSPENDM; |
192 | musb_writeb(addr, MUSB_POWER, power); | 192 | musb_writeb(addr, MUSB_POWER, power); |
193 | 193 | ||
194 | musb_writeb(addr, MUSB_ULPI_REG_ADDR, (u8)offset); | 194 | musb_writeb(addr, MUSB_ULPI_REG_ADDR, (u8)reg); |
195 | musb_writeb(addr, MUSB_ULPI_REG_DATA, (u8)data); | 195 | musb_writeb(addr, MUSB_ULPI_REG_DATA, (u8)val); |
196 | musb_writeb(addr, MUSB_ULPI_REG_CONTROL, MUSB_ULPI_REG_REQ); | 196 | musb_writeb(addr, MUSB_ULPI_REG_CONTROL, MUSB_ULPI_REG_REQ); |
197 | 197 | ||
198 | while (!(musb_readb(addr, MUSB_ULPI_REG_CONTROL) | 198 | while (!(musb_readb(addr, MUSB_ULPI_REG_CONTROL) |
@@ -1668,7 +1668,7 @@ EXPORT_SYMBOL_GPL(musb_interrupt); | |||
1668 | static bool use_dma = 1; | 1668 | static bool use_dma = 1; |
1669 | 1669 | ||
1670 | /* "modprobe ... use_dma=0" etc */ | 1670 | /* "modprobe ... use_dma=0" etc */ |
1671 | module_param(use_dma, bool, 0); | 1671 | module_param(use_dma, bool, 0644); |
1672 | MODULE_PARM_DESC(use_dma, "enable/disable use of DMA"); | 1672 | MODULE_PARM_DESC(use_dma, "enable/disable use of DMA"); |
1673 | 1673 | ||
1674 | void musb_dma_completion(struct musb *musb, u8 epnum, u8 transmit) | 1674 | void musb_dma_completion(struct musb *musb, u8 epnum, u8 transmit) |
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index 26c65e66cc0f..795a45b1b25b 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c | |||
@@ -112,22 +112,32 @@ static void musb_h_tx_flush_fifo(struct musb_hw_ep *ep) | |||
112 | struct musb *musb = ep->musb; | 112 | struct musb *musb = ep->musb; |
113 | void __iomem *epio = ep->regs; | 113 | void __iomem *epio = ep->regs; |
114 | u16 csr; | 114 | u16 csr; |
115 | u16 lastcsr = 0; | ||
116 | int retries = 1000; | 115 | int retries = 1000; |
117 | 116 | ||
118 | csr = musb_readw(epio, MUSB_TXCSR); | 117 | csr = musb_readw(epio, MUSB_TXCSR); |
119 | while (csr & MUSB_TXCSR_FIFONOTEMPTY) { | 118 | while (csr & MUSB_TXCSR_FIFONOTEMPTY) { |
120 | if (csr != lastcsr) | ||
121 | dev_dbg(musb->controller, "Host TX FIFONOTEMPTY csr: %02x\n", csr); | ||
122 | lastcsr = csr; | ||
123 | csr |= MUSB_TXCSR_FLUSHFIFO | MUSB_TXCSR_TXPKTRDY; | 119 | csr |= MUSB_TXCSR_FLUSHFIFO | MUSB_TXCSR_TXPKTRDY; |
124 | musb_writew(epio, MUSB_TXCSR, csr); | 120 | musb_writew(epio, MUSB_TXCSR, csr); |
125 | csr = musb_readw(epio, MUSB_TXCSR); | 121 | csr = musb_readw(epio, MUSB_TXCSR); |
126 | if (WARN(retries-- < 1, | 122 | |
123 | /* | ||
124 | * FIXME: sometimes the tx fifo flush failed, it has been | ||
125 | * observed during device disconnect on AM335x. | ||
126 | * | ||
127 | * To reproduce the issue, ensure tx urb(s) are queued when | ||
128 | * unplug the usb device which is connected to AM335x usb | ||
129 | * host port. | ||
130 | * | ||
131 | * I found using a usb-ethernet device and running iperf | ||
132 | * (client on AM335x) has very high chance to trigger it. | ||
133 | * | ||
134 | * Better to turn on dev_dbg() in musb_cleanup_urb() with | ||
135 | * CPPI enabled to see the issue when aborting the tx channel. | ||
136 | */ | ||
137 | if (dev_WARN_ONCE(musb->controller, retries-- < 1, | ||
127 | "Could not flush host TX%d fifo: csr: %04x\n", | 138 | "Could not flush host TX%d fifo: csr: %04x\n", |
128 | ep->epnum, csr)) | 139 | ep->epnum, csr)) |
129 | return; | 140 | return; |
130 | mdelay(1); | ||
131 | } | 141 | } |
132 | } | 142 | } |
133 | 143 | ||
diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig index 173132416170..22e8ecb6bfbd 100644 --- a/drivers/usb/phy/Kconfig +++ b/drivers/usb/phy/Kconfig | |||
@@ -21,7 +21,6 @@ config AB8500_USB | |||
21 | config FSL_USB2_OTG | 21 | config FSL_USB2_OTG |
22 | bool "Freescale USB OTG Transceiver Driver" | 22 | bool "Freescale USB OTG Transceiver Driver" |
23 | depends on USB_EHCI_FSL && USB_FSL_USB2 && USB_OTG_FSM && PM | 23 | depends on USB_EHCI_FSL && USB_FSL_USB2 && USB_OTG_FSM && PM |
24 | select USB_OTG | ||
25 | select USB_PHY | 24 | select USB_PHY |
26 | help | 25 | help |
27 | Enable this to support Freescale USB OTG transceiver. | 26 | Enable this to support Freescale USB OTG transceiver. |
@@ -168,8 +167,7 @@ config USB_QCOM_8X16_PHY | |||
168 | 167 | ||
169 | config USB_MV_OTG | 168 | config USB_MV_OTG |
170 | tristate "Marvell USB OTG support" | 169 | tristate "Marvell USB OTG support" |
171 | depends on USB_EHCI_MV && USB_MV_UDC && PM | 170 | depends on USB_EHCI_MV && USB_MV_UDC && PM && USB_OTG |
172 | select USB_OTG | ||
173 | select USB_PHY | 171 | select USB_PHY |
174 | help | 172 | help |
175 | 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-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c index 4d863ebc117c..b7536af777ab 100644 --- a/drivers/usb/phy/phy-mxs-usb.c +++ b/drivers/usb/phy/phy-mxs-usb.c | |||
@@ -452,10 +452,13 @@ static int mxs_phy_probe(struct platform_device *pdev) | |||
452 | struct clk *clk; | 452 | struct clk *clk; |
453 | struct mxs_phy *mxs_phy; | 453 | struct mxs_phy *mxs_phy; |
454 | int ret; | 454 | int ret; |
455 | const struct of_device_id *of_id = | 455 | const struct of_device_id *of_id; |
456 | of_match_device(mxs_phy_dt_ids, &pdev->dev); | ||
457 | struct device_node *np = pdev->dev.of_node; | 456 | struct device_node *np = pdev->dev.of_node; |
458 | 457 | ||
458 | of_id = of_match_device(mxs_phy_dt_ids, &pdev->dev); | ||
459 | if (!of_id) | ||
460 | return -ENODEV; | ||
461 | |||
459 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 462 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
460 | base = devm_ioremap_resource(&pdev->dev, res); | 463 | base = devm_ioremap_resource(&pdev->dev, res); |
461 | if (IS_ERR(base)) | 464 | if (IS_ERR(base)) |
diff --git a/drivers/usb/phy/phy-omap-otg.c b/drivers/usb/phy/phy-omap-otg.c index 1270906ccb95..c4bf2de6d14e 100644 --- a/drivers/usb/phy/phy-omap-otg.c +++ b/drivers/usb/phy/phy-omap-otg.c | |||
@@ -105,7 +105,6 @@ static int omap_otg_probe(struct platform_device *pdev) | |||
105 | extcon = extcon_get_extcon_dev(config->extcon); | 105 | extcon = extcon_get_extcon_dev(config->extcon); |
106 | if (!extcon) | 106 | if (!extcon) |
107 | return -EPROBE_DEFER; | 107 | return -EPROBE_DEFER; |
108 | otg_dev->extcon = extcon; | ||
109 | 108 | ||
110 | otg_dev = devm_kzalloc(&pdev->dev, sizeof(*otg_dev), GFP_KERNEL); | 109 | otg_dev = devm_kzalloc(&pdev->dev, sizeof(*otg_dev), GFP_KERNEL); |
111 | if (!otg_dev) | 110 | if (!otg_dev) |
@@ -115,6 +114,7 @@ static int omap_otg_probe(struct platform_device *pdev) | |||
115 | if (IS_ERR(otg_dev->base)) | 114 | if (IS_ERR(otg_dev->base)) |
116 | return PTR_ERR(otg_dev->base); | 115 | return PTR_ERR(otg_dev->base); |
117 | 116 | ||
117 | otg_dev->extcon = extcon; | ||
118 | otg_dev->id_nb.notifier_call = omap_otg_id_notifier; | 118 | otg_dev->id_nb.notifier_call = omap_otg_id_notifier; |
119 | otg_dev->vbus_nb.notifier_call = omap_otg_vbus_notifier; | 119 | otg_dev->vbus_nb.notifier_call = omap_otg_vbus_notifier; |
120 | 120 | ||
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 685fef71d3d1..f2280606b73c 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -161,6 +161,7 @@ static void option_instat_callback(struct urb *urb); | |||
161 | #define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED 0x9001 | 161 | #define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED 0x9001 |
162 | #define NOVATELWIRELESS_PRODUCT_E362 0x9010 | 162 | #define NOVATELWIRELESS_PRODUCT_E362 0x9010 |
163 | #define NOVATELWIRELESS_PRODUCT_E371 0x9011 | 163 | #define NOVATELWIRELESS_PRODUCT_E371 0x9011 |
164 | #define NOVATELWIRELESS_PRODUCT_U620L 0x9022 | ||
164 | #define NOVATELWIRELESS_PRODUCT_G2 0xA010 | 165 | #define NOVATELWIRELESS_PRODUCT_G2 0xA010 |
165 | #define NOVATELWIRELESS_PRODUCT_MC551 0xB001 | 166 | #define NOVATELWIRELESS_PRODUCT_MC551 0xB001 |
166 | 167 | ||
@@ -354,6 +355,7 @@ static void option_instat_callback(struct urb *urb); | |||
354 | /* This is the 4G XS Stick W14 a.k.a. Mobilcom Debitel Surf-Stick * | 355 | /* This is the 4G XS Stick W14 a.k.a. Mobilcom Debitel Surf-Stick * |
355 | * It seems to contain a Qualcomm QSC6240/6290 chipset */ | 356 | * It seems to contain a Qualcomm QSC6240/6290 chipset */ |
356 | #define FOUR_G_SYSTEMS_PRODUCT_W14 0x9603 | 357 | #define FOUR_G_SYSTEMS_PRODUCT_W14 0x9603 |
358 | #define FOUR_G_SYSTEMS_PRODUCT_W100 0x9b01 | ||
357 | 359 | ||
358 | /* iBall 3.5G connect wireless modem */ | 360 | /* iBall 3.5G connect wireless modem */ |
359 | #define IBALL_3_5G_CONNECT 0x9605 | 361 | #define IBALL_3_5G_CONNECT 0x9605 |
@@ -519,6 +521,11 @@ static const struct option_blacklist_info four_g_w14_blacklist = { | |||
519 | .sendsetup = BIT(0) | BIT(1), | 521 | .sendsetup = BIT(0) | BIT(1), |
520 | }; | 522 | }; |
521 | 523 | ||
524 | static const struct option_blacklist_info four_g_w100_blacklist = { | ||
525 | .sendsetup = BIT(1) | BIT(2), | ||
526 | .reserved = BIT(3), | ||
527 | }; | ||
528 | |||
522 | static const struct option_blacklist_info alcatel_x200_blacklist = { | 529 | static const struct option_blacklist_info alcatel_x200_blacklist = { |
523 | .sendsetup = BIT(0) | BIT(1), | 530 | .sendsetup = BIT(0) | BIT(1), |
524 | .reserved = BIT(4), | 531 | .reserved = BIT(4), |
@@ -1052,6 +1059,7 @@ static const struct usb_device_id option_ids[] = { | |||
1052 | { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC551, 0xff, 0xff, 0xff) }, | 1059 | { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC551, 0xff, 0xff, 0xff) }, |
1053 | { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_E362, 0xff, 0xff, 0xff) }, | 1060 | { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_E362, 0xff, 0xff, 0xff) }, |
1054 | { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_E371, 0xff, 0xff, 0xff) }, | 1061 | { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_E371, 0xff, 0xff, 0xff) }, |
1062 | { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U620L, 0xff, 0x00, 0x00) }, | ||
1055 | 1063 | ||
1056 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) }, | 1064 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) }, |
1057 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) }, | 1065 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) }, |
@@ -1641,6 +1649,9 @@ static const struct usb_device_id option_ids[] = { | |||
1641 | { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14), | 1649 | { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14), |
1642 | .driver_info = (kernel_ulong_t)&four_g_w14_blacklist | 1650 | .driver_info = (kernel_ulong_t)&four_g_w14_blacklist |
1643 | }, | 1651 | }, |
1652 | { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W100), | ||
1653 | .driver_info = (kernel_ulong_t)&four_g_w100_blacklist | ||
1654 | }, | ||
1644 | { USB_DEVICE_INTERFACE_CLASS(LONGCHEER_VENDOR_ID, SPEEDUP_PRODUCT_SU9800, 0xff) }, | 1655 | { USB_DEVICE_INTERFACE_CLASS(LONGCHEER_VENDOR_ID, SPEEDUP_PRODUCT_SU9800, 0xff) }, |
1645 | { USB_DEVICE(LONGCHEER_VENDOR_ID, ZOOM_PRODUCT_4597) }, | 1656 | { USB_DEVICE(LONGCHEER_VENDOR_ID, ZOOM_PRODUCT_4597) }, |
1646 | { USB_DEVICE(LONGCHEER_VENDOR_ID, IBALL_3_5G_CONNECT) }, | 1657 | { USB_DEVICE(LONGCHEER_VENDOR_ID, IBALL_3_5G_CONNECT) }, |
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c index 5022fcfa0260..9919d2a9faf2 100644 --- a/drivers/usb/serial/qcserial.c +++ b/drivers/usb/serial/qcserial.c | |||
@@ -22,6 +22,8 @@ | |||
22 | #define DRIVER_AUTHOR "Qualcomm Inc" | 22 | #define DRIVER_AUTHOR "Qualcomm Inc" |
23 | #define DRIVER_DESC "Qualcomm USB Serial driver" | 23 | #define DRIVER_DESC "Qualcomm USB Serial driver" |
24 | 24 | ||
25 | #define QUECTEL_EC20_PID 0x9215 | ||
26 | |||
25 | /* standard device layouts supported by this driver */ | 27 | /* standard device layouts supported by this driver */ |
26 | enum qcserial_layouts { | 28 | enum qcserial_layouts { |
27 | QCSERIAL_G2K = 0, /* Gobi 2000 */ | 29 | QCSERIAL_G2K = 0, /* Gobi 2000 */ |
@@ -171,6 +173,38 @@ static const struct usb_device_id id_table[] = { | |||
171 | }; | 173 | }; |
172 | MODULE_DEVICE_TABLE(usb, id_table); | 174 | MODULE_DEVICE_TABLE(usb, id_table); |
173 | 175 | ||
176 | static int handle_quectel_ec20(struct device *dev, int ifnum) | ||
177 | { | ||
178 | int altsetting = 0; | ||
179 | |||
180 | /* | ||
181 | * Quectel EC20 Mini PCIe LTE module layout: | ||
182 | * 0: DM/DIAG (use libqcdm from ModemManager for communication) | ||
183 | * 1: NMEA | ||
184 | * 2: AT-capable modem port | ||
185 | * 3: Modem interface | ||
186 | * 4: NDIS | ||
187 | */ | ||
188 | switch (ifnum) { | ||
189 | case 0: | ||
190 | dev_dbg(dev, "Quectel EC20 DM/DIAG interface found\n"); | ||
191 | break; | ||
192 | case 1: | ||
193 | dev_dbg(dev, "Quectel EC20 NMEA GPS interface found\n"); | ||
194 | break; | ||
195 | case 2: | ||
196 | case 3: | ||
197 | dev_dbg(dev, "Quectel EC20 Modem port found\n"); | ||
198 | break; | ||
199 | case 4: | ||
200 | /* Don't claim the QMI/net interface */ | ||
201 | altsetting = -1; | ||
202 | break; | ||
203 | } | ||
204 | |||
205 | return altsetting; | ||
206 | } | ||
207 | |||
174 | static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) | 208 | static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) |
175 | { | 209 | { |
176 | struct usb_host_interface *intf = serial->interface->cur_altsetting; | 210 | struct usb_host_interface *intf = serial->interface->cur_altsetting; |
@@ -181,6 +215,10 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) | |||
181 | int altsetting = -1; | 215 | int altsetting = -1; |
182 | bool sendsetup = false; | 216 | bool sendsetup = false; |
183 | 217 | ||
218 | /* we only support vendor specific functions */ | ||
219 | if (intf->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC) | ||
220 | goto done; | ||
221 | |||
184 | nintf = serial->dev->actconfig->desc.bNumInterfaces; | 222 | nintf = serial->dev->actconfig->desc.bNumInterfaces; |
185 | dev_dbg(dev, "Num Interfaces = %d\n", nintf); | 223 | dev_dbg(dev, "Num Interfaces = %d\n", nintf); |
186 | ifnum = intf->desc.bInterfaceNumber; | 224 | ifnum = intf->desc.bInterfaceNumber; |
@@ -240,6 +278,12 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) | |||
240 | altsetting = -1; | 278 | altsetting = -1; |
241 | break; | 279 | break; |
242 | case QCSERIAL_G2K: | 280 | case QCSERIAL_G2K: |
281 | /* handle non-standard layouts */ | ||
282 | if (nintf == 5 && id->idProduct == QUECTEL_EC20_PID) { | ||
283 | altsetting = handle_quectel_ec20(dev, ifnum); | ||
284 | goto done; | ||
285 | } | ||
286 | |||
243 | /* | 287 | /* |
244 | * Gobi 2K+ USB layout: | 288 | * Gobi 2K+ USB layout: |
245 | * 0: QMI/net | 289 | * 0: QMI/net |
@@ -301,29 +345,39 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) | |||
301 | break; | 345 | break; |
302 | case QCSERIAL_HWI: | 346 | case QCSERIAL_HWI: |
303 | /* | 347 | /* |
304 | * Huawei layout: | 348 | * Huawei devices map functions by subclass + protocol |
305 | * 0: AT-capable modem port | 349 | * instead of interface numbers. The protocol identify |
306 | * 1: DM/DIAG | 350 | * a specific function, while the subclass indicate a |
307 | * 2: AT-capable modem port | 351 | * specific firmware source |
308 | * 3: CCID-compatible PCSC interface | 352 | * |
309 | * 4: QMI/net | 353 | * This is a blacklist of functions known to be |
310 | * 5: NMEA | 354 | * non-serial. The rest are assumed to be serial and |
355 | * will be handled by this driver | ||
311 | */ | 356 | */ |
312 | switch (ifnum) { | 357 | switch (intf->desc.bInterfaceProtocol) { |
313 | case 0: | 358 | /* QMI combined (qmi_wwan) */ |
314 | case 2: | 359 | case 0x07: |
315 | dev_dbg(dev, "Modem port found\n"); | 360 | case 0x37: |
316 | break; | 361 | case 0x67: |
317 | case 1: | 362 | /* QMI data (qmi_wwan) */ |
318 | dev_dbg(dev, "DM/DIAG interface found\n"); | 363 | case 0x08: |
319 | break; | 364 | case 0x38: |
320 | case 5: | 365 | case 0x68: |
321 | dev_dbg(dev, "NMEA GPS interface found\n"); | 366 | /* QMI control (qmi_wwan) */ |
322 | break; | 367 | case 0x09: |
323 | default: | 368 | case 0x39: |
324 | /* don't claim any unsupported interface */ | 369 | case 0x69: |
370 | /* NCM like (huawei_cdc_ncm) */ | ||
371 | case 0x16: | ||
372 | case 0x46: | ||
373 | case 0x76: | ||
325 | altsetting = -1; | 374 | altsetting = -1; |
326 | break; | 375 | break; |
376 | default: | ||
377 | dev_dbg(dev, "Huawei type serial port found (%02x/%02x/%02x)\n", | ||
378 | intf->desc.bInterfaceClass, | ||
379 | intf->desc.bInterfaceSubClass, | ||
380 | intf->desc.bInterfaceProtocol); | ||
327 | } | 381 | } |
328 | break; | 382 | break; |
329 | default: | 383 | default: |
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index e9da41d9fe7f..2694df2f4559 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.c +++ b/drivers/usb/serial/ti_usb_3410_5052.c | |||
@@ -159,6 +159,7 @@ static const struct usb_device_id ti_id_table_3410[] = { | |||
159 | { USB_DEVICE(ABBOTT_VENDOR_ID, ABBOTT_STEREO_PLUG_ID) }, | 159 | { USB_DEVICE(ABBOTT_VENDOR_ID, ABBOTT_STEREO_PLUG_ID) }, |
160 | { USB_DEVICE(ABBOTT_VENDOR_ID, ABBOTT_STRIP_PORT_ID) }, | 160 | { USB_DEVICE(ABBOTT_VENDOR_ID, ABBOTT_STRIP_PORT_ID) }, |
161 | { USB_DEVICE(TI_VENDOR_ID, FRI2_PRODUCT_ID) }, | 161 | { USB_DEVICE(TI_VENDOR_ID, FRI2_PRODUCT_ID) }, |
162 | { USB_DEVICE(HONEYWELL_VENDOR_ID, HONEYWELL_HGI80_PRODUCT_ID) }, | ||
162 | { } /* terminator */ | 163 | { } /* terminator */ |
163 | }; | 164 | }; |
164 | 165 | ||
@@ -191,6 +192,7 @@ static const struct usb_device_id ti_id_table_combined[] = { | |||
191 | { USB_DEVICE(ABBOTT_VENDOR_ID, ABBOTT_PRODUCT_ID) }, | 192 | { USB_DEVICE(ABBOTT_VENDOR_ID, ABBOTT_PRODUCT_ID) }, |
192 | { USB_DEVICE(ABBOTT_VENDOR_ID, ABBOTT_STRIP_PORT_ID) }, | 193 | { USB_DEVICE(ABBOTT_VENDOR_ID, ABBOTT_STRIP_PORT_ID) }, |
193 | { USB_DEVICE(TI_VENDOR_ID, FRI2_PRODUCT_ID) }, | 194 | { USB_DEVICE(TI_VENDOR_ID, FRI2_PRODUCT_ID) }, |
195 | { USB_DEVICE(HONEYWELL_VENDOR_ID, HONEYWELL_HGI80_PRODUCT_ID) }, | ||
194 | { } /* terminator */ | 196 | { } /* terminator */ |
195 | }; | 197 | }; |
196 | 198 | ||
diff --git a/drivers/usb/serial/ti_usb_3410_5052.h b/drivers/usb/serial/ti_usb_3410_5052.h index 4a2423e84d55..98f35c656c02 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.h +++ b/drivers/usb/serial/ti_usb_3410_5052.h | |||
@@ -56,6 +56,10 @@ | |||
56 | #define ABBOTT_PRODUCT_ID ABBOTT_STEREO_PLUG_ID | 56 | #define ABBOTT_PRODUCT_ID ABBOTT_STEREO_PLUG_ID |
57 | #define ABBOTT_STRIP_PORT_ID 0x3420 | 57 | #define ABBOTT_STRIP_PORT_ID 0x3420 |
58 | 58 | ||
59 | /* Honeywell vendor and product IDs */ | ||
60 | #define HONEYWELL_VENDOR_ID 0x10ac | ||
61 | #define HONEYWELL_HGI80_PRODUCT_ID 0x0102 /* Honeywell HGI80 */ | ||
62 | |||
59 | /* Commands */ | 63 | /* Commands */ |
60 | #define TI_GET_VERSION 0x01 | 64 | #define TI_GET_VERSION 0x01 |
61 | #define TI_GET_PORT_STATUS 0x02 | 65 | #define TI_GET_PORT_STATUS 0x02 |