diff options
author | Manjunath Goudar <manjunath.goudar@linaro.org> | 2013-02-15 17:12:28 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-02-15 17:44:55 -0500 |
commit | d57ada0c37ecf836259c205442c15c7679a6dc3e (patch) | |
tree | c4d25ea31f622894b89f1d09891ca157471ad95b /drivers/usb | |
parent | 18e03310b5caa6d11c1a8c61b982c37047693fba (diff) |
USB: EHCI: make ehci-vt8500 a separate driver
With the multiplatform changes in arm-soc tree, it becomes
possible to enable the vt8500 platform 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:1277:0: warning: "PLATFORM_DRIVER" redefined [enabled by default]
drivers/usb/host/ehci-hcd.c:1257:0: note: this is the location of the previous definition
drivers/usb/host/ehci-omap.c:319:31: warning: 'ehci_hcd_omap_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 vt8500 bus glue.
Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Tony Prisk <linux@prisktech.co.nz>
Cc: Alexey Charkov <alchark@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-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-vt8500.c | 73 |
4 files changed, 43 insertions, 45 deletions
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index c59a1126926f..d77e0286f68b 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_VT8500 | ||
166 | tristate "Support for VT8500 on-chip EHCI USB controller" | ||
167 | depends on USB_EHCI_HCD && ARCH_VT8500 | ||
168 | default y | ||
169 | ---help--- | ||
170 | Enables support for the on-chip EHCI controller on | ||
171 | VT8500 chips. | ||
172 | |||
165 | config USB_EHCI_MSM | 173 | config USB_EHCI_MSM |
166 | bool "Support for MSM on-chip EHCI USB controller" | 174 | bool "Support for MSM on-chip EHCI USB controller" |
167 | depends on USB_EHCI_HCD && ARCH_MSM | 175 | depends on USB_EHCI_HCD && ARCH_MSM |
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile index 001fbff2fdef..b0da9cf9d035 100644 --- a/drivers/usb/host/Makefile +++ b/drivers/usb/host/Makefile | |||
@@ -29,6 +29,7 @@ obj-$(CONFIG_USB_EHCI_HCD_PLATFORM) += ehci-platform.o | |||
29 | obj-$(CONFIG_USB_EHCI_MXC) += ehci-mxc.o | 29 | 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_ISP116X_HCD) += isp116x-hcd.o | 33 | obj-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o |
33 | obj-$(CONFIG_USB_ISP1362_HCD) += isp1362-hcd.o | 34 | obj-$(CONFIG_USB_ISP1362_HCD) += isp1362-hcd.o |
34 | obj-$(CONFIG_USB_OHCI_HCD) += ohci-hcd.o | 35 | 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 b416a3fc9959..487ebb892bc2 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
@@ -1292,11 +1292,6 @@ MODULE_LICENSE ("GPL"); | |||
1292 | #define PLATFORM_DRIVER ehci_octeon_driver | 1292 | #define PLATFORM_DRIVER ehci_octeon_driver |
1293 | #endif | 1293 | #endif |
1294 | 1294 | ||
1295 | #ifdef CONFIG_ARCH_VT8500 | ||
1296 | #include "ehci-vt8500.c" | ||
1297 | #define PLATFORM_DRIVER vt8500_ehci_driver | ||
1298 | #endif | ||
1299 | |||
1300 | #ifdef CONFIG_PLAT_SPEAR | 1295 | #ifdef CONFIG_PLAT_SPEAR |
1301 | #include "ehci-spear.c" | 1296 | #include "ehci-spear.c" |
1302 | #define PLATFORM_DRIVER spear_ehci_hcd_driver | 1297 | #define PLATFORM_DRIVER spear_ehci_hcd_driver |
@@ -1347,6 +1342,7 @@ MODULE_LICENSE ("GPL"); | |||
1347 | !IS_ENABLED(CONFIG_USB_CHIPIDEA_HOST) && \ | 1342 | !IS_ENABLED(CONFIG_USB_CHIPIDEA_HOST) && \ |
1348 | !IS_ENABLED(CONFIG_USB_EHCI_MXC) && \ | 1343 | !IS_ENABLED(CONFIG_USB_EHCI_MXC) && \ |
1349 | !defined(PLATFORM_DRIVER) && \ | 1344 | !defined(PLATFORM_DRIVER) && \ |
1345 | !IS_ENABLED(CONFIG_ARCH_VT8500) && \ | ||
1350 | !defined(PS3_SYSTEM_BUS_DRIVER) && \ | 1346 | !defined(PS3_SYSTEM_BUS_DRIVER) && \ |
1351 | !defined(OF_PLATFORM_DRIVER) && \ | 1347 | !defined(OF_PLATFORM_DRIVER) && \ |
1352 | !defined(XILINX_OF_PLATFORM_DRIVER) | 1348 | !defined(XILINX_OF_PLATFORM_DRIVER) |
diff --git a/drivers/usb/host/ehci-vt8500.c b/drivers/usb/host/ehci-vt8500.c index 11695d5b9d86..98d65bdcb969 100644 --- a/drivers/usb/host/ehci-vt8500.c +++ b/drivers/usb/host/ehci-vt8500.c | |||
@@ -16,52 +16,25 @@ | |||
16 | * | 16 | * |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include <linux/kernel.h> | ||
20 | #include <linux/module.h> | ||
21 | #include <linux/usb.h> | ||
22 | #include <linux/usb/hcd.h> | ||
23 | #include <linux/io.h> | ||
24 | #include <linux/dma-mapping.h> | ||
19 | #include <linux/of.h> | 25 | #include <linux/of.h> |
20 | #include <linux/platform_device.h> | 26 | #include <linux/platform_device.h> |
21 | 27 | ||
22 | static const struct hc_driver vt8500_ehci_hc_driver = { | 28 | #include "ehci.h" |
23 | .description = hcd_name, | ||
24 | .product_desc = "VT8500 EHCI", | ||
25 | .hcd_priv_size = sizeof(struct ehci_hcd), | ||
26 | 29 | ||
27 | /* | 30 | #define DRIVER_DESC "vt8500 On-Chip EHCI Host driver" |
28 | * generic hardware linkage | ||
29 | */ | ||
30 | .irq = ehci_irq, | ||
31 | .flags = HCD_MEMORY | HCD_USB2, | ||
32 | |||
33 | /* | ||
34 | * basic lifecycle operations | ||
35 | */ | ||
36 | .reset = ehci_setup, | ||
37 | .start = ehci_run, | ||
38 | .stop = ehci_stop, | ||
39 | .shutdown = ehci_shutdown, | ||
40 | 31 | ||
41 | /* | 32 | static const char hcd_name[] = "ehci-vt8500"; |
42 | * managing i/o requests and associated device resources | ||
43 | */ | ||
44 | .urb_enqueue = ehci_urb_enqueue, | ||
45 | .urb_dequeue = ehci_urb_dequeue, | ||
46 | .endpoint_disable = ehci_endpoint_disable, | ||
47 | .endpoint_reset = ehci_endpoint_reset, | ||
48 | 33 | ||
49 | /* | 34 | static struct hc_driver __read_mostly vt8500_ehci_hc_driver; |
50 | * scheduling support | ||
51 | */ | ||
52 | .get_frame_number = ehci_get_frame, | ||
53 | 35 | ||
54 | /* | 36 | static const struct ehci_driver_overrides ehci_vt8500_overrides __initdata = { |
55 | * root hub support | 37 | .reset = ehci_setup, |
56 | */ | ||
57 | .hub_status_data = ehci_hub_status_data, | ||
58 | .hub_control = ehci_hub_control, | ||
59 | .bus_suspend = ehci_bus_suspend, | ||
60 | .bus_resume = ehci_bus_resume, | ||
61 | .relinquish_port = ehci_relinquish_port, | ||
62 | .port_handed_over = ehci_port_handed_over, | ||
63 | |||
64 | .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, | ||
65 | }; | 38 | }; |
66 | 39 | ||
67 | static u64 vt8500_ehci_dma_mask = DMA_BIT_MASK(32); | 40 | static u64 vt8500_ehci_dma_mask = DMA_BIT_MASK(32); |
@@ -140,11 +113,31 @@ static struct platform_driver vt8500_ehci_driver = { | |||
140 | .remove = vt8500_ehci_drv_remove, | 113 | .remove = vt8500_ehci_drv_remove, |
141 | .shutdown = usb_hcd_platform_shutdown, | 114 | .shutdown = usb_hcd_platform_shutdown, |
142 | .driver = { | 115 | .driver = { |
143 | .name = "vt8500-ehci", | 116 | .name = hcd_name, |
144 | .owner = THIS_MODULE, | 117 | .owner = THIS_MODULE, |
145 | .of_match_table = of_match_ptr(vt8500_ehci_ids), | 118 | .of_match_table = of_match_ptr(vt8500_ehci_ids), |
146 | } | 119 | } |
147 | }; | 120 | }; |
148 | 121 | ||
122 | static int __init ehci_vt8500_init(void) | ||
123 | { | ||
124 | if (usb_disabled()) | ||
125 | return -ENODEV; | ||
126 | |||
127 | pr_info("%s: " DRIVER_DESC "\n", hcd_name); | ||
128 | ehci_init_driver(&vt8500_ehci_hc_driver, &ehci_vt8500_overrides); | ||
129 | return platform_driver_register(&vt8500_ehci_driver); | ||
130 | } | ||
131 | module_init(ehci_vt8500_init); | ||
132 | |||
133 | static void __exit ehci_vt8500_cleanup(void) | ||
134 | { | ||
135 | platform_driver_unregister(&vt8500_ehci_driver); | ||
136 | } | ||
137 | module_exit(ehci_vt8500_cleanup); | ||
138 | |||
139 | MODULE_DESCRIPTION(DRIVER_DESC); | ||
140 | MODULE_AUTHOR("Alexey Charkov"); | ||
141 | MODULE_LICENSE("GPL v2"); | ||
149 | MODULE_ALIAS("platform:vt8500-ehci"); | 142 | MODULE_ALIAS("platform:vt8500-ehci"); |
150 | MODULE_DEVICE_TABLE(of, vt8500_ehci_ids); | 143 | MODULE_DEVICE_TABLE(of, vt8500_ehci_ids); |