#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/slab.h>
+#include <linux/moduleparam.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/ac97_codec.h>
#include <sound/mpu401.h>
#include <sound/opl3.h>
-#define SNDRV_GET_ID
#include <sound/initval.h>
#include <asm/io.h>
* High 16-bits are video (radio) device number + 1
*/
static int tea575x_tuner[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = 0 };
+static int boot_devs;
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
MODULE_PARM_DESC(index, "Index value for the FM801 soundcard.");
MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
MODULE_PARM_DESC(id, "ID string for the FM801 soundcard.");
MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
MODULE_PARM_DESC(enable, "Enable FM801 soundcard.");
MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(tea575x_tuner, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(tea575x_tuner, bool, boot_devs, 0444);
MODULE_PARM_DESC(tea575x_tuner, "Enable TEA575x tuner.");
MODULE_PARM_SYNTAX(tea575x_tuner, SNDRV_ENABLE_DESC);
static int __init alsa_card_fm801_init(void)
{
- int err;
-
- if ((err = pci_module_init(&driver)) < 0) {
-#ifdef MODULE
- printk(KERN_ERR "ForteMedia FM801 soundcard not found or device busy\n");
-#endif
- return err;
- }
- return 0;
+ return pci_module_init(&driver);
}
static void __exit alsa_card_fm801_exit(void)
module_init(alsa_card_fm801_init)
module_exit(alsa_card_fm801_exit)
-
-#ifndef MODULE
-
-/* format is: snd-fm801=enable,index,id,tea575x_tuner */
-
-static int __init alsa_card_fm801_setup(char *str)
-{
- static unsigned __initdata nr_dev = 0;
-
- if (nr_dev >= SNDRV_CARDS)
- return 0;
- (void)(get_option(&str,&enable[nr_dev]) == 2 &&
- get_option(&str,&index[nr_dev]) == 2 &&
- get_id(&str,&id[nr_dev]) == 2 &&
- get_option(&str,&tea575x_tuner[nr_dev]));
- nr_dev++;
- return 1;
-}
-
-__setup("snd-fm801=", alsa_card_fm801_setup);
-
-#endif /* ifndef MODULE */