1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22#include <linux/init.h>
23#include <linux/module.h>
24#include <linux/device.h>
25#include <sound/core.h>
26#include <sound/initval.h>
27
28#include <sound/seq_kernel.h>
29#include "seq_clientmgr.h"
30#include "seq_memory.h"
31#include "seq_queue.h"
32#include "seq_lock.h"
33#include "seq_timer.h"
34#include "seq_system.h"
35#include "seq_info.h"
36#include <sound/minors.h>
37#include <sound/seq_device.h>
38
39#if defined(CONFIG_SND_SEQ_DUMMY_MODULE)
40int seq_client_load[15] = {[0] = SNDRV_SEQ_CLIENT_DUMMY, [1 ... 14] = -1};
41#else
42int seq_client_load[15] = {[0 ... 14] = -1};
43#endif
44int seq_default_timer_class = SNDRV_TIMER_CLASS_GLOBAL;
45int seq_default_timer_sclass = SNDRV_TIMER_SCLASS_NONE;
46int seq_default_timer_card = -1;
47int seq_default_timer_device =
48#ifdef CONFIG_SND_SEQ_HRTIMER_DEFAULT
49 SNDRV_TIMER_GLOBAL_HRTIMER
50#elif defined(CONFIG_SND_SEQ_RTCTIMER_DEFAULT)
51 SNDRV_TIMER_GLOBAL_RTC
52#else
53 SNDRV_TIMER_GLOBAL_SYSTEM
54#endif
55 ;
56int seq_default_timer_subdevice = 0;
57int seq_default_timer_resolution = 0;
58
59MODULE_AUTHOR("Frank van de Pol <fvdpol@coil.demon.nl>, Jaroslav Kysela <perex@perex.cz>");
60MODULE_DESCRIPTION("Advanced Linux Sound Architecture sequencer.");
61MODULE_LICENSE("GPL");
62
63module_param_array(seq_client_load, int, NULL, 0444);
64MODULE_PARM_DESC(seq_client_load, "The numbers of global (system) clients to load through kmod.");
65module_param(seq_default_timer_class, int, 0644);
66MODULE_PARM_DESC(seq_default_timer_class, "The default timer class.");
67module_param(seq_default_timer_sclass, int, 0644);
68MODULE_PARM_DESC(seq_default_timer_sclass, "The default timer slave class.");
69module_param(seq_default_timer_card, int, 0644);
70MODULE_PARM_DESC(seq_default_timer_card, "The default timer card number.");
71module_param(seq_default_timer_device, int, 0644);
72MODULE_PARM_DESC(seq_default_timer_device, "The default timer device number.");
73module_param(seq_default_timer_subdevice, int, 0644);
74MODULE_PARM_DESC(seq_default_timer_subdevice, "The default timer subdevice number.");
75module_param(seq_default_timer_resolution, int, 0644);
76MODULE_PARM_DESC(seq_default_timer_resolution, "The default timer resolution in Hz.");
77
78MODULE_ALIAS_CHARDEV(CONFIG_SND_MAJOR, SNDRV_MINOR_SEQUENCER);
79MODULE_ALIAS("devname:snd/seq");
80
81
82
83
84
85static int __init alsa_seq_init(void)
86{
87 int err;
88
89 snd_seq_autoload_lock();
90 if ((err = client_init_data()) < 0)
91 goto error;
92
93
94 if ((err = snd_sequencer_memory_init()) < 0)
95 goto error;
96
97
98 if ((err = snd_seq_queues_init()) < 0)
99 goto error;
100
101
102 if ((err = snd_sequencer_device_init()) < 0)
103 goto error;
104
105
106 if ((err = snd_seq_info_init()) < 0)
107 goto error;
108
109
110 if ((err = snd_seq_system_client_init()) < 0)
111 goto error;
112
113 error:
114 snd_seq_autoload_unlock();
115 return err;
116}
117
118static void __exit alsa_seq_exit(void)
119{
120
121 snd_seq_system_client_done();
122
123
124 snd_seq_info_done();
125
126
127 snd_seq_queues_delete();
128
129
130 snd_sequencer_device_done();
131
132
133 snd_sequencer_memory_done();
134}
135
136module_init(alsa_seq_init)
137module_exit(alsa_seq_exit)
138