Import 2.3.35pre2
[davej-history.git] / drivers / usb / usb-core.c
blob1c87124f74221f2ecb9f9f9ecdaf907d3efe55ea
1 /*
2 * driver/usb/usb-core.c
4 * (C) Copyright David Waite 1999
5 * based on code from usb.c, by Linus Torvalds
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/version.h>
13 #include <linux/kernel.h>
14 #include <linux/config.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_HCD
24 int ohci_hcd_init(void);
25 # endif
26 #endif
28 int usb_init(void)
30 usb_major_init();
31 #ifdef CONFIG_USB_PROC
32 proc_usb_init();
33 #endif
34 usb_hub_init();
36 #ifndef CONFIG_USB_MODULE
37 # ifdef CONFIG_USB_UHCI
38 uhci_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_HP_SCANNER
47 usb_hp_scanner_init();
48 # endif
49 # ifdef CONFIG_USB_KBD
50 usb_kbd_init();
51 # endif
52 # ifdef CONFIG_USB_AUDIO
53 usb_audio_init();
54 # endif
55 # ifdef CONFIG_USB_ACM
56 usb_acm_init();
57 # endif
58 # ifdef CONFIG_USB_PRINTER
59 usb_printer_init();
60 # endif
61 # ifdef CONFIG_USB_SERIAL
62 usb_serial_init();
63 # endif
64 # ifdef CONFIG_USB_CPIA
65 usb_cpia_init();
66 # endif
67 # ifdef CONFIG_USB_DC2XX
68 usb_dc2xx_init();
69 # endif
70 # ifdef CONFIG_USB_SCSI
71 usb_scsi_init();
72 # endif
73 # ifdef CONFIG_USB_DABUSB
74 dabusb_init();
75 # endif
76 #endif
77 return 0;
81 * Clean up when unloading the module
83 void cleanup_drivers(void)
85 usb_major_cleanup();
86 #ifdef CONFIG_USB_PROC
87 proc_usb_cleanup ();
88 #endif
89 usb_hub_cleanup();
91 #ifndef MODULE
92 # ifdef CONFIG_USB_MOUSE
93 usb_mouse_cleanup();
94 # endif
95 # ifdef CONFIG_USB_HP_SCANNER
96 usb_hp_scanner_cleanup();
97 # endif
98 # ifdef CONFIG_USB_DABUSB
99 dabusb_cleanup();
100 # endif
101 # ifdef CONFIG_USB_KBD
102 usb_kbd_cleanup();
103 # endif
104 # ifdef CONFIG_USB_ACM
105 usb_acm_cleanup();
106 # endif
107 # ifdef CONFIG_USB_CPIA
108 usb_cpia_cleanup();
109 # endif
110 # ifdef CONFIG_USB_DC2XX
111 usb_dc2xx_cleanup();
112 # endif
113 #endif
116 #ifdef MODULE
117 int init_module(void)
119 return usb_init();
122 void cleanup_module(void)
124 cleanup_drivers();
126 #endif