Commit 7f28e6b5 authored by Jaroslav Kysela's avatar Jaroslav Kysela

ALSA CVS update - Takashi Iwai <tiwai@suse.de>

Documentation,ALSA Core
- cards_limit=1 as default instead of 8.
- cards_limit means the number of auto-loaded cards.  not limits the
  actual card numbers for manual loading (e.g. hotplug).
parent d1b7ae60
......@@ -55,9 +55,10 @@ Module parameters
major - major # for sound driver
- default is 116
cards_limit
- specifies card limit # (1-8)
- good for kmod support if you do not want to search
for soundcards which are not installed in your system
- specifies card limit # for auto-loading (1-8)
- default is 1
- for auto-loading more than 1 card, specify this option
together with snd-card-X aliases.
device_mode
- specifies permission mask for dynamic sound device filesystem
(available only when DEVFS is enabled)
......
......@@ -36,7 +36,7 @@
static int major = CONFIG_SND_MAJOR;
int snd_major;
static int cards_limit = SNDRV_CARDS;
static int cards_limit = 1;
#ifdef CONFIG_DEVFS_FS
static int device_mode = S_IFCHR | S_IRUGO | S_IWUGO;
#endif
......@@ -50,7 +50,7 @@ MODULE_PARM(major, "i");
MODULE_PARM_DESC(major, "Major # for sound driver.");
MODULE_PARM_SYNTAX(major, "default:116,skill:devel");
MODULE_PARM(cards_limit, "i");
MODULE_PARM_DESC(cards_limit, "Count of soundcards installed in the system.");
MODULE_PARM_DESC(cards_limit, "Count of auto-loadable soundcards.");
MODULE_PARM_SYNTAX(cards_limit, "default:8,skill:advanced");
#ifdef CONFIG_DEVFS_FS
MODULE_PARM(device_mode, "i");
......@@ -58,6 +58,10 @@ MODULE_PARM_DESC(device_mode, "Device file permission mask for devfs.");
MODULE_PARM_SYNTAX(device_mode, "default:0666,base:8");
#endif
/* this one holds the actual max. card number currently available.
* as default, it's identical with cards_limit option. when more
* modules are loaded manually, this limit number increases, too.
*/
int snd_ecards_limit;
static struct list_head snd_minors_hash[SNDRV_CARDS];
......@@ -224,7 +228,7 @@ int snd_register_device(int type, snd_card_t * card, int dev, snd_minor_t * reg,
}
list_add_tail(&preg->list, &snd_minors_hash[SNDRV_MINOR_CARD(minor)]);
#ifdef CONFIG_DEVFS_FS
if (strncmp(name, "controlC", 8)) /* created in sound.c */
if (strncmp(name, "controlC", 8) || card->number >= cards_limit)
devfs_mk_cdev(MKDEV(major, minor), S_IFCHR | device_mode, "snd/%s", name);
#endif
up(&sound_mutex);
......@@ -257,6 +261,8 @@ int snd_unregister_device(int type, snd_card_t * card, int dev)
#ifdef CONFIG_DEVFS_FS
if (strncmp(mptr->name, "controlC", 8)) /* created in sound.c */
devfs_remove("snd/%s", mptr->name);
else if (card->number >= cards_limit)
devfs_remove("snd/%s", mptr->name); /* manualy created */
#endif
list_del(&mptr->list);
up(&sound_mutex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment