summaryrefslogtreecommitdiffstats
path: root/drivers/usb/usb-core.c
blob: f9f73a051201d30fae64f70583dd92a0d46f39fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
 * driver/usb/usb-core.c
 *
 * (C) Copyright David Waite 1999
 * based on code from usb.c, by Linus Torvolds
 *
 * The purpose of this file is to pull any and all generic modular code from
 * usb.c and put it in a separate file. This way usb.c is kept as a generic
 * library, while this file handles starting drivers, etc.
 *
 */
#include <linux/kernel.h>
#include <linux/config.h>
#include <linux/module.h>

#include "inits.h"
#include "usb.h"

#ifndef CONFIG_USB_MODULE
#	ifdef CONFIG_USB_UHCI
		int uhci_init(void);
#	endif
#	ifdef CONFIG_USB_OHCI
		int ohci_init(void);
#	endif
#	ifdef CONFIG_USB_OHCI_HCD
		int ohci_hcd_init(void);
#	endif
#endif

int usb_init(void)
{
#ifndef CONFIG_USB_MODULE
#	ifdef CONFIG_USB_UHCI
		uhci_init();
#	endif
#	ifdef CONFIG_USB_OHCI
		ohci_init();
#	endif
#	ifdef CONFIG_USB_OHCI_HCD
		ohci_hcd_init(); 
#	endif
#	ifdef CONFIG_USB_MOUSE
		usb_mouse_init();
#	endif
#	ifdef CONFIG_USB_KBD
		usb_kbd_init();
#	endif
#	ifdef CONFIG_USB_AUDIO
		usb_audio_init();
#	endif
#	ifdef CONFIG_USB_ACM
		usb_acm_init();
#	endif
#	ifdef CONFIG_USB_PRINTER
		usb_print_init();
#	endif
#	ifdef CONFIG_USB_CPIA
		usb_cpia_init();
#	endif
#	ifdef CONFIG_USB_HUB
		usb_hub_init();
#	endif
#	ifdef CONFIG_USB_SCSI
		usb_scsi_init();
#	endif
#endif
	return 0;
}
/*
 *  Clean up when unloading the module
 */
void cleanup_drivers(void)
{
#ifndef MODULE
#	ifdef CONFIG_USB_HUB
		usb_hub_cleanup();
#	endif
#	ifdef CONFIG_USB_MOUSE
        	usb_mouse_cleanup();
#	endif
#endif
}

#ifdef MODULE
int init_module(void)
{
	return usb_init();
}
void cleanup_module(void)
{
	cleanup_drivers();
}
#endif