bcm53xx: add linux 4.4 support
[openwrt/svn-archive/archive.git] / target / linux / bcm53xx / patches-4.4 / 190-usb-xhci-plat-fix-adding-usb3-lpm-capable-quirk.patch
1 From 1420e53fc88673683f8990aa5342e7b2640ce165 Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Sun, 18 Oct 2015 19:13:27 +0200
4 Subject: [PATCH v3 1/6] usb: xhci: plat: fix adding usb3-lpm-capable quirk
5
6 The xhci->quirks member is overwritten in xhci_gen_setup() with the
7 quirks given through the module load parameter. Without this patch the
8 usb3-lpm-capable quirk will be over written before it gets used. This
9 patch moves the quirks code to the xhci_plat_quirks() callback function
10 which gets called directly after the quirks member variable is
11 overwritten with the module load parameter.
12
13 I do not have any hardware which is using usb3-lpm-capabls so I can not
14 test this on real hardware.
15
16 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
17 ---
18 drivers/usb/host/xhci-plat.c | 14 ++++++++------
19 1 file changed, 8 insertions(+), 6 deletions(-)
20
21 --- a/drivers/usb/host/xhci-plat.c
22 +++ b/drivers/usb/host/xhci-plat.c
23 @@ -38,12 +38,20 @@ static const struct xhci_driver_override
24
25 static void xhci_plat_quirks(struct device *dev, struct xhci_hcd *xhci)
26 {
27 + struct platform_device *pdev = to_platform_device(dev);
28 + struct device_node *node = pdev->dev.of_node;
29 + struct usb_xhci_pdata *pdata = dev_get_platdata(&pdev->dev);
30 +
31 /*
32 * As of now platform drivers don't provide MSI support so we ensure
33 * here that the generic code does not try to make a pci_dev from our
34 * dev struct in order to setup MSI
35 */
36 xhci->quirks |= XHCI_PLAT;
37 +
38 + if ((node && of_property_read_bool(node, "usb3-lpm-capable")) ||
39 + (pdata && pdata->usb3_lpm_capable))
40 + xhci->quirks |= XHCI_LPM_SUPPORT;
41 }
42
43 /* called during probe() after chip reset completes */
44 @@ -75,8 +83,6 @@ static int xhci_plat_start(struct usb_hc
45
46 static int xhci_plat_probe(struct platform_device *pdev)
47 {
48 - struct device_node *node = pdev->dev.of_node;
49 - struct usb_xhci_pdata *pdata = dev_get_platdata(&pdev->dev);
50 const struct hc_driver *driver;
51 struct xhci_hcd *xhci;
52 struct resource *res;
53 @@ -155,10 +161,6 @@ static int xhci_plat_probe(struct platfo
54 goto disable_clk;
55 }
56
57 - if ((node && of_property_read_bool(node, "usb3-lpm-capable")) ||
58 - (pdata && pdata->usb3_lpm_capable))
59 - xhci->quirks |= XHCI_LPM_SUPPORT;
60 -
61 if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
62 xhci->shared_hcd->can_do_streams = 1;
63