3f9bb5890491450f252fcc5fd35aa019eb9c9c38
[openwrt/openwrt.git] / target / linux / ramips / patches-3.8 / 0203-owrt-OF-USB-add-OF-binding-for-ehci-and-ohci-platfor.patch
1 From 3c99a50d689cb4811b13b9810d18c9316587216f Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Mon, 18 Mar 2013 20:51:21 +0100
4 Subject: [PATCH 203/208] owrt: OF: USB: add OF binding for ehci and ohci
5 platform driver
6
7 Make ohci-platform and ehci-platform loadable from OF.
8
9 Signed-off-by: John Crispin <blogic@openwrt.org>
10 ---
11 drivers/usb/host/ehci-platform.c | 7 +++++++
12 drivers/usb/host/ohci-platform.c | 7 +++++++
13 2 files changed, 14 insertions(+)
14
15 diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c
16 index ca75063..fdddce1 100644
17 --- a/drivers/usb/host/ehci-platform.c
18 +++ b/drivers/usb/host/ehci-platform.c
19 @@ -183,6 +183,12 @@ static int ehci_platform_resume(struct device *dev)
20 #define ehci_platform_resume NULL
21 #endif /* CONFIG_PM */
22
23 +static const struct of_device_id ehci_match_table[] = {
24 + { .compatible = "ehci-platform" },
25 + {},
26 +};
27 +MODULE_DEVICE_TABLE(of, ehci_match_table);
28 +
29 static const struct platform_device_id ehci_platform_table[] = {
30 { "ehci-platform", 0 },
31 { }
32 @@ -203,6 +209,7 @@ static struct platform_driver ehci_platform_driver = {
33 .owner = THIS_MODULE,
34 .name = "ehci-platform",
35 .pm = &ehci_platform_pm_ops,
36 + .of_match_table = ehci_match_table,
37 }
38 };
39
40 diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c
41 index c3e7287..6d7d30b 100644
42 --- a/drivers/usb/host/ohci-platform.c
43 +++ b/drivers/usb/host/ohci-platform.c
44 @@ -201,6 +201,12 @@ static int ohci_platform_resume(struct device *dev)
45 #define ohci_platform_resume NULL
46 #endif /* CONFIG_PM */
47
48 +static const struct of_device_id ohci_match_table[] = {
49 + { .compatible = "ohci-platform" },
50 + {},
51 +};
52 +MODULE_DEVICE_TABLE(of, ohci_match_table);
53 +
54 static const struct platform_device_id ohci_platform_table[] = {
55 { "ohci-platform", 0 },
56 { }
57 @@ -221,5 +227,6 @@ static struct platform_driver ohci_platform_driver = {
58 .owner = THIS_MODULE,
59 .name = "ohci-platform",
60 .pm = &ohci_platform_pm_ops,
61 + .of_match_table = ohci_match_table,
62 }
63 };
64 --
65 1.7.10.4
66