aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2012-11-02 12:34:41 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-02 13:03:50 -0400
commit09f6ffde2ecef4cc4e2a5edaa303210cabd96f57 (patch)
tree89d6018a4f34afe645720b2321f37da73deb213e
parent57465109ce6c62e57b98788496c823c2067253c0 (diff)
USB: EHCI: fix build error by making ChipIdea host a normal EHCI driver
This patch (as1627) splits the ehci-hcd core code, which has become a separate library module, out from the ChipIdea host driver. Instead of #include-ing ehci-hcd.c directly, the ChipIdea module will now use the ehci-hcd library in a normal fashion. This fixes a build error caused by commit 3e0232039967d7a1a06c013d097458b4d5892af1 (USB: EHCI: prepare to make ehci-hcd a library module); I had forgotten about the unorthodox way the ChipIdea driver uses the ehci-hcd code. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Acked-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/chipidea/Kconfig1
-rw-r--r--drivers/usb/chipidea/host.c51
-rw-r--r--drivers/usb/host/ehci-hcd.c11
3 files changed, 9 insertions, 54 deletions
diff --git a/drivers/usb/chipidea/Kconfig b/drivers/usb/chipidea/Kconfig
index 1ea932a13685..608a2aeb400c 100644
--- a/drivers/usb/chipidea/Kconfig
+++ b/drivers/usb/chipidea/Kconfig
@@ -20,6 +20,7 @@ config USB_CHIPIDEA_UDC
20config USB_CHIPIDEA_HOST 20config USB_CHIPIDEA_HOST
21 bool "ChipIdea host controller" 21 bool "ChipIdea host controller"
22 depends on USB=y || USB=USB_CHIPIDEA 22 depends on USB=y || USB=USB_CHIPIDEA
23 depends on USB_EHCI_HCD
23 select USB_EHCI_ROOT_HUB_TT 24 select USB_EHCI_ROOT_HUB_TT
24 help 25 help
25 Say Y here to enable host controller functionality of the 26 Say Y here to enable host controller functionality of the
diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c
index ebc041ff9cd5..30b17ae5aa22 100644
--- a/drivers/usb/chipidea/host.c
+++ b/drivers/usb/chipidea/host.c
@@ -25,57 +25,18 @@
25#include <linux/usb/chipidea.h> 25#include <linux/usb/chipidea.h>
26 26
27#define CHIPIDEA_EHCI 27#define CHIPIDEA_EHCI
28#include "../host/ehci-hcd.c" 28#include "../host/ehci.h"
29 29
30#include "ci.h" 30#include "ci.h"
31#include "bits.h" 31#include "bits.h"
32#include "host.h" 32#include "host.h"
33 33
34static const struct hc_driver ci_ehci_hc_driver = { 34static const struct ehci_driver_overrides ci_overrides = {
35 .description = "ehci_hcd", 35 .product_desc = "ChipIdea HDRC EHCI host controller",
36 .product_desc = "ChipIdea HDRC EHCI",
37 .hcd_priv_size = sizeof(struct ehci_hcd),
38
39 /*
40 * generic hardware linkage
41 */
42 .irq = ehci_irq,
43 .flags = HCD_MEMORY | HCD_USB2,
44
45 /*
46 * basic lifecycle operations
47 */
48 .reset = ehci_setup,
49 .start = ehci_run,
50 .stop = ehci_stop,
51 .shutdown = ehci_shutdown,
52
53 /*
54 * managing i/o requests and associated device resources
55 */
56 .urb_enqueue = ehci_urb_enqueue,
57 .urb_dequeue = ehci_urb_dequeue,
58 .endpoint_disable = ehci_endpoint_disable,
59 .endpoint_reset = ehci_endpoint_reset,
60
61 /*
62 * scheduling support
63 */
64 .get_frame_number = ehci_get_frame,
65
66 /*
67 * root hub support
68 */
69 .hub_status_data = ehci_hub_status_data,
70 .hub_control = ehci_hub_control,
71 .bus_suspend = ehci_bus_suspend,
72 .bus_resume = ehci_bus_resume,
73 .relinquish_port = ehci_relinquish_port,
74 .port_handed_over = ehci_port_handed_over,
75
76 .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
77}; 36};
78 37
38static struct hc_driver __read_mostly ci_ehci_hc_driver;
39
79static irqreturn_t host_irq(struct ci13xxx *ci) 40static irqreturn_t host_irq(struct ci13xxx *ci)
80{ 41{
81 return usb_hcd_irq(ci->irq, ci->hcd); 42 return usb_hcd_irq(ci->irq, ci->hcd);
@@ -141,5 +102,7 @@ int ci_hdrc_host_init(struct ci13xxx *ci)
141 rdrv->name = "host"; 102 rdrv->name = "host";
142 ci->roles[CI_ROLE_HOST] = rdrv; 103 ci->roles[CI_ROLE_HOST] = rdrv;
143 104
105 ehci_init_driver(&ci_ehci_hc_driver, &ci_overrides);
106
144 return 0; 107 return 0;
145} 108}
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 4a466d7730c5..28f694eb624b 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1240,14 +1240,6 @@ EXPORT_SYMBOL_GPL(ehci_init_driver);
1240 1240
1241/*-------------------------------------------------------------------------*/ 1241/*-------------------------------------------------------------------------*/
1242 1242
1243/*
1244 * The EHCI in ChipIdea HDRC cannot be a separate module or device,
1245 * because its registers (and irq) are shared between host/gadget/otg
1246 * functions and in order to facilitate role switching we cannot
1247 * give the ehci driver exclusive access to those.
1248 */
1249#ifndef CHIPIDEA_EHCI
1250
1251MODULE_DESCRIPTION(DRIVER_DESC); 1243MODULE_DESCRIPTION(DRIVER_DESC);
1252MODULE_AUTHOR (DRIVER_AUTHOR); 1244MODULE_AUTHOR (DRIVER_AUTHOR);
1253MODULE_LICENSE ("GPL"); 1245MODULE_LICENSE ("GPL");
@@ -1359,6 +1351,7 @@ MODULE_LICENSE ("GPL");
1359 1351
1360#if !IS_ENABLED(CONFIG_USB_EHCI_PCI) && \ 1352#if !IS_ENABLED(CONFIG_USB_EHCI_PCI) && \
1361 !IS_ENABLED(CONFIG_USB_EHCI_HCD_PLATFORM) && \ 1353 !IS_ENABLED(CONFIG_USB_EHCI_HCD_PLATFORM) && \
1354 !defined(CONFIG_USB_CHIPIDEA_HOST) && \
1362 !defined(PLATFORM_DRIVER) && \ 1355 !defined(PLATFORM_DRIVER) && \
1363 !defined(PS3_SYSTEM_BUS_DRIVER) && \ 1356 !defined(PS3_SYSTEM_BUS_DRIVER) && \
1364 !defined(OF_PLATFORM_DRIVER) && \ 1357 !defined(OF_PLATFORM_DRIVER) && \
@@ -1464,5 +1457,3 @@ static void __exit ehci_hcd_cleanup(void)
1464 clear_bit(USB_EHCI_LOADED, &usb_hcds_loaded); 1457 clear_bit(USB_EHCI_LOADED, &usb_hcds_loaded);
1465} 1458}
1466module_exit(ehci_hcd_cleanup); 1459module_exit(ehci_hcd_cleanup);
1467
1468#endif /* CHIPIDEA_EHCI */