aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-hcd.c
diff options
context:
space:
mode:
authorValentine Barshak <vbarshak@ru.mvista.com>2007-12-30 18:28:50 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2008-02-01 17:35:01 -0500
commitda0e8fb00b862aa10265f0c64930b432cd44420b (patch)
tree7e8ee6ba65a8826a24268e8e353798b97b30de2a /drivers/usb/host/ehci-hcd.c
parent040fa1b9620cd019349414505828b2ffbeded7f8 (diff)
USB: add ehci-ppc-of bus glue (device-tree aware)
This adds device-tree-aware ehci-ppc-of driver. The code is based on the ehci-ppc-soc driver by Stefan Roese <sr@denx.de>. Signed-off-by: Valentine Barshak <vbarshak@ru.mvista.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Stefan Roese <sr@denx.de> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/ehci-hcd.c')
-rw-r--r--drivers/usb/host/ehci-hcd.c67
1 files changed, 39 insertions, 28 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 7c5c8796d175..53fc97fced20 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -993,11 +993,16 @@ MODULE_LICENSE ("GPL");
993#define PS3_SYSTEM_BUS_DRIVER ps3_ehci_driver 993#define PS3_SYSTEM_BUS_DRIVER ps3_ehci_driver
994#endif 994#endif
995 995
996#ifdef CONFIG_440EPX 996#if defined(CONFIG_440EPX) && !defined(CONFIG_PPC_MERGE)
997#include "ehci-ppc-soc.c" 997#include "ehci-ppc-soc.c"
998#define PLATFORM_DRIVER ehci_ppc_soc_driver 998#define PLATFORM_DRIVER ehci_ppc_soc_driver
999#endif 999#endif
1000 1000
1001#ifdef CONFIG_USB_EHCI_HCD_PPC_OF
1002#include "ehci-ppc-of.c"
1003#define OF_PLATFORM_DRIVER ehci_hcd_ppc_of_driver
1004#endif
1005
1001#ifdef CONFIG_ARCH_ORION 1006#ifdef CONFIG_ARCH_ORION
1002#include "ehci-orion.c" 1007#include "ehci-orion.c"
1003#define PLATFORM_DRIVER ehci_orion_driver 1008#define PLATFORM_DRIVER ehci_orion_driver
@@ -1025,52 +1030,58 @@ static int __init ehci_hcd_init(void)
1025 1030
1026#ifdef PLATFORM_DRIVER 1031#ifdef PLATFORM_DRIVER
1027 retval = platform_driver_register(&PLATFORM_DRIVER); 1032 retval = platform_driver_register(&PLATFORM_DRIVER);
1028 if (retval < 0) { 1033 if (retval < 0)
1029#ifdef DEBUG 1034 goto clean0;
1030 debugfs_remove(ehci_debug_root);
1031 ehci_debug_root = NULL;
1032#endif
1033 return retval;
1034 }
1035#endif 1035#endif
1036 1036
1037#ifdef PCI_DRIVER 1037#ifdef PCI_DRIVER
1038 retval = pci_register_driver(&PCI_DRIVER); 1038 retval = pci_register_driver(&PCI_DRIVER);
1039 if (retval < 0) { 1039 if (retval < 0)
1040#ifdef DEBUG 1040 goto clean1;
1041 debugfs_remove(ehci_debug_root);
1042 ehci_debug_root = NULL;
1043#endif
1044#ifdef PLATFORM_DRIVER
1045 platform_driver_unregister(&PLATFORM_DRIVER);
1046#endif
1047 return retval;
1048 }
1049#endif 1041#endif
1050 1042
1051#ifdef PS3_SYSTEM_BUS_DRIVER 1043#ifdef PS3_SYSTEM_BUS_DRIVER
1052 retval = ps3_ehci_driver_register(&PS3_SYSTEM_BUS_DRIVER); 1044 retval = ps3_ehci_driver_register(&PS3_SYSTEM_BUS_DRIVER);
1053 if (retval < 0) { 1045 if (retval < 0)
1054#ifdef DEBUG 1046 goto clean2;
1055 debugfs_remove(ehci_debug_root);
1056 ehci_debug_root = NULL;
1057#endif 1047#endif
1058#ifdef PLATFORM_DRIVER 1048
1059 platform_driver_unregister(&PLATFORM_DRIVER); 1049#ifdef OF_PLATFORM_DRIVER
1050 retval = of_register_platform_driver(&OF_PLATFORM_DRIVER);
1051 if (retval < 0)
1052 goto clean3;
1053#endif
1054 return retval;
1055
1056#ifdef OF_PLATFORM_DRIVER
1057 /* of_unregister_platform_driver(&OF_PLATFORM_DRIVER); */
1058clean3:
1059#endif
1060#ifdef PS3_SYSTEM_BUS_DRIVER
1061 ps3_ehci_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
1062clean2:
1060#endif 1063#endif
1061#ifdef PCI_DRIVER 1064#ifdef PCI_DRIVER
1062 pci_unregister_driver(&PCI_DRIVER); 1065 pci_unregister_driver(&PCI_DRIVER);
1066clean1:
1063#endif 1067#endif
1064 return retval; 1068#ifdef PLATFORM_DRIVER
1065 } 1069 platform_driver_unregister(&PLATFORM_DRIVER);
1070clean0:
1071#endif
1072#ifdef DEBUG
1073 debugfs_remove(ehci_debug_root);
1074 ehci_debug_root = NULL;
1066#endif 1075#endif
1067
1068 return retval; 1076 return retval;
1069} 1077}
1070module_init(ehci_hcd_init); 1078module_init(ehci_hcd_init);
1071 1079
1072static void __exit ehci_hcd_cleanup(void) 1080static void __exit ehci_hcd_cleanup(void)
1073{ 1081{
1082#ifdef OF_PLATFORM_DRIVER
1083 of_unregister_platform_driver(&OF_PLATFORM_DRIVER);
1084#endif
1074#ifdef PLATFORM_DRIVER 1085#ifdef PLATFORM_DRIVER
1075 platform_driver_unregister(&PLATFORM_DRIVER); 1086 platform_driver_unregister(&PLATFORM_DRIVER);
1076#endif 1087#endif