1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * ALSA sequencer main module
7 #include <linux/init.h>
8 #include <linux/module.h>
9 #include <linux/device.h>
10 #include <sound/core.h>
11 #include <sound/initval.h>
13 #include <sound/seq_kernel.h>
14 #include "seq_clientmgr.h"
15 #include "seq_memory.h"
16 #include "seq_queue.h"
18 #include "seq_timer.h"
19 #include "seq_system.h"
21 #include <sound/minors.h>
22 #include <sound/seq_device.h>
24 #if defined(CONFIG_SND_SEQ_DUMMY_MODULE)
25 int seq_client_load[15] = {[0] = SNDRV_SEQ_CLIENT_DUMMY, [1 ... 14] = -1};
27 int seq_client_load[15] = {[0 ... 14] = -1};
29 int seq_default_timer_class = SNDRV_TIMER_CLASS_GLOBAL;
30 int seq_default_timer_sclass = SNDRV_TIMER_SCLASS_NONE;
31 int seq_default_timer_card = -1;
32 int seq_default_timer_device =
33 #ifdef CONFIG_SND_SEQ_HRTIMER_DEFAULT
34 SNDRV_TIMER_GLOBAL_HRTIMER
36 SNDRV_TIMER_GLOBAL_SYSTEM
39 int seq_default_timer_subdevice = 0;
40 int seq_default_timer_resolution = 0; /* Hz */
43 MODULE_DESCRIPTION("Advanced Linux Sound Architecture sequencer.");
44 MODULE_LICENSE("GPL");
46 module_param_array(seq_client_load, int, NULL, 0444);
47 MODULE_PARM_DESC(seq_client_load, "The numbers of global (system) clients to load through kmod.");
48 module_param(seq_default_timer_class, int, 0644);
49 MODULE_PARM_DESC(seq_default_timer_class, "The default timer class.");
50 module_param(seq_default_timer_sclass, int, 0644);
51 MODULE_PARM_DESC(seq_default_timer_sclass, "The default timer slave class.");
52 module_param(seq_default_timer_card, int, 0644);
53 MODULE_PARM_DESC(seq_default_timer_card, "The default timer card number.");
54 module_param(seq_default_timer_device, int, 0644);
55 MODULE_PARM_DESC(seq_default_timer_device, "The default timer device number.");
56 module_param(seq_default_timer_subdevice, int, 0644);
57 MODULE_PARM_DESC(seq_default_timer_subdevice, "The default timer subdevice number.");
58 module_param(seq_default_timer_resolution, int, 0644);
59 MODULE_PARM_DESC(seq_default_timer_resolution, "The default timer resolution in Hz.");
61 MODULE_ALIAS_CHARDEV(CONFIG_SND_MAJOR, SNDRV_MINOR_SEQUENCER);
62 MODULE_ALIAS("devname:snd/seq");
68 static int __init alsa_seq_init(void)
72 err = client_init_data();
76 /* register sequencer device */
77 err = snd_sequencer_device_init();
81 /* register proc interface */
82 err = snd_seq_info_init();
86 /* register our internal client */
87 err = snd_seq_system_client_init();
91 snd_seq_autoload_init();
97 snd_sequencer_device_done();
102 static void __exit alsa_seq_exit(void)
104 /* unregister our internal client */
105 snd_seq_system_client_done();
107 /* unregister proc interface */
110 /* delete timing queues */
111 snd_seq_queues_delete();
113 /* unregister sequencer device */
114 snd_sequencer_device_done();
116 snd_seq_autoload_exit();
119 module_init(alsa_seq_init)
120 module_exit(alsa_seq_exit)