Skip to content

Commit

Permalink
usb: dwc3: Update maximum_speed for SuperSpeedPlus
Browse files Browse the repository at this point in the history
If the maximum_speed is not set, set it to a known value, either
SuperSpeed or SuperSpeedPlus based on the type of controller we are
using. If we are on DWC_usb31 controller, check the PHY interface to see
if it is capable of SuperSpeedPlus.

Also this check is moved after dwc3_core_init() so that we can check
dwc->revision.

Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
  • Loading branch information
John Youn authored and Felipe Balbi committed Mar 4, 2016
1 parent ee5cd41 commit 2c7f1bd
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions drivers/usb/dwc3/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -962,10 +962,6 @@ static int dwc3_probe(struct platform_device *pdev)
fladj = pdata->fladj_value;
}

/* default to superspeed if no maximum_speed passed */
if (dwc->maximum_speed == USB_SPEED_UNKNOWN)
dwc->maximum_speed = USB_SPEED_SUPER;

dwc->lpm_nyet_threshold = lpm_nyet_threshold;
dwc->tx_de_emphasis = tx_de_emphasis;

Expand Down Expand Up @@ -1016,6 +1012,19 @@ static int dwc3_probe(struct platform_device *pdev)
goto err1;
}

/* default to superspeed if no maximum_speed passed */
if (dwc->maximum_speed == USB_SPEED_UNKNOWN) {
dwc->maximum_speed = USB_SPEED_SUPER;

/*
* default to superspeed plus if we are capable.
*/
if (dwc3_is_usb31(dwc) &&
(DWC3_GHWPARAMS3_SSPHY_IFC(dwc->hwparams.hwparams3) ==
DWC3_GHWPARAMS3_SSPHY_IFC_GEN2))
dwc->maximum_speed = USB_SPEED_SUPER_PLUS;
}

/* Adjust Frame Length */
dwc3_frame_length_adjustment(dwc, fladj);

Expand Down

0 comments on commit 2c7f1bd

Please sign in to comment.