76 |
*/ |
*/ |
77 |
void snd_request_card(int card) |
void snd_request_card(int card) |
78 |
{ |
{ |
|
char str[32]; |
|
79 |
int locked; |
int locked; |
80 |
|
|
81 |
read_lock(&snd_card_rwlock); |
read_lock(&snd_card_rwlock); |
85 |
return; |
return; |
86 |
if (card < 0 || card >= cards_limit) |
if (card < 0 || card >= cards_limit) |
87 |
return; |
return; |
88 |
sprintf(str, "snd-card-%i", card); |
request_module("snd-card-%i", card); |
|
request_module(str); |
|
89 |
} |
} |
90 |
|
|
91 |
static void snd_request_other(int minor) |
static void snd_request_other(int minor) |
154 |
|
|
155 |
struct file_operations snd_fops = |
struct file_operations snd_fops = |
156 |
{ |
{ |
|
#ifndef LINUX_2_2 |
|
157 |
.owner = THIS_MODULE, |
.owner = THIS_MODULE, |
|
#endif |
|
158 |
.open = snd_open |
.open = snd_open |
159 |
}; |
}; |
160 |
|
|
221 |
} |
} |
222 |
list_add_tail(&preg->list, &snd_minors_hash[SNDRV_MINOR_CARD(minor)]); |
list_add_tail(&preg->list, &snd_minors_hash[SNDRV_MINOR_CARD(minor)]); |
223 |
#ifdef CONFIG_DEVFS_FS |
#ifdef CONFIG_DEVFS_FS |
224 |
if (strncmp(name, "controlC", 8)) { /* created in sound.c */ |
if (strncmp(name, "controlC", 8)) /* created in sound.c */ |
225 |
char dname[32]; |
devfs_mk_cdev(MKDEV(major, minor), S_IFCHR | device_mode, "snd/%s", name); |
|
sprintf(dname, "snd/%s", name); |
|
|
devfs_register(NULL, dname, DEVFS_FL_DEFAULT, |
|
|
major, minor, device_mode | S_IFCHR, |
|
|
&snd_fops, NULL); |
|
|
} |
|
226 |
#endif |
#endif |
227 |
up(&sound_mutex); |
up(&sound_mutex); |
228 |
return 0; |
return 0; |
323 |
{ |
{ |
324 |
#ifdef CONFIG_DEVFS_FS |
#ifdef CONFIG_DEVFS_FS |
325 |
short controlnum; |
short controlnum; |
|
char controlname[24]; |
|
326 |
#endif |
#endif |
327 |
#ifdef CONFIG_SND_OSSEMUL |
#ifdef CONFIG_SND_OSSEMUL |
328 |
int err; |
int err; |
358 |
snd_info_minor_register(); |
snd_info_minor_register(); |
359 |
#endif |
#endif |
360 |
#ifdef CONFIG_DEVFS_FS |
#ifdef CONFIG_DEVFS_FS |
361 |
for (controlnum = 0; controlnum < cards_limit; controlnum++) { |
for (controlnum = 0; controlnum < cards_limit; controlnum++) |
362 |
sprintf(controlname, "snd/controlC%d", controlnum); |
devfs_mk_cdev(MKDEV(major, controlnum<<5), S_IFCHR | device_mode, "snd/controlC%d", controlnum); |
|
devfs_register(NULL, controlname, DEVFS_FL_DEFAULT, |
|
|
major, controlnum<<5, device_mode | S_IFCHR, |
|
|
&snd_fops, NULL); |
|
|
} |
|
363 |
#endif |
#endif |
364 |
#ifndef MODULE |
#ifndef MODULE |
365 |
printk(KERN_INFO "Advanced Linux Sound Architecture Driver Version " CONFIG_SND_VERSION CONFIG_SND_DATE ".\n"); |
printk(KERN_INFO "Advanced Linux Sound Architecture Driver Version " CONFIG_SND_VERSION CONFIG_SND_DATE ".\n"); |
366 |
#endif |
#endif |
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) && defined(CONFIG_APM) |
|
|
pm_init(); |
|
|
#endif |
|
367 |
return 0; |
return 0; |
368 |
} |
} |
369 |
|
|
378 |
snd_info_minor_unregister(); |
snd_info_minor_unregister(); |
379 |
#endif |
#endif |
380 |
snd_info_done(); |
snd_info_done(); |
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) && defined(CONFIG_APM) |
|
|
pm_done(); |
|
|
#endif |
|
381 |
#ifdef CONFIG_SND_DEBUG_MEMORY |
#ifdef CONFIG_SND_DEBUG_MEMORY |
382 |
snd_memory_done(); |
snd_memory_done(); |
383 |
#endif |
#endif |