USB: ohci: Add Kconfig entries for ohci-omap3
authorAnand Gadiyar <gadiyar@ti.com>
Mon, 10 May 2010 16:26:12 +0000 (21:56 +0530)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 20 May 2010 20:21:44 +0000 (13:21 -0700)
On OMAP systems, we have two different OHCI controllers. The legacy
one is present in OMAP1/2 chips, and the newer one comes bundled as
a companion to the EHCI controller on OMAP3 and newer chips.

We may have multi-omap configurations where OMAP2 and OMAP3
support may be enabled in the same kernel, and need a mechanism
to keep both drivers around.

This patch adds a Kconfig entry for each of these drivers.

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/host/Kconfig
drivers/usb/host/ohci-hcd.c

index 8d3df0397de392d0ab0769d476b89eb35e703180..f865be2276d42cca62414103d136b9f0ee1c5822 100644 (file)
@@ -207,6 +207,21 @@ config USB_OHCI_HCD
          To compile this driver as a module, choose M here: the
          module will be called ohci-hcd.
 
+config USB_OHCI_HCD_OMAP1
+       bool "OHCI support for OMAP1/2 chips"
+       depends on USB_OHCI_HCD && (ARCH_OMAP1 || ARCH_OMAP2)
+       default y
+       ---help---
+         Enables support for the OHCI controller on OMAP1/2 chips.
+
+config USB_OHCI_HCD_OMAP3
+       bool "OHCI support for OMAP3 and later chips"
+       depends on USB_OHCI_HCD && (ARCH_OMAP3 || ARCH_OMAP4)
+       default y
+       ---help---
+         Enables support for the on-chip OHCI controller on
+         OMAP3 and later chips.
+
 config USB_OHCI_HCD_PPC_SOC
        bool "OHCI support for on-chip PPC USB controller"
        depends on USB_OHCI_HCD && (STB03xxx || PPC_MPC52xx)
index d15d2478493ecb2c0d5572eed019cd4835574c1d..fc576557d8a5d2520aee7e6edcbafb17e4701de8 100644 (file)
@@ -1006,9 +1006,14 @@ MODULE_LICENSE ("GPL");
 #define PLATFORM_DRIVER                ohci_hcd_s3c2410_driver
 #endif
 
-#ifdef CONFIG_ARCH_OMAP
+#ifdef CONFIG_USB_OHCI_HCD_OMAP1
 #include "ohci-omap.c"
-#define PLATFORM_DRIVER                ohci_hcd_omap_driver
+#define OMAP1_PLATFORM_DRIVER  ohci_hcd_omap_driver
+#endif
+
+#ifdef CONFIG_USB_OHCI_HCD_OMAP3
+#include "ohci-omap3.c"
+#define OMAP3_PLATFORM_DRIVER  ohci_hcd_omap3_driver
 #endif
 
 #ifdef CONFIG_ARCH_LH7A404
@@ -1092,6 +1097,8 @@ MODULE_LICENSE ("GPL");
 
 #if    !defined(PCI_DRIVER) &&         \
        !defined(PLATFORM_DRIVER) &&    \
+       !defined(OMAP1_PLATFORM_DRIVER) &&      \
+       !defined(OMAP3_PLATFORM_DRIVER) &&      \
        !defined(OF_PLATFORM_DRIVER) && \
        !defined(SA1111_DRIVER) &&      \
        !defined(PS3_SYSTEM_BUS_DRIVER) && \
@@ -1133,6 +1140,18 @@ static int __init ohci_hcd_mod_init(void)
                goto error_platform;
 #endif
 
+#ifdef OMAP1_PLATFORM_DRIVER
+       retval = platform_driver_register(&OMAP1_PLATFORM_DRIVER);
+       if (retval < 0)
+               goto error_omap1_platform;
+#endif
+
+#ifdef OMAP3_PLATFORM_DRIVER
+       retval = platform_driver_register(&OMAP3_PLATFORM_DRIVER);
+       if (retval < 0)
+               goto error_omap3_platform;
+#endif
+
 #ifdef OF_PLATFORM_DRIVER
        retval = of_register_platform_driver(&OF_PLATFORM_DRIVER);
        if (retval < 0)
@@ -1200,6 +1219,14 @@ static int __init ohci_hcd_mod_init(void)
        platform_driver_unregister(&PLATFORM_DRIVER);
  error_platform:
 #endif
+#ifdef OMAP1_PLATFORM_DRIVER
+       platform_driver_unregister(&OMAP1_PLATFORM_DRIVER);
+ error_omap1_platform:
+#endif
+#ifdef OMAP3_PLATFORM_DRIVER
+       platform_driver_unregister(&OMAP3_PLATFORM_DRIVER);
+ error_omap3_platform:
+#endif
 #ifdef PS3_SYSTEM_BUS_DRIVER
        ps3_ohci_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
  error_ps3: