096-02-usb-dwc3-Update-maximum_speed-for-SuperSpeedPlus.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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
  5. If the maximum_speed is not set, set it to a known value, either
  6. SuperSpeed or SuperSpeedPlus based on the type of controller we are
  7. using. If we are on DWC_usb31 controller, check the PHY interface to see
  8. if it is capable of SuperSpeedPlus.
  9. Also this check is moved after dwc3_core_init() so that we can check
  10. dwc->revision.
  11. Signed-off-by: John Youn <johnyoun@synopsys.com>
  12. Signed-off-by: Felipe Balbi <balbi@kernel.org>
  13. ---
  14. drivers/usb/dwc3/core.c | 17 +++++++++++++----
  15. 1 file changed, 13 insertions(+), 4 deletions(-)
  16. --- a/drivers/usb/dwc3/core.c
  17. +++ b/drivers/usb/dwc3/core.c
  18. @@ -962,10 +962,6 @@ static int dwc3_probe(struct platform_de
  19. fladj = pdata->fladj_value;
  20. }
  21. - /* default to superspeed if no maximum_speed passed */
  22. - if (dwc->maximum_speed == USB_SPEED_UNKNOWN)
  23. - dwc->maximum_speed = USB_SPEED_SUPER;
  24. -
  25. dwc->lpm_nyet_threshold = lpm_nyet_threshold;
  26. dwc->tx_de_emphasis = tx_de_emphasis;
  27. @@ -1016,6 +1012,19 @@ static int dwc3_probe(struct platform_de
  28. goto err1;
  29. }
  30. + /* default to superspeed if no maximum_speed passed */
  31. + if (dwc->maximum_speed == USB_SPEED_UNKNOWN) {
  32. + dwc->maximum_speed = USB_SPEED_SUPER;
  33. +
  34. + /*
  35. + * default to superspeed plus if we are capable.
  36. + */
  37. + if (dwc3_is_usb31(dwc) &&
  38. + (DWC3_GHWPARAMS3_SSPHY_IFC(dwc->hwparams.hwparams3) ==
  39. + DWC3_GHWPARAMS3_SSPHY_IFC_GEN2))
  40. + dwc->maximum_speed = USB_SPEED_SUPER_PLUS;
  41. + }
  42. +
  43. /* Adjust Frame Length */
  44. dwc3_frame_length_adjustment(dwc, fladj);