Import 2.3.12pre6
[davej-history.git] / drivers / usb / usb-core.c
blob082549b6e23e8068bfdae7ccd26a3d5bb4eeee76
1 /*
2 * driver/usb/usb-core.c
4 * (C) Copyright David Waite 1999
5 * based on code from usb.c, by Linus Torvolds
7 * The purpose of this file is to pull any and all generic modular code from
8 * usb.c and put it in a separate file. This way usb.c is kept as a generic
9 * library, while this file handles starting drivers, etc.
12 #include <linux/kernel.h>
13 #include <linux/config.h>
14 #include <linux/module.h>
16 #include "inits.h"
17 #include "usb.h"
19 #ifndef CONFIG_USB_MODULE
20 # ifdef CONFIG_USB_UHCI
21 int uhci_init(void);
22 # endif
23 # ifdef CONFIG_USB_OHCI
24 int ohci_init(void);
25 # endif
26 # ifdef CONFIG_USB_OHCI_HCD
27 int ohci_hcd_init(void);
28 # endif
29 #endif
31 int usb_init(void)
33 #ifndef CONFIG_USB_MODULE
34 # ifdef CONFIG_USB_UHCI
35 uhci_init();
36 # endif
37 # ifdef CONFIG_USB_OHCI
38 ohci_init();
39 # endif
40 # ifdef CONFIG_USB_OHCI_HCD
41 ohci_hcd_init();
42 # endif
43 # ifdef CONFIG_USB_MOUSE
44 usb_mouse_init();
45 # endif
46 # ifdef CONFIG_USB_KBD
47 usb_kbd_init();
48 # endif
49 # ifdef CONFIG_USB_AUDIO
50 usb_audio_init();
51 # endif
52 # ifdef CONFIG_USB_ACM
53 usb_acm_init();
54 # endif
55 # ifdef CONFIG_USB_PRINTER
56 usb_printer_init();
57 # endif
58 # ifdef CONFIG_USB_CPIA
59 usb_cpia_init();
60 # endif
61 # ifdef CONFIG_USB_HUB
62 usb_hub_init();
63 # endif
64 # ifdef CONFIG_USB_SCSI
65 usb_scsi_init();
66 # endif
67 #endif
68 return 0;
71 * Clean up when unloading the module
73 void cleanup_drivers(void)
75 #ifndef MODULE
76 # ifdef CONFIG_USB_HUB
77 usb_hub_cleanup();
78 # endif
79 # ifdef CONFIG_USB_MOUSE
80 usb_mouse_cleanup();
81 # endif
82 #endif
85 #ifdef MODULE
86 int init_module(void)
88 return usb_init();
90 void cleanup_module(void)
92 cleanup_drivers();
94 #endif