aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ohci-hcd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/ohci-hcd.c')
-rw-r--r--drivers/usb/host/ohci-hcd.c128
1 files changed, 116 insertions, 12 deletions
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index c1c1d871aba4..fa6a7ceaa0db 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -855,63 +855,167 @@ MODULE_LICENSE ("GPL");
855 855
856#ifdef CONFIG_PCI 856#ifdef CONFIG_PCI
857#include "ohci-pci.c" 857#include "ohci-pci.c"
858#define PCI_DRIVER ohci_pci_driver
858#endif 859#endif
859 860
860#ifdef CONFIG_SA1111 861#ifdef CONFIG_SA1111
861#include "ohci-sa1111.c" 862#include "ohci-sa1111.c"
863#define SA1111_DRIVER ohci_hcd_sa1111_driver
862#endif 864#endif
863 865
864#ifdef CONFIG_ARCH_S3C2410 866#ifdef CONFIG_ARCH_S3C2410
865#include "ohci-s3c2410.c" 867#include "ohci-s3c2410.c"
868#define PLATFORM_DRIVER ohci_hcd_s3c2410_driver
866#endif 869#endif
867 870
868#ifdef CONFIG_ARCH_OMAP 871#ifdef CONFIG_ARCH_OMAP
869#include "ohci-omap.c" 872#include "ohci-omap.c"
873#define PLATFORM_DRIVER ohci_hcd_omap_driver
870#endif 874#endif
871 875
872#ifdef CONFIG_ARCH_LH7A404 876#ifdef CONFIG_ARCH_LH7A404
873#include "ohci-lh7a404.c" 877#include "ohci-lh7a404.c"
878#define PLATFORM_DRIVER ohci_hcd_lh7a404_driver
874#endif 879#endif
875 880
876#ifdef CONFIG_PXA27x 881#ifdef CONFIG_PXA27x
877#include "ohci-pxa27x.c" 882#include "ohci-pxa27x.c"
883#define PLATFORM_DRIVER ohci_hcd_pxa27x_driver
878#endif 884#endif
879 885
880#ifdef CONFIG_ARCH_EP93XX 886#ifdef CONFIG_ARCH_EP93XX
881#include "ohci-ep93xx.c" 887#include "ohci-ep93xx.c"
888#define PLATFORM_DRIVER ohci_hcd_ep93xx_driver
882#endif 889#endif
883 890
884#ifdef CONFIG_SOC_AU1X00 891#ifdef CONFIG_SOC_AU1X00
885#include "ohci-au1xxx.c" 892#include "ohci-au1xxx.c"
893#define PLATFORM_DRIVER ohci_hcd_au1xxx_driver
886#endif 894#endif
887 895
888#ifdef CONFIG_PNX8550 896#ifdef CONFIG_PNX8550
889#include "ohci-pnx8550.c" 897#include "ohci-pnx8550.c"
898#define PLATFORM_DRIVER ohci_hcd_pnx8550_driver
890#endif 899#endif
891 900
892#ifdef CONFIG_USB_OHCI_HCD_PPC_SOC 901#ifdef CONFIG_USB_OHCI_HCD_PPC_SOC
893#include "ohci-ppc-soc.c" 902#include "ohci-ppc-soc.c"
903#define PLATFORM_DRIVER ohci_hcd_ppc_soc_driver
894#endif 904#endif
895 905
896#ifdef CONFIG_ARCH_AT91 906#ifdef CONFIG_ARCH_AT91
897#include "ohci-at91.c" 907#include "ohci-at91.c"
908#define PLATFORM_DRIVER ohci_hcd_at91_driver
898#endif 909#endif
899 910
900#ifdef CONFIG_ARCH_PNX4008 911#ifdef CONFIG_ARCH_PNX4008
901#include "ohci-pnx4008.c" 912#include "ohci-pnx4008.c"
913#define PLATFORM_DRIVER usb_hcd_pnx4008_driver
902#endif 914#endif
903 915
904#if !(defined(CONFIG_PCI) \ 916
905 || defined(CONFIG_SA1111) \ 917#ifdef CONFIG_USB_OHCI_HCD_PPC_OF
906 || defined(CONFIG_ARCH_S3C2410) \ 918#include "ohci-ppc-of.c"
907 || defined(CONFIG_ARCH_OMAP) \ 919#define OF_PLATFORM_DRIVER ohci_hcd_ppc_of_driver
908 || defined (CONFIG_ARCH_LH7A404) \ 920#endif
909 || defined (CONFIG_PXA27x) \ 921
910 || defined (CONFIG_ARCH_EP93XX) \ 922#ifdef CONFIG_PPC_PS3
911 || defined (CONFIG_SOC_AU1X00) \ 923#include "ohci-ps3.c"
912 || defined (CONFIG_USB_OHCI_HCD_PPC_SOC) \ 924#define PS3_SYSTEM_BUS_DRIVER ps3_ohci_sb_driver
913 || defined (CONFIG_ARCH_AT91) \ 925#endif
914 || defined (CONFIG_ARCH_PNX4008) \ 926
915 ) 927#if !defined(PCI_DRIVER) && \
928 !defined(PLATFORM_DRIVER) && \
929 !defined(OF_PLATFORM_DRIVER) && \
930 !defined(SA1111_DRIVER) && \
931 !defined(PS3_SYSTEM_BUS_DRIVER)
916#error "missing bus glue for ohci-hcd" 932#error "missing bus glue for ohci-hcd"
917#endif 933#endif
934
935static int __init ohci_hcd_mod_init(void)
936{
937 int retval = 0;
938
939 if (usb_disabled())
940 return -ENODEV;
941
942 printk (KERN_DEBUG "%s: " DRIVER_INFO "\n", hcd_name);
943 pr_debug ("%s: block sizes: ed %Zd td %Zd\n", hcd_name,
944 sizeof (struct ed), sizeof (struct td));
945
946#ifdef PS3_SYSTEM_BUS_DRIVER
947 retval = ps3_system_bus_driver_register(&PS3_SYSTEM_BUS_DRIVER);
948 if (retval < 0)
949 goto error_ps3;
950#endif
951
952#ifdef PLATFORM_DRIVER
953 retval = platform_driver_register(&PLATFORM_DRIVER);
954 if (retval < 0)
955 goto error_platform;
956#endif
957
958#ifdef OF_PLATFORM_DRIVER
959 retval = of_register_platform_driver(&OF_PLATFORM_DRIVER);
960 if (retval < 0)
961 goto error_of_platform;
962#endif
963
964#ifdef SA1111_DRIVER
965 retval = sa1111_driver_register(&SA1111_DRIVER);
966 if (retval < 0)
967 goto error_sa1111;
968#endif
969
970#ifdef PCI_DRIVER
971 retval = pci_register_driver(&PCI_DRIVER);
972 if (retval < 0)
973 goto error_pci;
974#endif
975
976 return retval;
977
978 /* Error path */
979#ifdef PCI_DRIVER
980 error_pci:
981#endif
982#ifdef SA1111_DRIVER
983 sa1111_driver_unregister(&SA1111_DRIVER);
984 error_sa1111:
985#endif
986#ifdef OF_PLATFORM_DRIVER
987 of_unregister_platform_driver(&OF_PLATFORM_DRIVER);
988 error_of_platform:
989#endif
990#ifdef PLATFORM_DRIVER
991 platform_driver_unregister(&PLATFORM_DRIVER);
992 error_platform:
993#endif
994#ifdef PS3_SYSTEM_BUS_DRIVER
995 ps3_system_bus_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
996 error_ps3:
997#endif
998 return retval;
999}
1000module_init(ohci_hcd_mod_init);
1001
1002static void __exit ohci_hcd_mod_exit(void)
1003{
1004#ifdef PCI_DRIVER
1005 pci_unregister_driver(&PCI_DRIVER);
1006#endif
1007#ifdef SA1111_DRIVER
1008 sa1111_driver_unregister(&SA1111_DRIVER);
1009#endif
1010#ifdef OF_PLATFORM_DRIVER
1011 of_unregister_platform_driver(&OF_PLATFORM_DRIVER);
1012#endif
1013#ifdef PLATFORM_DRIVER
1014 platform_driver_unregister(&PLATFORM_DRIVER);
1015#endif
1016#ifdef PS3_SYSTEM_BUS_DRIVER
1017 ps3_system_bus_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
1018#endif
1019}
1020module_exit(ohci_hcd_mod_exit);
1021