diff options
author | Manjunath Goudar <manjunath.goudar@linaro.org> | 2013-02-15 17:12:29 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-02-15 17:44:55 -0500 |
commit | 6ed3c43d05f6d0d55f17947bc287f35318fd96f8 (patch) | |
tree | 33634d2a0a2e8500295d1383c879ae9687f29902 /drivers/usb/host | |
parent | d57ada0c37ecf836259c205442c15c7679a6dc3e (diff) |
USB: EHCI: make ehci-orion a separate driver
With the multiplatform changes in arm-soc tree, it becomes
possible to enable the mvebu platform (which uses
ehci-orion) at the same time as other platforms that require
a conflicting EHCI bus glue. At the moment, this results
in a warning like
drivers/usb/host/ehci-hcd.c:1297:0: warning: "PLATFORM_DRIVER" redefined [enabled by default]
drivers/usb/host/ehci-hcd.c:1277:0: note: this is the location of the previous definition
drivers/usb/host/ehci-orion.c:334:31: warning: 'ehci_orion_driver' defined but not used [-Wunused-variable]
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 orion bus glue.
Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r-- | drivers/usb/host/Kconfig | 8 | ||||
-rw-r--r-- | drivers/usb/host/Makefile | 1 | ||||
-rw-r--r-- | drivers/usb/host/ehci-hcd.c | 6 | ||||
-rw-r--r-- | drivers/usb/host/ehci-orion.c | 90 |
4 files changed, 52 insertions, 53 deletions
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index d77e0286f68b..7ac6f482e36f 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig | |||
@@ -162,6 +162,14 @@ config USB_EHCI_HCD_OMAP | |||
162 | Enables support for the on-chip EHCI controller on | 162 | Enables support for the on-chip EHCI controller on |
163 | OMAP3 and later chips. | 163 | OMAP3 and later chips. |
164 | 164 | ||
165 | config USB_EHCI_HCD_ORION | ||
166 | tristate "Support for Marvell Orion on-chip EHCI USB controller" | ||
167 | depends on USB_EHCI_HCD && PLAT_ORION | ||
168 | default y | ||
169 | ---help--- | ||
170 | Enables support for the on-chip EHCI controller on | ||
171 | Morvell Orion chips. | ||
172 | |||
165 | config USB_EHCI_HCD_VT8500 | 173 | config USB_EHCI_HCD_VT8500 |
166 | tristate "Support for VT8500 on-chip EHCI USB controller" | 174 | tristate "Support for VT8500 on-chip EHCI USB controller" |
167 | depends on USB_EHCI_HCD && ARCH_VT8500 | 175 | depends on USB_EHCI_HCD && ARCH_VT8500 |
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile index b0da9cf9d035..4db3f01fec28 100644 --- a/drivers/usb/host/Makefile +++ b/drivers/usb/host/Makefile | |||
@@ -30,6 +30,7 @@ obj-$(CONFIG_USB_EHCI_MXC) += ehci-mxc.o | |||
30 | 30 | ||
31 | obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o | 31 | obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o |
32 | obj-$(CONFIG_USB_EHCI_HCD_VT8500)+= ehci-vt8500.o | 32 | obj-$(CONFIG_USB_EHCI_HCD_VT8500)+= ehci-vt8500.o |
33 | obj-$(CONFIG_USB_EHCI_HCD_ORION)+= ehci-orion.o | ||
33 | obj-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o | 34 | obj-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o |
34 | obj-$(CONFIG_USB_ISP1362_HCD) += isp1362-hcd.o | 35 | obj-$(CONFIG_USB_ISP1362_HCD) += isp1362-hcd.o |
35 | obj-$(CONFIG_USB_OHCI_HCD) += ohci-hcd.o | 36 | obj-$(CONFIG_USB_OHCI_HCD) += ohci-hcd.o |
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 487ebb892bc2..26154f025a21 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
@@ -1272,11 +1272,6 @@ MODULE_LICENSE ("GPL"); | |||
1272 | #define XILINX_OF_PLATFORM_DRIVER ehci_hcd_xilinx_of_driver | 1272 | #define XILINX_OF_PLATFORM_DRIVER ehci_hcd_xilinx_of_driver |
1273 | #endif | 1273 | #endif |
1274 | 1274 | ||
1275 | #ifdef CONFIG_PLAT_ORION | ||
1276 | #include "ehci-orion.c" | ||
1277 | #define PLATFORM_DRIVER ehci_orion_driver | ||
1278 | #endif | ||
1279 | |||
1280 | #ifdef CONFIG_USB_W90X900_EHCI | 1275 | #ifdef CONFIG_USB_W90X900_EHCI |
1281 | #include "ehci-w90x900.c" | 1276 | #include "ehci-w90x900.c" |
1282 | #define PLATFORM_DRIVER ehci_hcd_w90x900_driver | 1277 | #define PLATFORM_DRIVER ehci_hcd_w90x900_driver |
@@ -1343,6 +1338,7 @@ MODULE_LICENSE ("GPL"); | |||
1343 | !IS_ENABLED(CONFIG_USB_EHCI_MXC) && \ | 1338 | !IS_ENABLED(CONFIG_USB_EHCI_MXC) && \ |
1344 | !defined(PLATFORM_DRIVER) && \ | 1339 | !defined(PLATFORM_DRIVER) && \ |
1345 | !IS_ENABLED(CONFIG_ARCH_VT8500) && \ | 1340 | !IS_ENABLED(CONFIG_ARCH_VT8500) && \ |
1341 | !IS_ENABLED(CONFIG_PLAT_ORION) && \ | ||
1346 | !defined(PS3_SYSTEM_BUS_DRIVER) && \ | 1342 | !defined(PS3_SYSTEM_BUS_DRIVER) && \ |
1347 | !defined(OF_PLATFORM_DRIVER) && \ | 1343 | !defined(OF_PLATFORM_DRIVER) && \ |
1348 | !defined(XILINX_OF_PLATFORM_DRIVER) | 1344 | !defined(XILINX_OF_PLATFORM_DRIVER) |
diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c index 914a3ecfb5d3..cfc4803da3f3 100644 --- a/drivers/usb/host/ehci-orion.c +++ b/drivers/usb/host/ehci-orion.c | |||
@@ -17,6 +17,13 @@ | |||
17 | #include <linux/of.h> | 17 | #include <linux/of.h> |
18 | #include <linux/of_device.h> | 18 | #include <linux/of_device.h> |
19 | #include <linux/of_irq.h> | 19 | #include <linux/of_irq.h> |
20 | #include <linux/usb.h> | ||
21 | #include <linux/usb/hcd.h> | ||
22 | #include <linux/io.h> | ||
23 | #include <linux/dma-mapping.h> | ||
24 | |||
25 | #include "ehci.h" | ||
26 | |||
20 | 27 | ||
21 | #define rdl(off) __raw_readl(hcd->regs + (off)) | 28 | #define rdl(off) __raw_readl(hcd->regs + (off)) |
22 | #define wrl(off, val) __raw_writel((val), hcd->regs + (off)) | 29 | #define wrl(off, val) __raw_writel((val), hcd->regs + (off)) |
@@ -34,6 +41,17 @@ | |||
34 | #define USB_PHY_IVREF_CTRL 0x440 | 41 | #define USB_PHY_IVREF_CTRL 0x440 |
35 | #define USB_PHY_TST_GRP_CTRL 0x450 | 42 | #define USB_PHY_TST_GRP_CTRL 0x450 |
36 | 43 | ||
44 | #define DRIVER_DESC "EHCI orion driver" | ||
45 | |||
46 | static const char hcd_name[] = "ehci-orion"; | ||
47 | |||
48 | static struct hc_driver __read_mostly ehci_orion_hc_driver; | ||
49 | |||
50 | static const struct ehci_driver_overrides orion_overrides __initdata = { | ||
51 | .reset = ehci_setup, | ||
52 | }; | ||
53 | |||
54 | |||
37 | /* | 55 | /* |
38 | * Implement Orion USB controller specification guidelines | 56 | * Implement Orion USB controller specification guidelines |
39 | */ | 57 | */ |
@@ -104,51 +122,6 @@ static void orion_usb_phy_v1_setup(struct usb_hcd *hcd) | |||
104 | wrl(USB_MODE, 0x13); | 122 | wrl(USB_MODE, 0x13); |
105 | } | 123 | } |
106 | 124 | ||
107 | static const struct hc_driver ehci_orion_hc_driver = { | ||
108 | .description = hcd_name, | ||
109 | .product_desc = "Marvell Orion EHCI", | ||
110 | .hcd_priv_size = sizeof(struct ehci_hcd), | ||
111 | |||
112 | /* | ||
113 | * generic hardware linkage | ||
114 | */ | ||
115 | .irq = ehci_irq, | ||
116 | .flags = HCD_MEMORY | HCD_USB2, | ||
117 | |||
118 | /* | ||
119 | * basic lifecycle operations | ||
120 | */ | ||
121 | .reset = ehci_setup, | ||
122 | .start = ehci_run, | ||
123 | .stop = ehci_stop, | ||
124 | .shutdown = ehci_shutdown, | ||
125 | |||
126 | /* | ||
127 | * managing i/o requests and associated device resources | ||
128 | */ | ||
129 | .urb_enqueue = ehci_urb_enqueue, | ||
130 | .urb_dequeue = ehci_urb_dequeue, | ||
131 | .endpoint_disable = ehci_endpoint_disable, | ||
132 | .endpoint_reset = ehci_endpoint_reset, | ||
133 | |||
134 | /* | ||
135 | * scheduling support | ||
136 | */ | ||
137 | .get_frame_number = ehci_get_frame, | ||
138 | |||
139 | /* | ||
140 | * root hub support | ||
141 | */ | ||
142 | .hub_status_data = ehci_hub_status_data, | ||
143 | .hub_control = ehci_hub_control, | ||
144 | .bus_suspend = ehci_bus_suspend, | ||
145 | .bus_resume = ehci_bus_resume, | ||
146 | .relinquish_port = ehci_relinquish_port, | ||
147 | .port_handed_over = ehci_port_handed_over, | ||
148 | |||
149 | .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, | ||
150 | }; | ||
151 | |||
152 | static void | 125 | static void |
153 | ehci_orion_conf_mbus_windows(struct usb_hcd *hcd, | 126 | ehci_orion_conf_mbus_windows(struct usb_hcd *hcd, |
154 | const struct mbus_dram_target_info *dram) | 127 | const struct mbus_dram_target_info *dram) |
@@ -323,8 +296,6 @@ static int __exit ehci_orion_drv_remove(struct platform_device *pdev) | |||
323 | return 0; | 296 | return 0; |
324 | } | 297 | } |
325 | 298 | ||
326 | MODULE_ALIAS("platform:orion-ehci"); | ||
327 | |||
328 | static const struct of_device_id ehci_orion_dt_ids[] = { | 299 | static const struct of_device_id ehci_orion_dt_ids[] = { |
329 | { .compatible = "marvell,orion-ehci", }, | 300 | { .compatible = "marvell,orion-ehci", }, |
330 | {}, | 301 | {}, |
@@ -336,8 +307,31 @@ static struct platform_driver ehci_orion_driver = { | |||
336 | .remove = __exit_p(ehci_orion_drv_remove), | 307 | .remove = __exit_p(ehci_orion_drv_remove), |
337 | .shutdown = usb_hcd_platform_shutdown, | 308 | .shutdown = usb_hcd_platform_shutdown, |
338 | .driver = { | 309 | .driver = { |
339 | .name = "orion-ehci", | 310 | .name = hcd_name, |
340 | .owner = THIS_MODULE, | 311 | .owner = THIS_MODULE, |
341 | .of_match_table = of_match_ptr(ehci_orion_dt_ids), | 312 | .of_match_table = of_match_ptr(ehci_orion_dt_ids), |
342 | }, | 313 | }, |
343 | }; | 314 | }; |
315 | |||
316 | static int __init ehci_orion_init(void) | ||
317 | { | ||
318 | if (usb_disabled()) | ||
319 | return -ENODEV; | ||
320 | |||
321 | pr_info("%s: " DRIVER_DESC "\n", hcd_name); | ||
322 | |||
323 | ehci_init_driver(&ehci_orion_hc_driver, &orion_overrides); | ||
324 | return platform_driver_register(&ehci_orion_driver); | ||
325 | } | ||
326 | module_init(ehci_orion_init); | ||
327 | |||
328 | static void __exit ehci_orion_cleanup(void) | ||
329 | { | ||
330 | platform_driver_unregister(&ehci_orion_driver); | ||
331 | } | ||
332 | module_exit(ehci_orion_cleanup); | ||
333 | |||
334 | MODULE_DESCRIPTION(DRIVER_DESC); | ||
335 | MODULE_ALIAS("platform:ehci-orion"); | ||
336 | MODULE_AUTHOR("Tzachi Perelstein"); | ||
337 | MODULE_LICENSE("GPL"); | ||