ramips: revert faulty 4.4 config change from 9c242270907
[oweals/openwrt.git] / target / linux / ipq806x / patches-4.4 / 096-02-usb-dwc3-Update-maximum_speed-for-SuperSpeedPlus.patch
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
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.
10
11 Also this check is moved after dwc3_core_init() so that we can check
12 dwc->revision.
13
14 Signed-off-by: John Youn <johnyoun@synopsys.com>
15 Signed-off-by: Felipe Balbi <balbi@kernel.org>
16 ---
17  drivers/usb/dwc3/core.c | 17 +++++++++++++----
18  1 file changed, 13 insertions(+), 4 deletions(-)
19
20 --- a/drivers/usb/dwc3/core.c
21 +++ b/drivers/usb/dwc3/core.c
22 @@ -962,10 +962,6 @@ static int dwc3_probe(struct platform_de
23                 fladj = pdata->fladj_value;
24         }
25  
26 -       /* default to superspeed if no maximum_speed passed */
27 -       if (dwc->maximum_speed == USB_SPEED_UNKNOWN)
28 -               dwc->maximum_speed = USB_SPEED_SUPER;
29 -
30         dwc->lpm_nyet_threshold = lpm_nyet_threshold;
31         dwc->tx_de_emphasis = tx_de_emphasis;
32  
33 @@ -1016,6 +1012,19 @@ static int dwc3_probe(struct platform_de
34                 goto err1;
35         }
36  
37 +       /* default to superspeed if no maximum_speed passed */
38 +       if (dwc->maximum_speed == USB_SPEED_UNKNOWN) {
39 +               dwc->maximum_speed = USB_SPEED_SUPER;
40 +
41 +               /*
42 +                * default to superspeed plus if we are capable.
43 +                */
44 +               if (dwc3_is_usb31(dwc) &&
45 +                   (DWC3_GHWPARAMS3_SSPHY_IFC(dwc->hwparams.hwparams3) ==
46 +                    DWC3_GHWPARAMS3_SSPHY_IFC_GEN2))
47 +                       dwc->maximum_speed = USB_SPEED_SUPER_PLUS;
48 +       }
49 +
50         /* Adjust Frame Length */
51         dwc3_frame_length_adjustment(dwc, fladj);
52