summaryrefslogtreecommitdiff
path: root/drivers/usb/host/ohci-hcd.c
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2006-12-13 21:09:55 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2007-02-07 15:44:33 -0800
commit495a678fc62e850d15f860d39faee07ba0a8910c (patch)
tree4f8f12bafc2039fadda6e88efdc1b57729ca31d8 /drivers/usb/host/ohci-hcd.c
parent5e16fabe5dbcff15de6cdcba406195fe6e4380df (diff)
ohci: Add support for OHCI controller on the of_platform bus
PPC embedded systems can have a ohci controller builtin. In the new model, it will end up as a driver on the of_platform bus, this patches takes care of them. Signed-off-by: Sylvain Munaut <tnt@246tNt.com> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/ohci-hcd.c')
-rw-r--r--drivers/usb/host/ohci-hcd.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 3f80003b40bd..8baecbdf0621 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -914,8 +914,14 @@ MODULE_LICENSE ("GPL");
#endif
+#ifdef CONFIG_USB_OHCI_HCD_PPC_OF
+#include "ohci-ppc-of.c"
+#define OF_PLATFORM_DRIVER ohci_hcd_ppc_of_driver
+#endif
+
#if !defined(PCI_DRIVER) && \
!defined(PLATFORM_DRIVER) && \
+ !defined(OF_PLATFORM_DRIVER) && \
!defined(SA1111_DRIVER)
#error "missing bus glue for ohci-hcd"
#endif
@@ -939,6 +945,13 @@ static int __init ohci_hcd_mod_init(void)
ls++;
#endif
+#ifdef OF_PLATFORM_DRIVER
+ retval = of_register_platform_driver(&OF_PLATFORM_DRIVER);
+ if (retval < 0)
+ goto error;
+ ls++;
+#endif
+
#ifdef SA1111_DRIVER
retval = sa1111_driver_register(&SA1111_DRIVER);
if (retval < 0)
@@ -961,6 +974,10 @@ error:
if (ls--)
platform_driver_unregister(&PLATFORM_DRIVER);
#endif
+#ifdef OF_PLATFORM_DRIVER
+ if (ls--)
+ of_unregister_platform_driver(&OF_PLATFORM_DRIVER);
+#endif
#ifdef SA1111_DRIVER
if (ls--)
sa1111_driver_unregister(&SA1111_DRIVER);
@@ -977,6 +994,9 @@ static void __exit ohci_hcd_mod_exit(void)
#ifdef SA1111_DRIVER
sa1111_driver_unregister(&SA1111_DRIVER);
#endif
+#ifdef OF_PLATFORM_DRIVER
+ of_unregister_platform_driver(&OF_PLATFORM_DRIVER);
+#endif
#ifdef PLATFORM_DRIVER
platform_driver_unregister(&PLATFORM_DRIVER);
#endif