ohci: Add support for OHCI controller on the of_platform bus
authorSylvain Munaut <tnt@246tNt.com>
Wed, 13 Dec 2006 20:09:55 +0000 (21:09 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 7 Feb 2007 23:44:33 +0000 (15:44 -0800)
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>
drivers/usb/host/Kconfig
drivers/usb/host/ohci-hcd.c
drivers/usb/host/ohci-ppc-of.c [new file with mode: 0644]

index 8325998..6271187 100644 (file)
@@ -112,9 +112,30 @@ config USB_OHCI_HCD_PPC_SOC
          Enables support for the USB controller on the MPC52xx or
          STB03xxx processor chip.  If unsure, say Y.
 
+config USB_OHCI_HCD_PPC_OF
+       bool "OHCI support for PPC USB controller on OF platform bus"
+       depends on USB_OHCI_HCD && PPC_OF
+       default y
+       ---help---
+         Enables support for the USB controller PowerPC present on the
+         OpenFirmware platform bus.
+
+config USB_OHCI_HCD_PPC_OF_BE
+       bool "Support big endian HC"
+       depends on USB_OHCI_HCD_PPC_OF
+       default y
+       select USB_OHCI_BIG_ENDIAN_DESC
+       select USB_OHCI_BIG_ENDIAN_MMIO
+
+config USB_OHCI_HCD_PPC_OF_LE
+       bool "Support little endian HC"
+       depends on USB_OHCI_HCD_PPC_OF
+       default n
+       select USB_OHCI_LITTLE_ENDIAN
+
 config USB_OHCI_HCD_PCI
        bool "OHCI support for PCI-bus USB controllers"
-       depends on USB_OHCI_HCD && PCI && (STB03xxx || PPC_MPC52xx)
+       depends on USB_OHCI_HCD && PCI && (STB03xxx || PPC_MPC52xx || USB_OHCI_HCD_PPC_OF)
        default y
        select USB_OHCI_LITTLE_ENDIAN
        ---help---
index 3f80003..8baecbd 100644 (file)
@@ -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
Simple merge