2 * ALSA sequencer main module
3 * Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include <sound/driver.h>
23 #include <linux/init.h>
24 #include <sound/core.h>
25 #include <sound/initval.h>
27 #include <sound/seq_kernel.h>
28 #include "seq_clientmgr.h"
29 #include "seq_memory.h"
30 #include "seq_queue.h"
32 #include "seq_timer.h"
33 #include "seq_system.h"
35 #include <sound/seq_device.h>
37 int seq_client_load[64] = {[0 ... 63] = -1};
38 int seq_default_timer_class = SNDRV_TIMER_CLASS_GLOBAL;
39 int seq_default_timer_sclass = SNDRV_TIMER_SCLASS_NONE;
40 int seq_default_timer_card = -1;
41 int seq_default_timer_device = SNDRV_TIMER_GLOBAL_SYSTEM;
42 int seq_default_timer_subdevice = 0;
43 int seq_default_timer_resolution = 0; /* Hz */
45 MODULE_AUTHOR("Frank van de Pol <fvdpol@coil.demon.nl>, Jaroslav Kysela <perex@suse.cz>");
46 MODULE_DESCRIPTION("Advanced Linux Sound Architecture sequencer.");
47 MODULE_LICENSE("GPL");
48 MODULE_CLASSES("{sound}");
49 MODULE_SUPPORTED_DEVICE("sound");
51 MODULE_PARM(seq_client_load, "1-64i");
52 MODULE_PARM_DESC(seq_client_load, "The numbers of global (system) clients to load through kmod.");
53 MODULE_PARM(seq_default_timer_class, "i");
54 MODULE_PARM_DESC(seq_default_timer_class, "The default timer class.");
55 MODULE_PARM(seq_default_timer_sclass, "i");
56 MODULE_PARM_DESC(seq_default_timer_sclass, "The default timer slave class.");
57 MODULE_PARM(seq_default_timer_card, "i");
58 MODULE_PARM_DESC(seq_default_timer_card, "The default timer card number.");
59 MODULE_PARM(seq_default_timer_device, "i");
60 MODULE_PARM_DESC(seq_default_timer_device, "The default timer device number.");
61 MODULE_PARM(seq_default_timer_subdevice, "i");
62 MODULE_PARM_DESC(seq_default_timer_subdevice, "The default timer subdevice number.");
63 MODULE_PARM(seq_default_timer_resolution, "i");
64 MODULE_PARM_DESC(seq_default_timer_resolution, "The default timer resolution in Hz.");
71 static int __init alsa_seq_init(void)
75 if ((err = client_init_data()) < 0)
78 /* init memory, room for selected events */
79 if ((err = snd_sequencer_memory_init()) < 0)
82 /* init event queues */
83 if ((err = snd_seq_queues_init()) < 0)
86 /* register sequencer device */
87 if ((err = snd_sequencer_device_init()) < 0)
90 /* register proc interface */
91 if ((err = snd_seq_info_init()) < 0)
94 /* register our internal client */
95 if ((err = snd_seq_system_client_init()) < 0)
101 static void __exit alsa_seq_exit(void)
103 /* unregister our internal client */
104 snd_seq_system_client_done();
106 /* unregister proc interface */
109 /* delete timing queues */
110 snd_seq_queues_delete();
112 /* unregister sequencer device */
113 snd_sequencer_device_done();
115 /* release event memory */
116 snd_sequencer_memory_done();
119 module_init(alsa_seq_init)
120 module_exit(alsa_seq_exit)
122 /* seq_clientmgr.c */
123 EXPORT_SYMBOL(snd_seq_create_kernel_client);
124 EXPORT_SYMBOL(snd_seq_delete_kernel_client);
125 EXPORT_SYMBOL(snd_seq_kernel_client_enqueue);
126 EXPORT_SYMBOL(snd_seq_kernel_client_enqueue_blocking);
127 EXPORT_SYMBOL(snd_seq_kernel_client_dispatch);
128 EXPORT_SYMBOL(snd_seq_kernel_client_ctl);
129 EXPORT_SYMBOL(snd_seq_kernel_client_write_poll);
131 EXPORT_SYMBOL(snd_seq_expand_var_event);
132 EXPORT_SYMBOL(snd_seq_dump_var_event);
134 EXPORT_SYMBOL(snd_seq_event_port_attach);
135 EXPORT_SYMBOL(snd_seq_event_port_detach);
137 #if defined(CONFIG_SMP) || defined(CONFIG_SND_DEBUG)
138 /*EXPORT_SYMBOL(snd_seq_sleep_in_lock);*/
139 /*EXPORT_SYMBOL(snd_seq_sleep_timeout_in_lock);*/
140 EXPORT_SYMBOL(snd_use_lock_sync_helper);