mirror of
https://github.com/torvalds/linux.git
synced 2024-12-11 13:41:55 +00:00
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>
This commit is contained in:
parent
8d7212bc41
commit
122f06e60f
@ -534,32 +534,26 @@ static int dwc3_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
if (IS_ERR(dwc->usb2_phy)) {
|
if (IS_ERR(dwc->usb2_phy)) {
|
||||||
ret = PTR_ERR(dwc->usb2_phy);
|
ret = PTR_ERR(dwc->usb2_phy);
|
||||||
|
if (ret == -ENXIO || ret == -ENODEV) {
|
||||||
/*
|
dwc->usb2_phy = NULL;
|
||||||
* if -ENXIO is returned, it means PHY layer wasn't
|
} else if (ret == -EPROBE_DEFER) {
|
||||||
* enabled, so it makes no sense to return -EPROBE_DEFER
|
|
||||||
* in that case, since no PHY driver will ever probe.
|
|
||||||
*/
|
|
||||||
if (ret == -ENXIO)
|
|
||||||
return ret;
|
return ret;
|
||||||
|
} else {
|
||||||
dev_err(dev, "no usb2 phy configured\n");
|
dev_err(dev, "no usb2 phy configured\n");
|
||||||
return -EPROBE_DEFER;
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IS_ERR(dwc->usb3_phy)) {
|
if (IS_ERR(dwc->usb3_phy)) {
|
||||||
ret = PTR_ERR(dwc->usb3_phy);
|
ret = PTR_ERR(dwc->usb3_phy);
|
||||||
|
if (ret == -ENXIO || ret == -ENODEV) {
|
||||||
/*
|
dwc->usb3_phy = NULL;
|
||||||
* if -ENXIO is returned, it means PHY layer wasn't
|
} else if (ret == -EPROBE_DEFER) {
|
||||||
* enabled, so it makes no sense to return -EPROBE_DEFER
|
|
||||||
* in that case, since no PHY driver will ever probe.
|
|
||||||
*/
|
|
||||||
if (ret == -ENXIO)
|
|
||||||
return ret;
|
return ret;
|
||||||
|
} else {
|
||||||
dev_err(dev, "no usb3 phy configured\n");
|
dev_err(dev, "no usb3 phy configured\n");
|
||||||
return -EPROBE_DEFER;
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dwc->xhci_resources[0].start = res->start;
|
dwc->xhci_resources[0].start = res->start;
|
||||||
|
Loading…
Reference in New Issue
Block a user