diff options
author | Kishon Vijay Abraham I <kishon@ti.com> | 2014-03-03 06:38:10 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2014-03-05 15:40:05 -0500 |
commit | 122f06e60f90a43d9b2fb30662af688dfb759379 (patch) | |
tree | e22684f6565d224a3205e98c3cedf5ea3d9870a6 /drivers/usb/dwc3/core.c | |
parent | 8d7212bc4107b343e93c13aa30c70b845f7f94ad (diff) |
usb: dwc3: core: support optional PHYs
Since PHYs for dwc3 is optional (not all SoCs having PHYs for DWC3
should be programmed), do not return from probe if the USB PHY library
returns -ENODEV as that indicates the platform does not have a
programmable PHY.
While this can be considered as a temporary fix, a long term solution
would be to add 'nop' PHY for platforms that does not have programmable
PHY.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Reviewed-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3/core.c')
-rw-r--r-- | drivers/usb/dwc3/core.c | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 8c627c9a5130..c89570cc0689 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c | |||
@@ -534,32 +534,26 @@ static int dwc3_probe(struct platform_device *pdev) | |||
534 | 534 | ||
535 | if (IS_ERR(dwc->usb2_phy)) { | 535 | if (IS_ERR(dwc->usb2_phy)) { |
536 | ret = PTR_ERR(dwc->usb2_phy); | 536 | ret = PTR_ERR(dwc->usb2_phy); |
537 | 537 | if (ret == -ENXIO || ret == -ENODEV) { | |
538 | /* | 538 | dwc->usb2_phy = NULL; |
539 | * if -ENXIO is returned, it means PHY layer wasn't | 539 | } else if (ret == -EPROBE_DEFER) { |
540 | * enabled, so it makes no sense to return -EPROBE_DEFER | ||
541 | * in that case, since no PHY driver will ever probe. | ||
542 | */ | ||
543 | if (ret == -ENXIO) | ||
544 | return ret; | 540 | return ret; |
545 | 541 | } else { | |
546 | dev_err(dev, "no usb2 phy configured\n"); | 542 | dev_err(dev, "no usb2 phy configured\n"); |
547 | return -EPROBE_DEFER; | 543 | return ret; |
544 | } | ||
548 | } | 545 | } |
549 | 546 | ||
550 | if (IS_ERR(dwc->usb3_phy)) { | 547 | if (IS_ERR(dwc->usb3_phy)) { |
551 | ret = PTR_ERR(dwc->usb3_phy); | 548 | ret = PTR_ERR(dwc->usb3_phy); |
552 | 549 | if (ret == -ENXIO || ret == -ENODEV) { | |
553 | /* | 550 | dwc->usb3_phy = NULL; |
554 | * if -ENXIO is returned, it means PHY layer wasn't | 551 | } else if (ret == -EPROBE_DEFER) { |
555 | * enabled, so it makes no sense to return -EPROBE_DEFER | ||
556 | * in that case, since no PHY driver will ever probe. | ||
557 | */ | ||
558 | if (ret == -ENXIO) | ||
559 | return ret; | 552 | return ret; |
560 | 553 | } else { | |
561 | dev_err(dev, "no usb3 phy configured\n"); | 554 | dev_err(dev, "no usb3 phy configured\n"); |
562 | return -EPROBE_DEFER; | 555 | return ret; |
556 | } | ||
563 | } | 557 | } |
564 | 558 | ||
565 | dwc->xhci_resources[0].start = res->start; | 559 | dwc->xhci_resources[0].start = res->start; |