bcm53xx: use the latest submitted version of ILP clock driver
[openwrt/openwrt.git] / target / linux / bcm53xx / patches-4.4 / 082-0001-USB-bcma-initialize-Northstar-USB-3.0-controller.patch
1 From 3cc7e7b7872ebd0f200b5450f5471bc3700de141 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
3 Date: Fri, 8 Jul 2016 14:02:50 +0200
4 Subject: [PATCH] USB: bcma: initialize Northstar USB 3.0 controller
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 It's a rather simple controller, we just need to make sure USB is
10 powered (using GPIO pin) and reset bus core. Once this is done it's
11 safe to register XHCI controller and let it init PHY and do its magic.
12
13 Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
14 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
15 ---
16 drivers/usb/host/bcma-hcd.c | 19 +++++++++++++++++++
17 1 file changed, 19 insertions(+)
18
19 --- a/drivers/usb/host/bcma-hcd.c
20 +++ b/drivers/usb/host/bcma-hcd.c
21 @@ -27,6 +27,7 @@
22 #include <linux/slab.h>
23 #include <linux/of.h>
24 #include <linux/of_gpio.h>
25 +#include <linux/of_platform.h>
26 #include <linux/usb/ehci_pdriver.h>
27 #include <linux/usb/ohci_pdriver.h>
28
29 @@ -338,6 +339,18 @@ err_unregister_ohci_dev:
30 return err;
31 }
32
33 +static int bcma_hcd_usb30_init(struct bcma_hcd_device *bcma_hcd)
34 +{
35 + struct bcma_device *core = bcma_hcd->core;
36 + struct device *dev = &core->dev;
37 +
38 + bcma_core_enable(core, 0);
39 +
40 + of_platform_default_populate(dev->of_node, NULL, dev);
41 +
42 + return 0;
43 +}
44 +
45 static int bcma_hcd_probe(struct bcma_device *core)
46 {
47 int err;
48 @@ -362,6 +375,11 @@ static int bcma_hcd_probe(struct bcma_de
49 if (err)
50 return err;
51 break;
52 + case BCMA_CORE_NS_USB30:
53 + err = bcma_hcd_usb30_init(usb_dev);
54 + if (err)
55 + return err;
56 + break;
57 default:
58 return -ENODEV;
59 }
60 @@ -416,6 +434,7 @@ static int bcma_hcd_resume(struct bcma_d
61 static const struct bcma_device_id bcma_hcd_table[] = {
62 BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_USB20_HOST, BCMA_ANY_REV, BCMA_ANY_CLASS),
63 BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_NS_USB20, BCMA_ANY_REV, BCMA_ANY_CLASS),
64 + BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_NS_USB30, BCMA_ANY_REV, BCMA_ANY_CLASS),
65 {},
66 };
67 MODULE_DEVICE_TABLE(bcma, bcma_hcd_table);