OSDN Git Service

usb: dwc3: Fall back to high speed when SSPHY fails
authorMayank Rana <mrana@codeaurora.org>
Wed, 11 Feb 2015 00:51:10 +0000 (16:51 -0800)
committerDavid Keitel <dkeitel@codeaurora.org>
Tue, 22 Mar 2016 18:06:43 +0000 (11:06 -0700)
In some cases, it has been observed that SSPHY fails to initialized.
This change detects this condition and configures controller to work
into high speed mode only.

Change-Id: I50c4041d8572d0cdc4535812eebd10fc18b78e98
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
drivers/usb/dwc3/core.c

index 6ae3202..5fa3423 100644 (file)
@@ -107,8 +107,15 @@ static int dwc3_init_usb_phys(struct dwc3 *dwc)
                                __func__, ret);
                return ret;
        }
+
        ret = usb_phy_init(dwc->usb3_phy);
-       if (ret) {
+       if (ret == -EBUSY) {
+               /*
+                * Setting Max speed as high when USB3 PHY initialiation
+                * is failing and USB superspeed can't be supported.
+                */
+               dwc->maximum_speed = USB_SPEED_HIGH;
+       } else if (ret) {
                pr_err("%s: usb_phy_init(dwc->usb3_phy) returned %d\n",
                                __func__, ret);
                return ret;