mvebu: backport mainline patches from kernel 3.13
[openwrt/staging/lynxis/omap.git] / target / linux / mvebu / patches-3.10 / 0195-usb-Add-Device-Tree-support-to-XHCI-Platform-driver.patch
1 From 956b857c1fc80164859adbe1147704b1f352e153 Mon Sep 17 00:00:00 2001
2 From: Al Cooper <alcooperx@gmail.com>
3 Date: Fri, 6 Dec 2013 00:18:25 +0100
4 Subject: [PATCH 195/203] usb: Add Device Tree support to XHCI Platform driver
5
6 Add Device Tree match table to xhci-plat.c. Add DT bindings document.
7
8 Signed-off-by: Al Cooper <alcooperx@gmail.com>
9 Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
10 Cc: Felipe Balbi <balbi@ti.com>
11 Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
12
13 Conflicts:
14 drivers/usb/host/xhci-plat.c
15 ---
16 Documentation/devicetree/bindings/usb/usb-xhci.txt | 14 ++++++++++++++
17 drivers/usb/host/xhci-plat.c | 10 ++++++++++
18 2 files changed, 24 insertions(+)
19 create mode 100644 Documentation/devicetree/bindings/usb/usb-xhci.txt
20
21 --- /dev/null
22 +++ b/Documentation/devicetree/bindings/usb/usb-xhci.txt
23 @@ -0,0 +1,14 @@
24 +USB xHCI controllers
25 +
26 +Required properties:
27 + - compatible: should be "xhci-platform".
28 + - reg: should contain address and length of the standard XHCI
29 + register set for the device.
30 + - interrupts: one XHCI interrupt should be described here.
31 +
32 +Example:
33 + usb@f0931000 {
34 + compatible = "xhci-platform";
35 + reg = <0xf0931000 0x8c8>;
36 + interrupts = <0x0 0x4e 0x0>;
37 + };
38 --- a/drivers/usb/host/xhci-plat.c
39 +++ b/drivers/usb/host/xhci-plat.c
40 @@ -14,6 +14,7 @@
41 #include <linux/platform_device.h>
42 #include <linux/module.h>
43 #include <linux/slab.h>
44 +#include <linux/of.h>
45
46 #include "xhci.h"
47
48 @@ -186,11 +187,20 @@ static int xhci_plat_remove(struct platf
49 return 0;
50 }
51
52 +#ifdef CONFIG_OF
53 +static const struct of_device_id usb_xhci_of_match[] = {
54 + { .compatible = "xhci-platform" },
55 + { },
56 +};
57 +MODULE_DEVICE_TABLE(of, usb_xhci_of_match);
58 +#endif
59 +
60 static struct platform_driver usb_xhci_driver = {
61 .probe = xhci_plat_probe,
62 .remove = xhci_plat_remove,
63 .driver = {
64 .name = "xhci-hcd",
65 + .of_match_table = of_match_ptr(usb_xhci_of_match),
66 },
67 };
68 MODULE_ALIAS("platform:xhci-hcd");