blob: 812f91b3de5b88fca9259dece4ac4c4a5787a551 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * Advanced Linux Sound Architecture
Jaroslav Kyselac1017a42007-10-15 09:50:19 +02003 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
Linus Torvalds1da177e2005-04-16 15:20:36 -07004 *
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
Linus Torvalds1da177e2005-04-16 15:20:36 -070022#include <linux/init.h>
23#include <linux/slab.h>
24#include <linux/time.h>
Takashi Iwai9a1a2a12005-11-22 15:46:41 +010025#include <linux/device.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070026#include <linux/moduleparam.h>
27#include <sound/core.h>
28#include <sound/minors.h>
29#include <sound/info.h>
30#include <sound/version.h>
31#include <sound/control.h>
32#include <sound/initval.h>
33#include <linux/kmod.h>
Ingo Molnar1a60d4c2006-01-16 16:29:08 +010034#include <linux/mutex.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070035
36#define SNDRV_OS_MINORS 256
37
38static int major = CONFIG_SND_MAJOR;
39int snd_major;
Takashi Iwaic0d3fb32006-04-28 15:13:39 +020040EXPORT_SYMBOL(snd_major);
41
Linus Torvalds1da177e2005-04-16 15:20:36 -070042static int cards_limit = 1;
Linus Torvalds1da177e2005-04-16 15:20:36 -070043
Jaroslav Kyselac1017a42007-10-15 09:50:19 +020044MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
Linus Torvalds1da177e2005-04-16 15:20:36 -070045MODULE_DESCRIPTION("Advanced Linux Sound Architecture driver for soundcards.");
46MODULE_LICENSE("GPL");
47module_param(major, int, 0444);
48MODULE_PARM_DESC(major, "Major # for sound driver.");
49module_param(cards_limit, int, 0444);
50MODULE_PARM_DESC(cards_limit, "Count of auto-loadable soundcards.");
Linus Torvalds1da177e2005-04-16 15:20:36 -070051MODULE_ALIAS_CHARDEV_MAJOR(CONFIG_SND_MAJOR);
52
53/* this one holds the actual max. card number currently available.
54 * as default, it's identical with cards_limit option. when more
55 * modules are loaded manually, this limit number increases, too.
56 */
57int snd_ecards_limit;
Takashi Iwaic0d3fb32006-04-28 15:13:39 +020058EXPORT_SYMBOL(snd_ecards_limit);
Linus Torvalds1da177e2005-04-16 15:20:36 -070059
Clemens Ladisch6983b722005-11-20 14:05:49 +010060static struct snd_minor *snd_minors[SNDRV_OS_MINORS];
Ingo Molnar1a60d4c2006-01-16 16:29:08 +010061static DEFINE_MUTEX(sound_mutex);
Linus Torvalds1da177e2005-04-16 15:20:36 -070062
Linus Torvalds1da177e2005-04-16 15:20:36 -070063#ifdef CONFIG_KMOD
64
65/**
66 * snd_request_card - try to load the card module
67 * @card: the card number
68 *
69 * Tries to load the module "snd-card-X" for the given card number
70 * via KMOD. Returns immediately if already loaded.
71 */
72void snd_request_card(int card)
73{
Takashi Iwai746df942006-05-15 19:49:05 +020074 if (snd_card_locked(card))
Linus Torvalds1da177e2005-04-16 15:20:36 -070075 return;
76 if (card < 0 || card >= cards_limit)
77 return;
78 request_module("snd-card-%i", card);
79}
80
Takashi Iwaic0d3fb32006-04-28 15:13:39 +020081EXPORT_SYMBOL(snd_request_card);
82
Linus Torvalds1da177e2005-04-16 15:20:36 -070083static void snd_request_other(int minor)
84{
85 char *str;
86
Linus Torvalds1da177e2005-04-16 15:20:36 -070087 switch (minor) {
88 case SNDRV_MINOR_SEQUENCER: str = "snd-seq"; break;
89 case SNDRV_MINOR_TIMER: str = "snd-timer"; break;
90 default: return;
91 }
92 request_module(str);
93}
94
95#endif /* request_module support */
96
Clemens Ladischf87135f2005-11-20 14:06:59 +010097/**
98 * snd_lookup_minor_data - get user data of a registered device
99 * @minor: the minor number
100 * @type: device type (SNDRV_DEVICE_TYPE_XXX)
101 *
102 * Checks that a minor device with the specified type is registered, and returns
103 * its user data pointer.
104 */
105void *snd_lookup_minor_data(unsigned int minor, int type)
106{
107 struct snd_minor *mreg;
108 void *private_data;
109
Adrian Bunk3a63e4442006-03-13 14:14:10 +0100110 if (minor >= ARRAY_SIZE(snd_minors))
Clemens Ladischf87135f2005-11-20 14:06:59 +0100111 return NULL;
Ingo Molnar1a60d4c2006-01-16 16:29:08 +0100112 mutex_lock(&sound_mutex);
Clemens Ladischf87135f2005-11-20 14:06:59 +0100113 mreg = snd_minors[minor];
114 if (mreg && mreg->type == type)
115 private_data = mreg->private_data;
116 else
117 private_data = NULL;
Ingo Molnar1a60d4c2006-01-16 16:29:08 +0100118 mutex_unlock(&sound_mutex);
Clemens Ladischf87135f2005-11-20 14:06:59 +0100119 return private_data;
120}
121
Takashi Iwaic0d3fb32006-04-28 15:13:39 +0200122EXPORT_SYMBOL(snd_lookup_minor_data);
123
Linus Torvalds1da177e2005-04-16 15:20:36 -0700124static int snd_open(struct inode *inode, struct file *file)
125{
Clemens Ladisch332682b2005-11-20 14:07:47 +0100126 unsigned int minor = iminor(inode);
Takashi Iwai512bbd62005-11-17 13:51:18 +0100127 struct snd_minor *mptr = NULL;
Arjan van de Ven99ac48f2006-03-28 01:56:41 -0800128 const struct file_operations *old_fops;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700129 int err = 0;
130
Adrian Bunk3a63e4442006-03-13 14:14:10 +0100131 if (minor >= ARRAY_SIZE(snd_minors))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700132 return -ENODEV;
Clemens Ladisch332682b2005-11-20 14:07:47 +0100133 mptr = snd_minors[minor];
134 if (mptr == NULL) {
135#ifdef CONFIG_KMOD
136 int dev = SNDRV_MINOR_DEVICE(minor);
137 if (dev == SNDRV_MINOR_CONTROL) {
138 /* /dev/aloadC? */
139 int card = SNDRV_MINOR_CARD(minor);
140 if (snd_cards[card] == NULL)
141 snd_request_card(card);
142 } else if (dev == SNDRV_MINOR_GLOBAL) {
143 /* /dev/aloadSEQ */
144 snd_request_other(minor);
145 }
146#ifndef CONFIG_SND_DYNAMIC_MINORS
147 /* /dev/snd/{controlC?,seq} */
148 mptr = snd_minors[minor];
149 if (mptr == NULL)
150#endif
151#endif
152 return -ENODEV;
153 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700154 old_fops = file->f_op;
155 file->f_op = fops_get(mptr->f_ops);
156 if (file->f_op->open)
157 err = file->f_op->open(inode, file);
158 if (err) {
159 fops_put(file->f_op);
160 file->f_op = fops_get(old_fops);
161 }
162 fops_put(old_fops);
163 return err;
164}
165
Arjan van de Ven9c2e08c2007-02-12 00:55:37 -0800166static const struct file_operations snd_fops =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700167{
168 .owner = THIS_MODULE,
169 .open = snd_open
170};
171
Clemens Ladisch332682b2005-11-20 14:07:47 +0100172#ifdef CONFIG_SND_DYNAMIC_MINORS
173static int snd_find_free_minor(void)
174{
175 int minor;
176
177 for (minor = 0; minor < ARRAY_SIZE(snd_minors); ++minor) {
178 /* skip minors still used statically for autoloading devices */
179 if (SNDRV_MINOR_DEVICE(minor) == SNDRV_MINOR_CONTROL ||
180 minor == SNDRV_MINOR_SEQUENCER)
181 continue;
182 if (!snd_minors[minor])
183 return minor;
184 }
185 return -EBUSY;
186}
187#else
Takashi Iwai512bbd62005-11-17 13:51:18 +0100188static int snd_kernel_minor(int type, struct snd_card *card, int dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700189{
190 int minor;
191
192 switch (type) {
193 case SNDRV_DEVICE_TYPE_SEQUENCER:
194 case SNDRV_DEVICE_TYPE_TIMER:
195 minor = type;
196 break;
197 case SNDRV_DEVICE_TYPE_CONTROL:
198 snd_assert(card != NULL, return -EINVAL);
199 minor = SNDRV_MINOR(card->number, type);
200 break;
201 case SNDRV_DEVICE_TYPE_HWDEP:
202 case SNDRV_DEVICE_TYPE_RAWMIDI:
203 case SNDRV_DEVICE_TYPE_PCM_PLAYBACK:
204 case SNDRV_DEVICE_TYPE_PCM_CAPTURE:
205 snd_assert(card != NULL, return -EINVAL);
206 minor = SNDRV_MINOR(card->number, type + dev);
207 break;
208 default:
209 return -EINVAL;
210 }
211 snd_assert(minor >= 0 && minor < SNDRV_OS_MINORS, return -EINVAL);
212 return minor;
213}
Clemens Ladisch332682b2005-11-20 14:07:47 +0100214#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700215
216/**
Johannes Berg12b131c2006-10-05 15:05:34 +0200217 * snd_register_device_for_dev - Register the ALSA device file for the card
Linus Torvalds1da177e2005-04-16 15:20:36 -0700218 * @type: the device type, SNDRV_DEVICE_TYPE_XXX
219 * @card: the card instance
220 * @dev: the device index
Clemens Ladisch2af677f2005-11-20 14:03:48 +0100221 * @f_ops: the file operations
Clemens Ladischf87135f2005-11-20 14:06:59 +0100222 * @private_data: user pointer for f_ops->open()
Linus Torvalds1da177e2005-04-16 15:20:36 -0700223 * @name: the device file name
Johannes Berg12b131c2006-10-05 15:05:34 +0200224 * @device: the &struct device to link this new device to
Linus Torvalds1da177e2005-04-16 15:20:36 -0700225 *
226 * Registers an ALSA device file for the given card.
227 * The operators have to be set in reg parameter.
228 *
Johannes Berg12b131c2006-10-05 15:05:34 +0200229 * Returns zero if successful, or a negative error code on failure.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700230 */
Johannes Berg12b131c2006-10-05 15:05:34 +0200231int snd_register_device_for_dev(int type, struct snd_card *card, int dev,
232 const struct file_operations *f_ops,
233 void *private_data,
234 const char *name, struct device *device)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700235{
Clemens Ladisch332682b2005-11-20 14:07:47 +0100236 int minor;
Takashi Iwai512bbd62005-11-17 13:51:18 +0100237 struct snd_minor *preg;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700238
Linus Torvalds1da177e2005-04-16 15:20:36 -0700239 snd_assert(name, return -EINVAL);
Clemens Ladisch562b5902006-07-05 11:24:22 +0200240 preg = kmalloc(sizeof *preg, GFP_KERNEL);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700241 if (preg == NULL)
242 return -ENOMEM;
Clemens Ladisch2af677f2005-11-20 14:03:48 +0100243 preg->type = type;
Clemens Ladisch6983b722005-11-20 14:05:49 +0100244 preg->card = card ? card->number : -1;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700245 preg->device = dev;
Clemens Ladisch2af677f2005-11-20 14:03:48 +0100246 preg->f_ops = f_ops;
Clemens Ladischf87135f2005-11-20 14:06:59 +0100247 preg->private_data = private_data;
Ingo Molnar1a60d4c2006-01-16 16:29:08 +0100248 mutex_lock(&sound_mutex);
Clemens Ladisch332682b2005-11-20 14:07:47 +0100249#ifdef CONFIG_SND_DYNAMIC_MINORS
250 minor = snd_find_free_minor();
251#else
252 minor = snd_kernel_minor(type, card, dev);
253 if (minor >= 0 && snd_minors[minor])
254 minor = -EBUSY;
255#endif
256 if (minor < 0) {
Ingo Molnar1a60d4c2006-01-16 16:29:08 +0100257 mutex_unlock(&sound_mutex);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700258 kfree(preg);
Clemens Ladisch332682b2005-11-20 14:07:47 +0100259 return minor;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700260 }
Clemens Ladisch6983b722005-11-20 14:05:49 +0100261 snd_minors[minor] = preg;
Greg Kroah-Hartmand80f19f2006-08-07 22:19:37 -0700262 preg->dev = device_create(sound_class, device, MKDEV(major, minor),
263 "%s", name);
Mariusz Kozlowski24690492007-10-09 10:34:06 +0200264 if (IS_ERR(preg->dev)) {
265 snd_minors[minor] = NULL;
266 mutex_unlock(&sound_mutex);
267 minor = PTR_ERR(preg->dev);
268 kfree(preg);
269 return minor;
270 }
271
Greg Kroah-Hartmand80f19f2006-08-07 22:19:37 -0700272 if (preg->dev)
273 dev_set_drvdata(preg->dev, private_data);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700274
Ingo Molnar1a60d4c2006-01-16 16:29:08 +0100275 mutex_unlock(&sound_mutex);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700276 return 0;
277}
278
Johannes Berg12b131c2006-10-05 15:05:34 +0200279EXPORT_SYMBOL(snd_register_device_for_dev);
Takashi Iwaic0d3fb32006-04-28 15:13:39 +0200280
Takashi Iwai9d19f482006-09-06 14:27:46 +0200281/* find the matching minor record
282 * return the index of snd_minor, or -1 if not found
283 */
284static int find_snd_minor(int type, struct snd_card *card, int dev)
285{
286 int cardnum, minor;
287 struct snd_minor *mptr;
288
289 cardnum = card ? card->number : -1;
290 for (minor = 0; minor < ARRAY_SIZE(snd_minors); ++minor)
291 if ((mptr = snd_minors[minor]) != NULL &&
292 mptr->type == type &&
293 mptr->card == cardnum &&
294 mptr->device == dev)
295 return minor;
296 return -1;
297}
298
Linus Torvalds1da177e2005-04-16 15:20:36 -0700299/**
300 * snd_unregister_device - unregister the device on the given card
301 * @type: the device type, SNDRV_DEVICE_TYPE_XXX
302 * @card: the card instance
303 * @dev: the device index
304 *
305 * Unregisters the device file already registered via
306 * snd_register_device().
307 *
308 * Returns zero if sucecessful, or a negative error code on failure
309 */
Takashi Iwai512bbd62005-11-17 13:51:18 +0100310int snd_unregister_device(int type, struct snd_card *card, int dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700311{
Takashi Iwai9d19f482006-09-06 14:27:46 +0200312 int minor;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700313
Ingo Molnar1a60d4c2006-01-16 16:29:08 +0100314 mutex_lock(&sound_mutex);
Takashi Iwai9d19f482006-09-06 14:27:46 +0200315 minor = find_snd_minor(type, card, dev);
316 if (minor < 0) {
Ingo Molnar1a60d4c2006-01-16 16:29:08 +0100317 mutex_unlock(&sound_mutex);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700318 return -EINVAL;
319 }
320
Greg Kroah-Hartmand80f19f2006-08-07 22:19:37 -0700321 device_destroy(sound_class, MKDEV(major, minor));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700322
Takashi Iwai9d19f482006-09-06 14:27:46 +0200323 kfree(snd_minors[minor]);
Clemens Ladisch6983b722005-11-20 14:05:49 +0100324 snd_minors[minor] = NULL;
Ingo Molnar1a60d4c2006-01-16 16:29:08 +0100325 mutex_unlock(&sound_mutex);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700326 return 0;
327}
328
Takashi Iwaic0d3fb32006-04-28 15:13:39 +0200329EXPORT_SYMBOL(snd_unregister_device);
330
Takashi Iwai9d19f482006-09-06 14:27:46 +0200331int snd_add_device_sysfs_file(int type, struct snd_card *card, int dev,
Greg Kroah-Hartmand80f19f2006-08-07 22:19:37 -0700332 struct device_attribute *attr)
Takashi Iwai9d19f482006-09-06 14:27:46 +0200333{
334 int minor, ret = -EINVAL;
Greg Kroah-Hartmand80f19f2006-08-07 22:19:37 -0700335 struct device *d;
Takashi Iwai9d19f482006-09-06 14:27:46 +0200336
337 mutex_lock(&sound_mutex);
338 minor = find_snd_minor(type, card, dev);
Greg Kroah-Hartmand80f19f2006-08-07 22:19:37 -0700339 if (minor >= 0 && (d = snd_minors[minor]->dev) != NULL)
340 ret = device_create_file(d, attr);
Takashi Iwai9d19f482006-09-06 14:27:46 +0200341 mutex_unlock(&sound_mutex);
342 return ret;
343
344}
345
346EXPORT_SYMBOL(snd_add_device_sysfs_file);
347
Takashi Iwaie28563c2005-12-01 10:42:42 +0100348#ifdef CONFIG_PROC_FS
Linus Torvalds1da177e2005-04-16 15:20:36 -0700349/*
350 * INFO PART
351 */
352
Takashi Iwai6581f4e2006-05-17 17:14:51 +0200353static struct snd_info_entry *snd_minor_info_entry;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700354
Clemens Ladisch2af677f2005-11-20 14:03:48 +0100355static const char *snd_device_type_name(int type)
356{
357 switch (type) {
358 case SNDRV_DEVICE_TYPE_CONTROL:
359 return "control";
360 case SNDRV_DEVICE_TYPE_HWDEP:
361 return "hardware dependent";
362 case SNDRV_DEVICE_TYPE_RAWMIDI:
363 return "raw midi";
364 case SNDRV_DEVICE_TYPE_PCM_PLAYBACK:
365 return "digital audio playback";
366 case SNDRV_DEVICE_TYPE_PCM_CAPTURE:
367 return "digital audio capture";
368 case SNDRV_DEVICE_TYPE_SEQUENCER:
369 return "sequencer";
370 case SNDRV_DEVICE_TYPE_TIMER:
371 return "timer";
372 default:
373 return "?";
374 }
375}
376
Takashi Iwai512bbd62005-11-17 13:51:18 +0100377static void snd_minor_info_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700378{
Clemens Ladisch6983b722005-11-20 14:05:49 +0100379 int minor;
Takashi Iwai512bbd62005-11-17 13:51:18 +0100380 struct snd_minor *mptr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700381
Ingo Molnar1a60d4c2006-01-16 16:29:08 +0100382 mutex_lock(&sound_mutex);
Clemens Ladisch6983b722005-11-20 14:05:49 +0100383 for (minor = 0; minor < SNDRV_OS_MINORS; ++minor) {
384 if (!(mptr = snd_minors[minor]))
385 continue;
386 if (mptr->card >= 0) {
387 if (mptr->device >= 0)
Clemens Ladischd0015442005-11-20 14:09:05 +0100388 snd_iprintf(buffer, "%3i: [%2i-%2i]: %s\n",
Clemens Ladisch6983b722005-11-20 14:05:49 +0100389 minor, mptr->card, mptr->device,
390 snd_device_type_name(mptr->type));
391 else
Clemens Ladischd0015442005-11-20 14:09:05 +0100392 snd_iprintf(buffer, "%3i: [%2i] : %s\n",
Clemens Ladisch6983b722005-11-20 14:05:49 +0100393 minor, mptr->card,
394 snd_device_type_name(mptr->type));
395 } else
Clemens Ladischd0015442005-11-20 14:09:05 +0100396 snd_iprintf(buffer, "%3i: : %s\n", minor,
Clemens Ladisch6983b722005-11-20 14:05:49 +0100397 snd_device_type_name(mptr->type));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700398 }
Ingo Molnar1a60d4c2006-01-16 16:29:08 +0100399 mutex_unlock(&sound_mutex);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700400}
401
402int __init snd_minor_info_init(void)
403{
Takashi Iwai512bbd62005-11-17 13:51:18 +0100404 struct snd_info_entry *entry;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700405
406 entry = snd_info_create_module_entry(THIS_MODULE, "devices", NULL);
407 if (entry) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700408 entry->c.text.read = snd_minor_info_read;
409 if (snd_info_register(entry) < 0) {
410 snd_info_free_entry(entry);
411 entry = NULL;
412 }
413 }
414 snd_minor_info_entry = entry;
415 return 0;
416}
417
418int __exit snd_minor_info_done(void)
419{
Takashi Iwai746d4a02006-06-23 14:37:59 +0200420 snd_info_free_entry(snd_minor_info_entry);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700421 return 0;
422}
Takashi Iwaie28563c2005-12-01 10:42:42 +0100423#endif /* CONFIG_PROC_FS */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700424
425/*
426 * INIT PART
427 */
428
429static int __init alsa_sound_init(void)
430{
Linus Torvalds1da177e2005-04-16 15:20:36 -0700431 snd_major = major;
432 snd_ecards_limit = cards_limit;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700433 if (register_chrdev(major, "alsa", &snd_fops)) {
434 snd_printk(KERN_ERR "unable to register native major device number %d\n", major);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700435 return -EIO;
436 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700437 if (snd_info_init() < 0) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700438 unregister_chrdev(major, "alsa");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700439 return -ENOMEM;
440 }
441 snd_info_minor_register();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700442#ifndef MODULE
443 printk(KERN_INFO "Advanced Linux Sound Architecture Driver Version " CONFIG_SND_VERSION CONFIG_SND_DATE ".\n");
444#endif
445 return 0;
446}
447
448static void __exit alsa_sound_exit(void)
449{
Linus Torvalds1da177e2005-04-16 15:20:36 -0700450 snd_info_minor_unregister();
451 snd_info_done();
Akinobu Mita68fc4fa2007-07-19 01:47:50 -0700452 unregister_chrdev(major, "alsa");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700453}
454
455module_init(alsa_sound_init)
456module_exit(alsa_sound_exit)