mxs: delete old kernel versions
[openwrt/openwrt.git] / target / linux / bcm53xx / patches-4.1 / 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 @@ -28,12 +28,20 @@ static struct hc_driver __read_mostly xh
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 @@ -65,8 +73,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 @@ -144,9 +150,6 @@ static int xhci_plat_probe(struct platfo
54 goto dealloc_usb2_hcd;
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 * Set the xHCI pointer before xhci_plat_setup() (aka hcd_driver.reset)
62 * is called by usb_add_hcd().