Skip to contentSkip to conversation

USB: OHCI: make ohci-da8xx a separate driver

PATCH New Axel Haslam 1 participant 1 message Oct 27, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 USB: OHCI: make ohci-da8xx a separate driver

From: Manjunath Goudar <[email protected]>

Separate the Davinci OHCI host controller driver from ohci-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

[Axel: adapted and rebased, fixed minor comments]

---

This was a previews patch submited by Manjunath [1] that was never taken in because of an undefined symbol when loading as a module. That symbol is not present anymore so we can safly build the driver as a module.

I rebased, fixing the minor remaining comments.

V1->V2
* changed hdc_name to a #define and use it in MODE_ALIAS (David)
* Added tested-by tag from David

http://patches.linaro.org/patch/18234/

 drivers/usb/host/Kconfig      |   4 +-
 drivers/usb/host/Makefile     |   1 +
 drivers/usb/host/ohci-da8xx.c | 182 ++++++++++++++++--------------------------
 drivers/usb/host/ohci-hcd.c   |  18 -----
 4 files changed, 74 insertions(+), 131 deletions(-)
drivers/usb/host/Kconfig +2 -2
index 83b6cec..6361fc7 100644
@@ -479,9 +479,9 @@ config USB_OHCI_HCD_OMAP3
 	  OMAP3 and later chips.
 
 config USB_OHCI_HCD_DAVINCI
-	bool "OHCI support for TI DaVinci DA8xx"
+	tristate "OHCI support for TI DaVinci DA8xx"
 	depends on ARCH_DAVINCI_DA8XX
-	depends on USB_OHCI_HCD=y
+	depends on USB_OHCI_HCD
 	select PHY_DA8XX_USB
 	default y
 	help
drivers/usb/host/Makefile +1 -0
index 6ef785b..2644537 100644
@@ -61,6 +61,7 @@ obj-$(CONFIG_USB_OHCI_HCD_AT91)	+= ohci-at91.o
 obj-$(CONFIG_USB_OHCI_HCD_S3C2410)	+= ohci-s3c2410.o
 obj-$(CONFIG_USB_OHCI_HCD_LPC32XX)	+= ohci-nxp.o
 obj-$(CONFIG_USB_OHCI_HCD_PXA27X)	+= ohci-pxa27x.o
+obj-$(CONFIG_USB_OHCI_HCD_DAVINCI)	+= ohci-da8xx.o
 
 obj-$(CONFIG_USB_UHCI_HCD)	+= uhci-hcd.o
 obj-$(CONFIG_USB_FHCI_HCD)	+= fhci.o
drivers/usb/host/ohci-da8xx.c +71 -111

272 lines not on this page · raw message

drivers/usb/host/ohci-hcd.c +0 -18
index 86612ac..8685cf3 100644
@@ -1219,11 +1219,6 @@ void ohci_init_driver(struct hc_driver *drv,
 #define SA1111_DRIVER		ohci_hcd_sa1111_driver
 #endif
 
-#ifdef CONFIG_USB_OHCI_HCD_DAVINCI
-#include "ohci-da8xx.c"
-#define DAVINCI_PLATFORM_DRIVER	ohci_hcd_da8xx_driver
-#endif
-
 #ifdef CONFIG_USB_OHCI_HCD_PPC_OF
 #include "ohci-ppc-of.c"
 #define OF_PLATFORM_DRIVER	ohci_hcd_ppc_of_driver
@@ -1303,19 +1298,9 @@ static int __init ohci_hcd_mod_init(void)
 		goto error_tmio;
 #endif
 
-#ifdef DAVINCI_PLATFORM_DRIVER
-	retval = platform_driver_register(&DAVINCI_PLATFORM_DRIVER);
-	if (retval < 0)
-		goto error_davinci;
-#endif
-
 	return retval;
 
 	/* Error path */
-#ifdef DAVINCI_PLATFORM_DRIVER
-	platform_driver_unregister(&DAVINCI_PLATFORM_DRIVER);
- error_davinci:
-#endif
 #ifdef TMIO_OHCI_DRIVER
 	platform_driver_unregister(&TMIO_OHCI_DRIVER);
  error_tmio:
@@ -1351,9 +1336,6 @@ static int __init ohci_hcd_mod_init(void)
 
 static void __exit ohci_hcd_mod_exit(void)
 {
-#ifdef DAVINCI_PLATFORM_DRIVER
-	platform_driver_unregister(&DAVINCI_PLATFORM_DRIVER);
-#endif
 #ifdef TMIO_OHCI_DRIVER
 	platform_driver_unregister(&TMIO_OHCI_DRIVER);
 #endif
Signature · 1 line
1.9.1