1 From 2c7f1bd9127a1a49ee25d9c2b2ce17b11c7fb05f Mon Sep 17 00:00:00 2001
2 From: John Youn <John.Youn@synopsys.com>
3 Date: Fri, 5 Feb 2016 17:08:59 -0800
4 Subject: usb: dwc3: Update maximum_speed for SuperSpeedPlus
6 If the maximum_speed is not set, set it to a known value, either
7 SuperSpeed or SuperSpeedPlus based on the type of controller we are
8 using. If we are on DWC_usb31 controller, check the PHY interface to see
9 if it is capable of SuperSpeedPlus.
11 Also this check is moved after dwc3_core_init() so that we can check
14 Signed-off-by: John Youn <johnyoun@synopsys.com>
15 Signed-off-by: Felipe Balbi <balbi@kernel.org>
17 drivers/usb/dwc3/core.c | 17 +++++++++++++----
18 1 file changed, 13 insertions(+), 4 deletions(-)
20 diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
21 index de5e01f..001c755 100644
22 --- a/drivers/usb/dwc3/core.c
23 +++ b/drivers/usb/dwc3/core.c
24 @@ -962,10 +962,6 @@ static int dwc3_probe(struct platform_device *pdev)
25 fladj = pdata->fladj_value;
28 - /* default to superspeed if no maximum_speed passed */
29 - if (dwc->maximum_speed == USB_SPEED_UNKNOWN)
30 - dwc->maximum_speed = USB_SPEED_SUPER;
32 dwc->lpm_nyet_threshold = lpm_nyet_threshold;
33 dwc->tx_de_emphasis = tx_de_emphasis;
35 @@ -1016,6 +1012,19 @@ static int dwc3_probe(struct platform_device *pdev)
39 + /* default to superspeed if no maximum_speed passed */
40 + if (dwc->maximum_speed == USB_SPEED_UNKNOWN) {
41 + dwc->maximum_speed = USB_SPEED_SUPER;
44 + * default to superspeed plus if we are capable.
46 + if (dwc3_is_usb31(dwc) &&
47 + (DWC3_GHWPARAMS3_SSPHY_IFC(dwc->hwparams.hwparams3) ==
48 + DWC3_GHWPARAMS3_SSPHY_IFC_GEN2))
49 + dwc->maximum_speed = USB_SPEED_SUPER_PLUS;
52 /* Adjust Frame Length */
53 dwc3_frame_length_adjustment(dwc, fladj);