Linux Audio

Check our new training course

Buildroot integration, development and maintenance

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