diff options
author | Manjunath Goudar <manjunath.goudar@linaro.org> | 2013-09-21 07:14:42 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-09-26 12:47:22 -0400 |
commit | a60f4f81e4738d1b20cdb9369060211278f177a5 (patch) | |
tree | 76db3cd19a38ed4aa71a035ae7221353221ca738 /drivers/usb/host | |
parent | 833efc0ed19ce9ed7a84dfd3684eb9d892fe9ded (diff) |
USB: EHCI: make ehci-w90X900 a separate driver
Separate the W90X900(W90P910) on-chip host controller driver from
ehci-hcd host code so that it can be built as a separate driver module.
This work is part of enabling multi-platform kernels on ARM;
however, note that other changes are still needed before W90X900(W90P910)
can be booted with a multi-platform kernel
and an ehci driver that only works on one of them.
With the infrastructure added by Alan Stern in patch 3e0232039
"USB: EHCI: prepare to make ehci-hcd a library module", we can
avoid this problem by turning a bus glue into a separate
module, as we do here for the w90X900 bus glue.
This patch is rebased on greghk/usb-next 3.12 rc1.
Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Signed-off-by: Deepak Saxena <dsaxena@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Wan ZongShun <mcuos.com@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r-- | drivers/usb/host/Kconfig | 2 | ||||
-rw-r--r-- | drivers/usb/host/Makefile | 1 | ||||
-rw-r--r-- | drivers/usb/host/ehci-hcd.c | 5 | ||||
-rw-r--r-- | drivers/usb/host/ehci-w90x900.c | 89 |
4 files changed, 39 insertions, 58 deletions
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 6c2d7df40edf..7e7c52a081ad 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig | |||
@@ -224,7 +224,7 @@ config USB_EHCI_MV | |||
224 | on-chip EHCI USB controller" for those. | 224 | on-chip EHCI USB controller" for those. |
225 | 225 | ||
226 | config USB_W90X900_EHCI | 226 | config USB_W90X900_EHCI |
227 | bool "W90X900(W90P910) EHCI support" | 227 | tristate "W90X900(W90P910) EHCI support" |
228 | depends on ARCH_W90X900 | 228 | depends on ARCH_W90X900 |
229 | ---help--- | 229 | ---help--- |
230 | Enables support for the W90X900 USB controller | 230 | Enables support for the W90X900 USB controller |
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile index 50b0041c09a9..29fa3b839d85 100644 --- a/drivers/usb/host/Makefile +++ b/drivers/usb/host/Makefile | |||
@@ -38,6 +38,7 @@ obj-$(CONFIG_USB_EHCI_S5P) += ehci-s5p.o | |||
38 | obj-$(CONFIG_USB_EHCI_HCD_AT91) += ehci-atmel.o | 38 | obj-$(CONFIG_USB_EHCI_HCD_AT91) += ehci-atmel.o |
39 | obj-$(CONFIG_USB_EHCI_MSM) += ehci-msm.o | 39 | obj-$(CONFIG_USB_EHCI_MSM) += ehci-msm.o |
40 | obj-$(CONFIG_USB_EHCI_TEGRA) += ehci-tegra.o | 40 | obj-$(CONFIG_USB_EHCI_TEGRA) += ehci-tegra.o |
41 | obj-$(CONFIG_USB_W90X900_EHCI) += ehci-w90x900.o | ||
41 | 42 | ||
42 | obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o | 43 | obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o |
43 | obj-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o | 44 | obj-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o |
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 5d6022f30ebe..3e3ca839e6ce 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
@@ -1238,11 +1238,6 @@ MODULE_LICENSE ("GPL"); | |||
1238 | #define XILINX_OF_PLATFORM_DRIVER ehci_hcd_xilinx_of_driver | 1238 | #define XILINX_OF_PLATFORM_DRIVER ehci_hcd_xilinx_of_driver |
1239 | #endif | 1239 | #endif |
1240 | 1240 | ||
1241 | #ifdef CONFIG_USB_W90X900_EHCI | ||
1242 | #include "ehci-w90x900.c" | ||
1243 | #define PLATFORM_DRIVER ehci_hcd_w90x900_driver | ||
1244 | #endif | ||
1245 | |||
1246 | #ifdef CONFIG_USB_OCTEON_EHCI | 1241 | #ifdef CONFIG_USB_OCTEON_EHCI |
1247 | #include "ehci-octeon.c" | 1242 | #include "ehci-octeon.c" |
1248 | #define PLATFORM_DRIVER ehci_octeon_driver | 1243 | #define PLATFORM_DRIVER ehci_octeon_driver |
diff --git a/drivers/usb/host/ehci-w90x900.c b/drivers/usb/host/ehci-w90x900.c index 1c370dfbee0d..cdad8438c02b 100644 --- a/drivers/usb/host/ehci-w90x900.c +++ b/drivers/usb/host/ehci-w90x900.c | |||
@@ -11,13 +11,28 @@ | |||
11 | * | 11 | * |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <linux/dma-mapping.h> | ||
15 | #include <linux/io.h> | ||
16 | #include <linux/kernel.h> | ||
17 | #include <linux/module.h> | ||
18 | #include <linux/of.h> | ||
14 | #include <linux/platform_device.h> | 19 | #include <linux/platform_device.h> |
20 | #include <linux/usb.h> | ||
21 | #include <linux/usb/hcd.h> | ||
22 | |||
23 | #include "ehci.h" | ||
15 | 24 | ||
16 | /* enable phy0 and phy1 for w90p910 */ | 25 | /* enable phy0 and phy1 for w90p910 */ |
17 | #define ENPHY (0x01<<8) | 26 | #define ENPHY (0x01<<8) |
18 | #define PHY0_CTR (0xA4) | 27 | #define PHY0_CTR (0xA4) |
19 | #define PHY1_CTR (0xA8) | 28 | #define PHY1_CTR (0xA8) |
20 | 29 | ||
30 | #define DRIVER_DESC "EHCI w90x900 driver" | ||
31 | |||
32 | static const char hcd_name[] = "ehci-w90x900 "; | ||
33 | |||
34 | static struct hc_driver __read_mostly ehci_w90x900_hc_driver; | ||
35 | |||
21 | static int usb_w90x900_probe(const struct hc_driver *driver, | 36 | static int usb_w90x900_probe(const struct hc_driver *driver, |
22 | struct platform_device *pdev) | 37 | struct platform_device *pdev) |
23 | { | 38 | { |
@@ -90,8 +105,8 @@ err1: | |||
90 | return retval; | 105 | return retval; |
91 | } | 106 | } |
92 | 107 | ||
93 | static | 108 | static void usb_w90x900_remove(struct usb_hcd *hcd, |
94 | void usb_w90x900_remove(struct usb_hcd *hcd, struct platform_device *pdev) | 109 | struct platform_device *pdev) |
95 | { | 110 | { |
96 | usb_remove_hcd(hcd); | 111 | usb_remove_hcd(hcd); |
97 | iounmap(hcd->regs); | 112 | iounmap(hcd->regs); |
@@ -99,54 +114,6 @@ void usb_w90x900_remove(struct usb_hcd *hcd, struct platform_device *pdev) | |||
99 | usb_put_hcd(hcd); | 114 | usb_put_hcd(hcd); |
100 | } | 115 | } |
101 | 116 | ||
102 | static const struct hc_driver ehci_w90x900_hc_driver = { | ||
103 | .description = hcd_name, | ||
104 | .product_desc = "Nuvoton w90x900 EHCI Host Controller", | ||
105 | .hcd_priv_size = sizeof(struct ehci_hcd), | ||
106 | |||
107 | /* | ||
108 | * generic hardware linkage | ||
109 | */ | ||
110 | .irq = ehci_irq, | ||
111 | .flags = HCD_USB2|HCD_MEMORY|HCD_BH, | ||
112 | |||
113 | /* | ||
114 | * basic lifecycle operations | ||
115 | */ | ||
116 | .reset = ehci_setup, | ||
117 | .start = ehci_run, | ||
118 | |||
119 | .stop = ehci_stop, | ||
120 | .shutdown = ehci_shutdown, | ||
121 | |||
122 | /* | ||
123 | * managing i/o requests and associated device resources | ||
124 | */ | ||
125 | .urb_enqueue = ehci_urb_enqueue, | ||
126 | .urb_dequeue = ehci_urb_dequeue, | ||
127 | .endpoint_disable = ehci_endpoint_disable, | ||
128 | .endpoint_reset = ehci_endpoint_reset, | ||
129 | |||
130 | /* | ||
131 | * scheduling support | ||
132 | */ | ||
133 | .get_frame_number = ehci_get_frame, | ||
134 | |||
135 | /* | ||
136 | * root hub support | ||
137 | */ | ||
138 | .hub_status_data = ehci_hub_status_data, | ||
139 | .hub_control = ehci_hub_control, | ||
140 | #ifdef CONFIG_PM | ||
141 | .bus_suspend = ehci_bus_suspend, | ||
142 | .bus_resume = ehci_bus_resume, | ||
143 | #endif | ||
144 | .relinquish_port = ehci_relinquish_port, | ||
145 | .port_handed_over = ehci_port_handed_over, | ||
146 | |||
147 | .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, | ||
148 | }; | ||
149 | |||
150 | static int ehci_w90x900_probe(struct platform_device *pdev) | 117 | static int ehci_w90x900_probe(struct platform_device *pdev) |
151 | { | 118 | { |
152 | if (usb_disabled()) | 119 | if (usb_disabled()) |
@@ -173,7 +140,25 @@ static struct platform_driver ehci_hcd_w90x900_driver = { | |||
173 | }, | 140 | }, |
174 | }; | 141 | }; |
175 | 142 | ||
143 | static int __init ehci_w90X900_init(void) | ||
144 | { | ||
145 | if (usb_disabled()) | ||
146 | return -ENODEV; | ||
147 | |||
148 | pr_info("%s: " DRIVER_DESC "\n", hcd_name); | ||
149 | |||
150 | ehci_init_driver(&ehci_w90x900_hc_driver, NULL); | ||
151 | return platform_driver_register(&ehci_hcd_w90x900_driver); | ||
152 | } | ||
153 | module_init(ehci_w90X900_init); | ||
154 | |||
155 | static void __exit ehci_w90X900_cleanup(void) | ||
156 | { | ||
157 | platform_driver_unregister(&ehci_hcd_w90x900_driver); | ||
158 | } | ||
159 | module_exit(ehci_w90X900_cleanup); | ||
160 | |||
161 | MODULE_DESCRIPTION(DRIVER_DESC); | ||
176 | MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>"); | 162 | MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>"); |
177 | MODULE_DESCRIPTION("w90p910 usb ehci driver!"); | ||
178 | MODULE_LICENSE("GPL"); | ||
179 | MODULE_ALIAS("platform:w90p910-ehci"); | 163 | MODULE_ALIAS("platform:w90p910-ehci"); |
164 | MODULE_LICENSE("GPL v2"); | ||