Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Alan Stern and committed by
Greg Kroah-Hartman
09f6ffde 57465109

+9 -54
+1
drivers/usb/chipidea/Kconfig
··· 20 20 config USB_CHIPIDEA_HOST 21 21 bool "ChipIdea host controller" 22 22 depends on USB=y || USB=USB_CHIPIDEA 23 + depends on USB_EHCI_HCD 23 24 select USB_EHCI_ROOT_HUB_TT 24 25 help 25 26 Say Y here to enable host controller functionality of the
+7 -44
drivers/usb/chipidea/host.c
··· 25 25 #include <linux/usb/chipidea.h> 26 26 27 27 #define CHIPIDEA_EHCI 28 - #include "../host/ehci-hcd.c" 28 + #include "../host/ehci.h" 29 29 30 30 #include "ci.h" 31 31 #include "bits.h" 32 32 #include "host.h" 33 33 34 - static const struct hc_driver ci_ehci_hc_driver = { 35 - .description = "ehci_hcd", 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, 34 + static const struct ehci_driver_overrides ci_overrides = { 35 + .product_desc = "ChipIdea HDRC EHCI host controller", 77 36 }; 37 + 38 + static struct hc_driver __read_mostly ci_ehci_hc_driver; 78 39 79 40 static irqreturn_t host_irq(struct ci13xxx *ci) 80 41 { ··· 101 140 rdrv->irq = host_irq; 102 141 rdrv->name = "host"; 103 142 ci->roles[CI_ROLE_HOST] = rdrv; 143 + 144 + ehci_init_driver(&ci_ehci_hc_driver, &ci_overrides); 104 145 105 146 return 0; 106 147 }
+1 -10
drivers/usb/host/ehci-hcd.c
··· 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 - 1251 1243 MODULE_DESCRIPTION(DRIVER_DESC); 1252 1244 MODULE_AUTHOR (DRIVER_AUTHOR); 1253 1245 MODULE_LICENSE ("GPL"); ··· 1351 1359 1352 1360 #if !IS_ENABLED(CONFIG_USB_EHCI_PCI) && \ 1353 1361 !IS_ENABLED(CONFIG_USB_EHCI_HCD_PLATFORM) && \ 1362 + !defined(CONFIG_USB_CHIPIDEA_HOST) && \ 1354 1363 !defined(PLATFORM_DRIVER) && \ 1355 1364 !defined(PS3_SYSTEM_BUS_DRIVER) && \ 1356 1365 !defined(OF_PLATFORM_DRIVER) && \ ··· 1457 1464 clear_bit(USB_EHCI_LOADED, &usb_hcds_loaded); 1458 1465 } 1459 1466 module_exit(ehci_hcd_cleanup); 1460 - 1461 - #endif /* CHIPIDEA_EHCI */