aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorMing Lei <ming.lei@canonical.com>2013-01-04 10:13:58 -0500
committerFelipe Balbi <balbi@ti.com>2013-01-17 08:45:45 -0500
commit25736e0c8269e9613aa6036fbc591818daa30d14 (patch)
treee8408fdcc7f33ef2a75bcf1309d9c246dfac9b86 /drivers/usb
parent681d1e8761ca773967bce9bd1bb2896f07279551 (diff)
usb: musb: fix dependency on transceiver driver
This patch let glue driver return -EPROBE_DEFER if the transceiver is not readly, so we can support defer probe on musb to fix the below error on 3.7-rc5 if transceiver drivers are built as module: [ 19.052490] unable to find transceiver of type USB2 PHY [ 19.072052] HS USB OTG: no transceiver configured [ 19.076995] musb-hdrc musb-hdrc.0.auto: musb_init_controller failed with status -19 [ 19.089355] musb-hdrc: probe of musb-hdrc.0.auto rejects match -19 [ 19.096771] driver: 'musb-omap2430': driver_bound: bound to device 'musb-omap2430' [ 19.105194] bus: 'platform': really_probe: bound device musb-omap2430 to driver musb-omap2430 [ 19.174407] bus: 'platform': add driver twl4030_usb [ 19.179656] bus: 'platform': driver_probe_device: matched device twl4030_usb with driver twl4030_usb [ 19.202270] bus: 'platform': really_probe: probing driver twl4030_usb with device twl4030_usb [ 19.214172] twl4030_usb twl4030_usb: HW_CONDITIONS 0xc0/192; link 3 [ 19.239624] musb-omap2430 musb-omap2430: musb core is not yet ready [ 19.246765] twl4030_usb twl4030_usb: Initialized TWL4030 USB module [ 19.254516] driver: 'twl4030_usb': driver_bound: bound to device 'twl4030_usb' [ 19.263580] bus: 'platform': really_probe: bound device twl4030_usb to driver twl4030_usb Cc: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Cc: <stable@vger.kernel.org> v3.8 Signed-off-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/musb/am35x.c2
-rw-r--r--drivers/usb/musb/blackfin.c2
-rw-r--r--drivers/usb/musb/da8xx.c7
-rw-r--r--drivers/usb/musb/davinci.c7
-rw-r--r--drivers/usb/musb/musb_dsps.c2
-rw-r--r--drivers/usb/musb/omap2430.c2
-rw-r--r--drivers/usb/musb/tusb6010.c2
-rw-r--r--drivers/usb/musb/ux500.c2
8 files changed, 16 insertions, 10 deletions
diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c
index c107d7cdfa69..59eea219034a 100644
--- a/drivers/usb/musb/am35x.c
+++ b/drivers/usb/musb/am35x.c
@@ -365,7 +365,7 @@ static int am35x_musb_init(struct musb *musb)
365 usb_nop_xceiv_register(); 365 usb_nop_xceiv_register();
366 musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); 366 musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
367 if (IS_ERR_OR_NULL(musb->xceiv)) 367 if (IS_ERR_OR_NULL(musb->xceiv))
368 return -ENODEV; 368 return -EPROBE_DEFER;
369 369
370 setup_timer(&otg_workaround, otg_timer, (unsigned long) musb); 370 setup_timer(&otg_workaround, otg_timer, (unsigned long) musb);
371 371
diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c
index 14dab9f9b3d0..dbb31b30c7fa 100644
--- a/drivers/usb/musb/blackfin.c
+++ b/drivers/usb/musb/blackfin.c
@@ -406,7 +406,7 @@ static int bfin_musb_init(struct musb *musb)
406 musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); 406 musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
407 if (IS_ERR_OR_NULL(musb->xceiv)) { 407 if (IS_ERR_OR_NULL(musb->xceiv)) {
408 gpio_free(musb->config->gpio_vrsel); 408 gpio_free(musb->config->gpio_vrsel);
409 return -ENODEV; 409 return -EPROBE_DEFER;
410 } 410 }
411 411
412 bfin_musb_reg_init(musb); 412 bfin_musb_reg_init(musb);
diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
index 97996af2646e..7c71769d71ff 100644
--- a/drivers/usb/musb/da8xx.c
+++ b/drivers/usb/musb/da8xx.c
@@ -410,6 +410,7 @@ static int da8xx_musb_init(struct musb *musb)
410{ 410{
411 void __iomem *reg_base = musb->ctrl_base; 411 void __iomem *reg_base = musb->ctrl_base;
412 u32 rev; 412 u32 rev;
413 int ret = -ENODEV;
413 414
414 musb->mregs += DA8XX_MENTOR_CORE_OFFSET; 415 musb->mregs += DA8XX_MENTOR_CORE_OFFSET;
415 416
@@ -420,8 +421,10 @@ static int da8xx_musb_init(struct musb *musb)
420 421
421 usb_nop_xceiv_register(); 422 usb_nop_xceiv_register();
422 musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); 423 musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
423 if (IS_ERR_OR_NULL(musb->xceiv)) 424 if (IS_ERR_OR_NULL(musb->xceiv)) {
425 ret = -EPROBE_DEFER;
424 goto fail; 426 goto fail;
427 }
425 428
426 setup_timer(&otg_workaround, otg_timer, (unsigned long)musb); 429 setup_timer(&otg_workaround, otg_timer, (unsigned long)musb);
427 430
@@ -441,7 +444,7 @@ static int da8xx_musb_init(struct musb *musb)
441 musb->isr = da8xx_musb_interrupt; 444 musb->isr = da8xx_musb_interrupt;
442 return 0; 445 return 0;
443fail: 446fail:
444 return -ENODEV; 447 return ret;
445} 448}
446 449
447static int da8xx_musb_exit(struct musb *musb) 450static int da8xx_musb_exit(struct musb *musb)
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
index b1c01cad28b2..e040d9103735 100644
--- a/drivers/usb/musb/davinci.c
+++ b/drivers/usb/musb/davinci.c
@@ -380,11 +380,14 @@ static int davinci_musb_init(struct musb *musb)
380{ 380{
381 void __iomem *tibase = musb->ctrl_base; 381 void __iomem *tibase = musb->ctrl_base;
382 u32 revision; 382 u32 revision;
383 int ret = -ENODEV;
383 384
384 usb_nop_xceiv_register(); 385 usb_nop_xceiv_register();
385 musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); 386 musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
386 if (IS_ERR_OR_NULL(musb->xceiv)) 387 if (IS_ERR_OR_NULL(musb->xceiv)) {
388 ret = -EPROBE_DEFER;
387 goto unregister; 389 goto unregister;
390 }
388 391
389 musb->mregs += DAVINCI_BASE_OFFSET; 392 musb->mregs += DAVINCI_BASE_OFFSET;
390 393
@@ -438,7 +441,7 @@ fail:
438 usb_put_phy(musb->xceiv); 441 usb_put_phy(musb->xceiv);
439unregister: 442unregister:
440 usb_nop_xceiv_unregister(); 443 usb_nop_xceiv_unregister();
441 return -ENODEV; 444 return ret;
442} 445}
443 446
444static int davinci_musb_exit(struct musb *musb) 447static int davinci_musb_exit(struct musb *musb)
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index dd1392b75f57..971ca9b539f7 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -413,7 +413,7 @@ static int dsps_musb_init(struct musb *musb)
413 usb_nop_xceiv_register(); 413 usb_nop_xceiv_register();
414 musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); 414 musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
415 if (IS_ERR_OR_NULL(musb->xceiv)) 415 if (IS_ERR_OR_NULL(musb->xceiv))
416 return -ENODEV; 416 return -EPROBE_DEFER;
417 417
418 /* Returns zero if e.g. not clocked */ 418 /* Returns zero if e.g. not clocked */
419 rev = dsps_readl(reg_base, wrp->revision); 419 rev = dsps_readl(reg_base, wrp->revision);
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index cd06166affee..b15bb05dc5e8 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -369,7 +369,7 @@ static int omap2430_musb_init(struct musb *musb)
369 musb->xceiv = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2); 369 musb->xceiv = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2);
370 if (IS_ERR_OR_NULL(musb->xceiv)) { 370 if (IS_ERR_OR_NULL(musb->xceiv)) {
371 pr_err("HS USB OTG: no transceiver configured\n"); 371 pr_err("HS USB OTG: no transceiver configured\n");
372 return -ENODEV; 372 return -EPROBE_DEFER;
373 } 373 }
374 374
375 musb->isr = omap2430_musb_interrupt; 375 musb->isr = omap2430_musb_interrupt;
diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c
index 3969813c217d..464bd23cccda 100644
--- a/drivers/usb/musb/tusb6010.c
+++ b/drivers/usb/musb/tusb6010.c
@@ -1069,7 +1069,7 @@ static int tusb_musb_init(struct musb *musb)
1069 usb_nop_xceiv_register(); 1069 usb_nop_xceiv_register();
1070 musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); 1070 musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
1071 if (IS_ERR_OR_NULL(musb->xceiv)) 1071 if (IS_ERR_OR_NULL(musb->xceiv))
1072 return -ENODEV; 1072 return -EPROBE_DEFER;
1073 1073
1074 pdev = to_platform_device(musb->controller); 1074 pdev = to_platform_device(musb->controller);
1075 1075
diff --git a/drivers/usb/musb/ux500.c b/drivers/usb/musb/ux500.c
index 0804661b6d21..13a392913769 100644
--- a/drivers/usb/musb/ux500.c
+++ b/drivers/usb/musb/ux500.c
@@ -61,7 +61,7 @@ static int ux500_musb_init(struct musb *musb)
61 musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); 61 musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
62 if (IS_ERR_OR_NULL(musb->xceiv)) { 62 if (IS_ERR_OR_NULL(musb->xceiv)) {
63 pr_err("HS USB OTG: no transceiver configured\n"); 63 pr_err("HS USB OTG: no transceiver configured\n");
64 return -ENODEV; 64 return -EPROBE_DEFER;
65 } 65 }
66 66
67 musb->isr = ux500_musb_interrupt; 67 musb->isr = ux500_musb_interrupt;