Commit 45e72f21 authored by Jaroslav Kysela's avatar Jaroslav Kysela

ALSA update

  - changed names for module symbols: snd_xxxx ==> xxxx (removed prefix)
parent 8d6ff919
......@@ -200,9 +200,9 @@ typedef struct _snd_minor snd_minor_t;
/* sound.c */
extern int snd_ecards_limit;
extern int snd_device_mode;
extern int snd_device_gid;
extern int snd_device_uid;
extern int device_mode;
extern int device_gid;
extern int device_uid;
void snd_request_card(int card);
......
......@@ -46,10 +46,10 @@ MODULE_DESCRIPTION("SA1100/SA1111 + UDA1341TS driver for ALSA");
MODULE_CLASSES("{sound}");
MODULE_DEVICES("{{UDA1341,iPAQ H3600 UDA1341TS}}");
static char *snd_id = NULL; /* ID for this card */
static char *id = NULL; /* ID for this card */
MODULE_PARM(snd_id, "s");
MODULE_PARM_DESC(snd_id, "ID string for SA1100/SA1111 + UDA1341TS soundcard.");
MODULE_PARM(id, "s");
MODULE_PARM_DESC(id, "ID string for SA1100/SA1111 + UDA1341TS soundcard.");
#define chip_t sa11xx_uda1341_t
......@@ -884,7 +884,7 @@ static int __init sa11xx_uda1341_init(void)
return -ENODEV;
/* register the soundcard */
card = snd_card_new(-1, snd_id, THIS_MODULE, 0);
card = snd_card_new(-1, id, THIS_MODULE, 0);
if (card == NULL)
return -ENOMEM;
sa11xx_uda1341 = snd_magic_kcalloc(sa11xx_uda1341_t, 0, GFP_KERNEL);
......
......@@ -76,7 +76,7 @@ int snd_info_check_reserved_words(const char *str)
#ifdef CONFIG_PROC_FS
extern int snd_major;
extern int major;
extern struct file_operations snd_fops;
static DECLARE_MUTEX(info_mutex);
......@@ -885,8 +885,8 @@ static void snd_info_device_fill_inode(struct inode *inode, int fill)
entry = (snd_info_entry_t *) de->data;
if (entry == NULL)
return;
inode->i_gid = snd_device_gid;
inode->i_uid = snd_device_uid;
inode->i_gid = device_gid;
inode->i_uid = device_uid;
inode->i_rdev = MKDEV(entry->c.device.major, entry->c.device.minor);
}
......@@ -907,16 +907,16 @@ snd_info_entry_t *snd_info_create_device(const char *name, unsigned int number,
#ifdef CONFIG_DEVFS_FS
char dname[32];
#endif
unsigned short major = number >> 16;
unsigned short _major = number >> 16;
unsigned short minor = (unsigned short) number;
snd_info_entry_t *entry;
struct proc_dir_entry *p = NULL;
if (!major)
major = snd_major;
if (!_major)
_major = major;
if (!mode)
mode = S_IFCHR | S_IRUGO | S_IWUGO;
mode &= (snd_device_mode & (S_IRUGO | S_IWUGO)) | S_IFCHR | S_IFBLK;
mode &= (device_mode & (S_IRUGO | S_IWUGO)) | S_IFCHR | S_IFBLK;
entry = snd_info_create_module_entry(THIS_MODULE, name, NULL);
if (entry == NULL)
return NULL;
......@@ -940,8 +940,8 @@ snd_info_entry_t *snd_info_create_device(const char *name, unsigned int number,
snd_info_free_entry(entry);
return NULL;
}
p->gid = snd_device_gid;
p->uid = snd_device_uid;
p->gid = device_gid;
p->uid = device_uid;
p->data = (void *) entry;
entry->p = p;
up(&info_mutex);
......
......@@ -37,22 +37,22 @@
#include <linux/soundcard.h>
#include <sound/initval.h>
static int snd_dsp_map[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 0};
static int snd_adsp_map[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 1};
static int snd_nonblock_open;
static int dsp_map[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 0};
static int adsp_map[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 1};
static int nonblock_open;
MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>, Abramo Bagnara <abramo@alsa-project.org>");
MODULE_DESCRIPTION("PCM OSS emulation for ALSA.");
MODULE_LICENSE("GPL");
MODULE_PARM(snd_dsp_map, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_dsp_map, "PCM device number assigned to 1st OSS device.");
MODULE_PARM_SYNTAX(snd_dsp_map, "default:0,skill:advanced");
MODULE_PARM(snd_adsp_map, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_adsp_map, "PCM device number assigned to 2nd OSS device.");
MODULE_PARM_SYNTAX(snd_adsp_map, "default:1,skill:advanced");
MODULE_PARM(snd_nonblock_open, "i");
MODULE_PARM_DESC(snd_nonblock_open, "Don't block opening busy PCM devices.");
MODULE_PARM_SYNTAX(snd_nonblock_open, "default:0,skill:advanced");
MODULE_PARM(dsp_map, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(dsp_map, "PCM device number assigned to 1st OSS device.");
MODULE_PARM_SYNTAX(dsp_map, "default:0,skill:advanced");
MODULE_PARM(adsp_map, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(adsp_map, "PCM device number assigned to 2nd OSS device.");
MODULE_PARM_SYNTAX(adsp_map, "default:1,skill:advanced");
MODULE_PARM(nonblock_open, "i");
MODULE_PARM_DESC(nonblock_open, "Don't block opening busy PCM devices.");
MODULE_PARM_SYNTAX(nonblock_open, "default:0,skill:advanced");
extern int snd_mixer_oss_ioctl_card(snd_card_t *card, unsigned int cmd, unsigned long arg);
static int snd_pcm_oss_get_rate(snd_pcm_oss_file_t *pcm_oss_file);
......@@ -1536,7 +1536,7 @@ static int snd_pcm_oss_open(struct inode *inode, struct file *file)
snd_assert(cardnum >= 0 && cardnum < SNDRV_CARDS, return -ENXIO);
device = SNDRV_MINOR_OSS_DEVICE(minor) == SNDRV_MINOR_OSS_PCM1 ?
snd_adsp_map[cardnum] : snd_dsp_map[cardnum];
adsp_map[cardnum] : dsp_map[cardnum];
#ifdef LINUX_2_2
MOD_INC_USE_COUNT;
......@@ -1572,7 +1572,7 @@ static int snd_pcm_oss_open(struct inode *inode, struct file *file)
nonblock = 0;
}
if (!nonblock)
nonblock = snd_nonblock_open;
nonblock = nonblock_open;
init_waitqueue_entry(&wait, current);
add_wait_queue(&pcm->open_wait, &wait);
......@@ -2115,7 +2115,7 @@ static int snd_pcm_oss_register_minor(unsigned short native_minor,
snd_pcm_t * pcm)
{
pcm->oss.reg = 0;
if (snd_dsp_map[pcm->card->number] == pcm->device) {
if (dsp_map[pcm->card->number] == pcm->device) {
char name[128];
int duplex;
register_oss_dsp(native_minor, pcm, 0);
......@@ -2130,7 +2130,7 @@ static int snd_pcm_oss_register_minor(unsigned short native_minor,
#endif
pcm->oss.reg++;
}
if (snd_adsp_map[pcm->card->number] == pcm->device) {
if (adsp_map[pcm->card->number] == pcm->device) {
register_oss_dsp(native_minor, pcm, 1);
pcm->oss.reg++;
}
......@@ -2145,14 +2145,14 @@ static int snd_pcm_oss_unregister_minor(unsigned short native_minor,
snd_pcm_t * pcm)
{
if (pcm->oss.reg) {
if (snd_dsp_map[pcm->card->number] == pcm->device) {
if (dsp_map[pcm->card->number] == pcm->device) {
snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_PCM,
pcm->card, 0);
#ifdef SNDRV_OSS_INFO_DEV_AUDIO
snd_oss_info_unregister(SNDRV_OSS_INFO_DEV_AUDIO, pcm->card->number);
#endif
}
if (snd_adsp_map[pcm->card->number] == pcm->device)
if (adsp_map[pcm->card->number] == pcm->device)
snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_PCM,
pcm->card, 1);
pcm->oss.reg = 0;
......@@ -2176,13 +2176,13 @@ static int __init alsa_pcm_oss_init(void)
return err;
/* check device map table */
for (i = 0; i < SNDRV_CARDS; i++) {
if (snd_dsp_map[i] < 0 || snd_dsp_map[i] >= SNDRV_PCM_DEVICES) {
snd_printk("invalid dsp_map[%d] = %d\n", i, snd_dsp_map[i]);
snd_dsp_map[i] = 0;
if (dsp_map[i] < 0 || dsp_map[i] >= SNDRV_PCM_DEVICES) {
snd_printk("invalid dsp_map[%d] = %d\n", i, dsp_map[i]);
dsp_map[i] = 0;
}
if (snd_adsp_map[i] < 0 || snd_adsp_map[i] >= SNDRV_PCM_DEVICES) {
snd_printk("invalid adsp_map[%d] = %d\n", i, snd_adsp_map[i]);
snd_adsp_map[i] = 1;
if (adsp_map[i] < 0 || adsp_map[i] >= SNDRV_PCM_DEVICES) {
snd_printk("invalid adsp_map[%d] = %d\n", i, adsp_map[i]);
adsp_map[i] = 1;
}
}
return 0;
......
......@@ -27,15 +27,15 @@
#include <sound/info.h>
#include <sound/initval.h>
static int snd_preallocate_dma = 1;
MODULE_PARM(snd_preallocate_dma, "i");
MODULE_PARM_DESC(snd_preallocate_dma, "Preallocate DMA memory when the PCM devices are initialized.");
MODULE_PARM_SYNTAX(snd_preallocate_dma, SNDRV_BOOLEAN_TRUE_DESC);
static int preallocate_dma = 1;
MODULE_PARM(preallocate_dma, "i");
MODULE_PARM_DESC(preallocate_dma, "Preallocate DMA memory when the PCM devices are initialized.");
MODULE_PARM_SYNTAX(preallocate_dma, SNDRV_BOOLEAN_TRUE_DESC);
static int snd_maximum_substreams = 4;
MODULE_PARM(snd_maximum_substreams, "i");
MODULE_PARM_DESC(snd_maximum_substreams, "Maximum substreams with preallocated DMA memory.");
MODULE_PARM_SYNTAX(snd_maximum_substreams, SNDRV_BOOLEAN_TRUE_DESC);
static int maximum_substreams = 4;
MODULE_PARM(maximum_substreams, "i");
MODULE_PARM_DESC(maximum_substreams, "Maximum substreams with preallocated DMA memory.");
MODULE_PARM_SYNTAX(maximum_substreams, SNDRV_BOOLEAN_TRUE_DESC);
static int snd_minimum_buffer = 16384;
......@@ -168,7 +168,7 @@ static int snd_pcm_lib_preallocate_pages1(snd_pcm_substream_t *substream,
dma_addr_t dma_addr = 0UL;
snd_info_entry_t *entry;
if (!size || !snd_preallocate_dma || substream->number >= snd_maximum_substreams) {
if (!size || !preallocate_dma || substream->number >= maximum_substreams) {
size = 0;
} else {
switch (substream->dma_type) {
......
......@@ -38,14 +38,14 @@ MODULE_DESCRIPTION("Midlevel RawMidi code for ALSA.");
MODULE_LICENSE("GPL");
#ifdef CONFIG_SND_OSSEMUL
static int snd_midi_map[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 0};
static int snd_amidi_map[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 1};
MODULE_PARM(snd_midi_map, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_midi_map, "Raw MIDI device number assigned to 1st OSS device.");
MODULE_PARM_SYNTAX(snd_midi_map, "default:0,skill:advanced");
MODULE_PARM(snd_amidi_map, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_amidi_map, "Raw MIDI device number assigned to 2nd OSS device.");
MODULE_PARM_SYNTAX(snd_amidi_map, "default:1,skill:advanced");
static int midi_map[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 0};
static int amidi_map[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 1};
MODULE_PARM(midi_map, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(midi_map, "Raw MIDI device number assigned to 1st OSS device.");
MODULE_PARM_SYNTAX(midi_map, "default:0,skill:advanced");
MODULE_PARM(amidi_map, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(amidi_map, "Raw MIDI device number assigned to 2nd OSS device.");
MODULE_PARM_SYNTAX(amidi_map, "default:1,skill:advanced");
#endif /* CONFIG_SND_OSSEMUL */
static int snd_rawmidi_free(snd_rawmidi_t *rawmidi);
......@@ -379,7 +379,7 @@ static int snd_rawmidi_open(struct inode *inode, struct file *file)
cardnum = SNDRV_MINOR_OSS_CARD(minor(inode->i_rdev));
cardnum %= SNDRV_CARDS;
device = SNDRV_MINOR_OSS_DEVICE(minor(inode->i_rdev)) == SNDRV_MINOR_OSS_MIDI ?
snd_midi_map[cardnum] : snd_amidi_map[cardnum];
midi_map[cardnum] : amidi_map[cardnum];
break;
#endif
default:
......@@ -1419,7 +1419,7 @@ static int snd_rawmidi_dev_register(snd_device_t *device)
}
#ifdef CONFIG_SND_OSSEMUL
rmidi->ossreg = 0;
if (rmidi->device == snd_midi_map[rmidi->card->number]) {
if (rmidi->device == midi_map[rmidi->card->number]) {
if (snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_MIDI,
rmidi->card, 0, &snd_rawmidi_reg, name) < 0) {
snd_printk(KERN_ERR "unable to register OSS rawmidi device %i:%i\n", rmidi->card->number, 0);
......@@ -1430,7 +1430,7 @@ static int snd_rawmidi_dev_register(snd_device_t *device)
#endif
}
}
if (rmidi->device == snd_amidi_map[rmidi->card->number]) {
if (rmidi->device == amidi_map[rmidi->card->number]) {
if (snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_MIDI,
rmidi->card, 1, &snd_rawmidi_reg, name) < 0) {
snd_printk(KERN_ERR "unable to register OSS rawmidi device %i:%i\n", rmidi->card->number, 1);
......@@ -1484,13 +1484,13 @@ static int snd_rawmidi_dev_unregister(snd_device_t *device)
}
#ifdef CONFIG_SND_OSSEMUL
if (rmidi->ossreg) {
if (rmidi->device == snd_midi_map[rmidi->card->number]) {
if (rmidi->device == midi_map[rmidi->card->number]) {
snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_MIDI, rmidi->card, 0);
#ifdef SNDRV_OSS_INFO_DEV_MIDI
snd_oss_info_unregister(SNDRV_OSS_INFO_DEV_MIDI, rmidi->card->number);
#endif
}
if (rmidi->device == snd_amidi_map[rmidi->card->number])
if (rmidi->device == amidi_map[rmidi->card->number])
snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_MIDI, rmidi->card, 1);
rmidi->ossreg = 0;
}
......@@ -1532,13 +1532,13 @@ static int __init alsa_rawmidi_init(void)
#ifdef CONFIG_SND_OSSEMUL
/* check device map table */
for (i = 0; i < SNDRV_CARDS; i++) {
if (snd_midi_map[i] < 0 || snd_midi_map[i] >= SNDRV_RAWMIDI_DEVICES) {
snd_printk(KERN_ERR "invalid midi_map[%d] = %d\n", i, snd_midi_map[i]);
snd_midi_map[i] = 0;
if (midi_map[i] < 0 || midi_map[i] >= SNDRV_RAWMIDI_DEVICES) {
snd_printk(KERN_ERR "invalid midi_map[%d] = %d\n", i, midi_map[i]);
midi_map[i] = 0;
}
if (snd_amidi_map[i] < 0 || snd_amidi_map[i] >= SNDRV_RAWMIDI_DEVICES) {
snd_printk(KERN_ERR "invalid amidi_map[%d] = %d\n", i, snd_amidi_map[i]);
snd_amidi_map[i] = 1;
if (amidi_map[i] < 0 || amidi_map[i] >= SNDRV_RAWMIDI_DEVICES) {
snd_printk(KERN_ERR "invalid amidi_map[%d] = %d\n", i, amidi_map[i]);
amidi_map[i] = 1;
}
}
#endif /* CONFIG_SND_OSSEMUL */
......
......@@ -34,13 +34,13 @@
#include "seq_info.h"
#include <sound/seq_device.h>
int snd_seq_client_load[64] = {[0 ... 63] = -1};
int snd_seq_default_timer_class = SNDRV_TIMER_CLASS_GLOBAL;
int snd_seq_default_timer_sclass = SNDRV_TIMER_SCLASS_NONE;
int snd_seq_default_timer_card = -1;
int snd_seq_default_timer_device = SNDRV_TIMER_GLOBAL_SYSTEM;
int snd_seq_default_timer_subdevice = 0;
int snd_seq_default_timer_resolution = 0; /* Hz */
int seq_client_load[64] = {[0 ... 63] = -1};
int seq_default_timer_class = SNDRV_TIMER_CLASS_GLOBAL;
int seq_default_timer_sclass = SNDRV_TIMER_SCLASS_NONE;
int seq_default_timer_card = -1;
int seq_default_timer_device = SNDRV_TIMER_GLOBAL_SYSTEM;
int seq_default_timer_subdevice = 0;
int seq_default_timer_resolution = 0; /* Hz */
MODULE_AUTHOR("Frank van de Pol <fvdpol@home.nl>, Jaroslav Kysela <perex@suse.cz>");
MODULE_DESCRIPTION("Advanced Linux Sound Architecture sequencer.");
......@@ -48,20 +48,20 @@ MODULE_LICENSE("GPL");
MODULE_CLASSES("{sound}");
MODULE_SUPPORTED_DEVICE("sound");
MODULE_PARM(snd_seq_client_load, "1-64i");
MODULE_PARM_DESC(snd_seq_client_load, "The numbers of global (system) clients to load through kmod.");
MODULE_PARM(snd_seq_default_timer_class, "i");
MODULE_PARM_DESC(snd_seq_default_timer_class, "The default timer class.");
MODULE_PARM(snd_seq_default_timer_sclass, "i");
MODULE_PARM_DESC(snd_seq_default_timer_sclass, "The default timer slave class.");
MODULE_PARM(snd_seq_default_timer_card, "i");
MODULE_PARM_DESC(snd_seq_default_timer_card, "The default timer card number.");
MODULE_PARM(snd_seq_default_timer_device, "i");
MODULE_PARM_DESC(snd_seq_default_timer_device, "The default timer device number.");
MODULE_PARM(snd_seq_default_timer_subdevice, "i");
MODULE_PARM_DESC(snd_seq_default_timer_subdevice, "The default timer subdevice number.");
MODULE_PARM(snd_seq_default_timer_resolution, "i");
MODULE_PARM_DESC(snd_seq_default_timer_resolution, "The default timer resolution in Hz.");
MODULE_PARM(seq_client_load, "1-64i");
MODULE_PARM_DESC(seq_client_load, "The numbers of global (system) clients to load through kmod.");
MODULE_PARM(seq_default_timer_class, "i");
MODULE_PARM_DESC(seq_default_timer_class, "The default timer class.");
MODULE_PARM(seq_default_timer_sclass, "i");
MODULE_PARM_DESC(seq_default_timer_sclass, "The default timer slave class.");
MODULE_PARM(seq_default_timer_card, "i");
MODULE_PARM_DESC(seq_default_timer_card, "The default timer card number.");
MODULE_PARM(seq_default_timer_device, "i");
MODULE_PARM_DESC(seq_default_timer_device, "The default timer device number.");
MODULE_PARM(seq_default_timer_subdevice, "i");
MODULE_PARM_DESC(seq_default_timer_subdevice, "The default timer subdevice number.");
MODULE_PARM(seq_default_timer_resolution, "i");
MODULE_PARM_DESC(seq_default_timer_resolution, "The default timer resolution in Hz.");
/*
* INIT PART
......
......@@ -110,7 +110,7 @@ static client_t *clientptr(int clientid)
return clienttab[clientid];
}
extern int snd_seq_client_load[];
extern int seq_client_load[];
client_t *snd_seq_client_use_ptr(int clientid)
{
......@@ -141,9 +141,9 @@ client_t *snd_seq_client_use_ptr(int clientid)
if (! client_requested[clientid]) {
client_requested[clientid] = 1;
for (idx = 0; idx < 64; idx++) {
if (snd_seq_client_load[idx] < 0)
if (seq_client_load[idx] < 0)
break;
if (snd_seq_client_load[idx] == clientid) {
if (seq_client_load[idx] == clientid) {
sprintf(name, "snd-seq-client-%i", clientid);
request_module(name);
break;
......
......@@ -27,12 +27,12 @@
#include "seq_queue.h"
#include "seq_info.h"
extern int snd_seq_default_timer_class;
extern int snd_seq_default_timer_sclass;
extern int snd_seq_default_timer_card;
extern int snd_seq_default_timer_device;
extern int snd_seq_default_timer_subdevice;
extern int snd_seq_default_timer_resolution;
extern int seq_default_timer_class;
extern int seq_default_timer_sclass;
extern int seq_default_timer_card;
extern int seq_default_timer_device;
extern int seq_default_timer_subdevice;
extern int seq_default_timer_resolution;
#define SKEW_BASE 0x10000 /* 16bit shift */
......@@ -103,12 +103,12 @@ void snd_seq_timer_defaults(seq_timer_t * tmr)
tmr->running = 0;
tmr->type = SNDRV_SEQ_TIMER_ALSA;
tmr->alsa_id.dev_class = snd_seq_default_timer_class;
tmr->alsa_id.dev_sclass = snd_seq_default_timer_sclass;
tmr->alsa_id.card = snd_seq_default_timer_card;
tmr->alsa_id.device = snd_seq_default_timer_device;
tmr->alsa_id.subdevice = snd_seq_default_timer_subdevice;
tmr->preferred_resolution = snd_seq_default_timer_resolution;
tmr->alsa_id.dev_class = seq_default_timer_class;
tmr->alsa_id.dev_sclass = seq_default_timer_sclass;
tmr->alsa_id.card = seq_default_timer_card;
tmr->alsa_id.device = seq_default_timer_device;
tmr->alsa_id.subdevice = seq_default_timer_subdevice;
tmr->preferred_resolution = seq_default_timer_resolution;
tmr->skew = tmr->skew_base = SKEW_BASE;
}
......
......@@ -36,32 +36,32 @@
#define SNDRV_OS_MINORS 256
int snd_major = CONFIG_SND_MAJOR;
static int snd_cards_limit = SNDRV_CARDS;
int snd_device_mode = S_IFCHR | S_IRUGO | S_IWUGO;
int snd_device_gid = 0;
int snd_device_uid = 0;
int major = CONFIG_SND_MAJOR;
static int cards_limit = SNDRV_CARDS;
int device_mode = S_IFCHR | S_IRUGO | S_IWUGO;
int device_gid = 0;
int device_uid = 0;
MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
MODULE_DESCRIPTION("Advanced Linux Sound Architecture driver for soundcards.");
MODULE_LICENSE("GPL");
MODULE_CLASSES("{sound}");
MODULE_SUPPORTED_DEVICE("sound");
MODULE_PARM(snd_major, "i");
MODULE_PARM_DESC(snd_major, "Major # for sound driver.");
MODULE_PARM_SYNTAX(snd_major, "default:116,skill:devel");
MODULE_PARM(snd_cards_limit, "i");
MODULE_PARM_DESC(snd_cards_limit, "Count of soundcards installed in the system.");
MODULE_PARM_SYNTAX(snd_cards_limit, "default:8,skill:advanced");
MODULE_PARM(snd_device_mode, "i");
MODULE_PARM_DESC(snd_device_mode, "Device file permission mask for sound dynamic device filesystem.");
MODULE_PARM_SYNTAX(snd_device_mode, "default:0666,base:8");
MODULE_PARM(snd_device_gid, "i");
MODULE_PARM_DESC(snd_device_gid, "Device file GID for sound dynamic device filesystem.");
MODULE_PARM_SYNTAX(snd_device_gid, "default:0");
MODULE_PARM(snd_device_uid, "i");
MODULE_PARM_DESC(snd_device_uid, "Device file UID for sound dynamic device filesystem.");
MODULE_PARM_SYNTAX(snd_device_uid, "default:0");
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_SYNTAX(cards_limit, "default:8,skill:advanced");
MODULE_PARM(device_mode, "i");
MODULE_PARM_DESC(device_mode, "Device file permission mask for sound dynamic device filesystem.");
MODULE_PARM_SYNTAX(device_mode, "default:0666,base:8");
MODULE_PARM(device_gid, "i");
MODULE_PARM_DESC(device_gid, "Device file GID for sound dynamic device filesystem.");
MODULE_PARM_SYNTAX(device_gid, "default:0");
MODULE_PARM(device_uid, "i");
MODULE_PARM_DESC(device_uid, "Device file UID for sound dynamic device filesystem.");
MODULE_PARM_SYNTAX(device_uid, "default:0");
int snd_ecards_limit;
......@@ -302,7 +302,7 @@ static int __init alsa_sound_init(void)
#endif
int card;
snd_ecards_limit = snd_cards_limit;
snd_ecards_limit = cards_limit;
for (card = 0; card < SNDRV_CARDS; card++)
INIT_LIST_HEAD(&snd_minors_hash[card]);
#ifdef CONFIG_SND_OSSEMUL
......@@ -316,8 +316,8 @@ static int __init alsa_sound_init(void)
devfs_handle = devfs_mk_dir(NULL, "snd", NULL);
#endif
#endif
if (register_chrdev(snd_major, "alsa", &snd_fops)) {
snd_printk(KERN_ERR "unable to register native major device number %d\n", snd_major);
if (register_chrdev(major, "alsa", &snd_fops)) {
snd_printk(KERN_ERR "unable to register native major device number %d\n", major);
return -EIO;
}
#ifdef CONFIG_SND_DEBUG_MEMORY
......@@ -333,10 +333,10 @@ static int __init alsa_sound_init(void)
snd_info_minor_register();
#endif
#ifdef CONFIG_DEVFS_FS
for (controlnum = 0; controlnum < snd_cards_limit; controlnum++) {
for (controlnum = 0; controlnum < cards_limit; controlnum++) {
sprintf(controlname, "snd/controlC%d", controlnum);
devfs_register(NULL, controlname, DEVFS_FL_DEFAULT,
snd_major, controlnum<<5, snd_device_mode | S_IFCHR,
major, controlnum<<5, device_mode | S_IFCHR,
&snd_fops, NULL);
}
#endif
......@@ -355,7 +355,7 @@ static void __exit alsa_sound_exit(void)
char controlname[24];
short controlnum;
for (controlnum = 0; controlnum < snd_cards_limit; controlnum++) {
for (controlnum = 0; controlnum < cards_limit; controlnum++) {
sprintf(controlname, "snd/controlC%d", controlnum);
devfs_find_and_unregister(NULL, controlname, 0, 0, DEVFS_SPECIAL_CHR, 0);
}
......@@ -371,8 +371,8 @@ static void __exit alsa_sound_exit(void)
#ifdef CONFIG_SND_DEBUG_MEMORY
snd_memory_done();
#endif
if (unregister_chrdev(snd_major, "alsa") != 0)
snd_printk(KERN_ERR "unable to unregister major device number %d\n", snd_major);
if (unregister_chrdev(major, "alsa") != 0)
snd_printk(KERN_ERR "unable to unregister major device number %d\n", major);
#ifdef CONFIG_DEVFS_FS
devfs_unregister(devfs_handle);
#endif
......
......@@ -41,13 +41,13 @@
#define DEFAULT_TIMER_LIMIT 2
#endif
int snd_timer_limit = DEFAULT_TIMER_LIMIT;
int timer_limit = DEFAULT_TIMER_LIMIT;
MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>, Takashi Iwai <tiwai@suse.de>");
MODULE_DESCRIPTION("ALSA timer interface");
MODULE_LICENSE("GPL");
MODULE_CLASSES("{sound}");
MODULE_PARM(snd_timer_limit, "i");
MODULE_PARM_DESC(snd_timer_limit, "Maximum global timers in system.");
MODULE_PARM(timer_limit, "i");
MODULE_PARM_DESC(timer_limit, "Maximum global timers in system.");
typedef struct {
snd_timer_instance_t *timeri;
......@@ -152,7 +152,7 @@ static void snd_timer_request(snd_timer_id_t *tid)
switch (tid->dev_class) {
case SNDRV_TIMER_CLASS_GLOBAL:
if (tid->device >= snd_timer_limit)
if (tid->device >= timer_limit)
return;
sprintf(str, "snd-timer-%i", tid->device);
break;
......
......@@ -84,31 +84,31 @@ MODULE_DEVICES("{{ALSA,Dummy soundcard}}");
#define USE_PERIODS_MAX 1024
#endif
static int snd_index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *snd_id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int snd_enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0};
static int snd_pcm_devs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
static int snd_pcm_substreams[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 8};
//static int snd_midi_devs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};
MODULE_PARM(snd_index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_index, "Index value for dummy soundcard.");
MODULE_PARM_SYNTAX(snd_index, SNDRV_INDEX_DESC);
MODULE_PARM(snd_id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
MODULE_PARM_DESC(snd_id, "ID string for dummy soundcard.");
MODULE_PARM_SYNTAX(snd_id, SNDRV_ID_DESC);
MODULE_PARM(snd_enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_enable, "Enable this dummy soundcard.");
MODULE_PARM_SYNTAX(snd_enable, SNDRV_ENABLE_DESC);
MODULE_PARM(snd_pcm_devs, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_pcm_devs, "PCM devices # (0-4) for dummy driver.");
MODULE_PARM_SYNTAX(snd_pcm_devs, SNDRV_ENABLED ",allows:{{0,4}},default:1,dialog:list");
MODULE_PARM(snd_pcm_substreams, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_pcm_substreams, "PCM substreams # (1-16) for dummy driver.");
MODULE_PARM_SYNTAX(snd_pcm_substreams, SNDRV_ENABLED ",allows:{{1,16}},default:8,dialog:list");
//MODULE_PARM(snd_midi_devs, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
//MODULE_PARM_DESC(snd_midi_devs, "MIDI devices # (0-2) for dummy driver.");
//MODULE_PARM_SYNTAX(snd_midi_devs, SNDRV_ENABLED ",allows:{{0,2}},default:8,dialog:list");
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0};
static int pcm_devs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
static int pcm_substreams[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 8};
//static int midi_devs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};
MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(index, "Index value for dummy soundcard.");
MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
MODULE_PARM_DESC(id, "ID string for dummy soundcard.");
MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(enable, "Enable this dummy soundcard.");
MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
MODULE_PARM(pcm_devs, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(pcm_devs, "PCM devices # (0-4) for dummy driver.");
MODULE_PARM_SYNTAX(pcm_devs, SNDRV_ENABLED ",allows:{{0,4}},default:1,dialog:list");
MODULE_PARM(pcm_substreams, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(pcm_substreams, "PCM substreams # (1-16) for dummy driver.");
MODULE_PARM_SYNTAX(pcm_substreams, SNDRV_ENABLED ",allows:{{1,16}},default:8,dialog:list");
//MODULE_PARM(midi_devs, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
//MODULE_PARM_DESC(midi_devs, "MIDI devices # (0-2) for dummy driver.");
//MODULE_PARM_SYNTAX(midi_devs, SNDRV_ENABLED ",allows:{{0,2}},default:8,dialog:list");
#define MIXER_ADDR_MASTER 0
#define MIXER_ADDR_LINE 1
......@@ -537,20 +537,20 @@ static int __init snd_card_dummy_probe(int dev)
struct snd_card_dummy *dummy;
int idx, err;
if (!snd_enable[dev])
if (!enable[dev])
return -ENODEV;
card = snd_card_new(snd_index[dev], snd_id[dev], THIS_MODULE,
card = snd_card_new(index[dev], id[dev], THIS_MODULE,
sizeof(struct snd_card_dummy));
if (card == NULL)
return -ENOMEM;
dummy = (struct snd_card_dummy *)card->private_data;
dummy->card = card;
for (idx = 0; idx < MAX_PCM_DEVICES && idx < snd_pcm_devs[dev]; idx++) {
if (snd_pcm_substreams[dev] < 1)
snd_pcm_substreams[dev] = 1;
if (snd_pcm_substreams[dev] > MAX_PCM_SUBSTREAMS)
snd_pcm_substreams[dev] = MAX_PCM_SUBSTREAMS;
if ((err = snd_card_dummy_pcm(dummy, idx, snd_pcm_substreams[dev])) < 0)
for (idx = 0; idx < MAX_PCM_DEVICES && idx < pcm_devs[dev]; idx++) {
if (pcm_substreams[dev] < 1)
pcm_substreams[dev] = 1;
if (pcm_substreams[dev] > MAX_PCM_SUBSTREAMS)
pcm_substreams[dev] = MAX_PCM_SUBSTREAMS;
if ((err = snd_card_dummy_pcm(dummy, idx, pcm_substreams[dev])) < 0)
goto __nodev;
}
if ((err = snd_card_dummy_new_mixer(dummy)) < 0)
......@@ -571,7 +571,7 @@ static int __init alsa_card_dummy_init(void)
{
int dev, cards;
for (dev = cards = 0; dev < SNDRV_CARDS && snd_enable[dev]; dev++) {
for (dev = cards = 0; dev < SNDRV_CARDS && enable[dev]; dev++) {
if (snd_card_dummy_probe(dev) < 0) {
#ifdef MODULE
printk(KERN_ERR "Dummy soundcard #%i not found or device busy\n", dev + 1);
......@@ -602,8 +602,8 @@ module_exit(alsa_card_dummy_exit)
#ifndef MODULE
/* format is: snd-dummy=snd_enable,snd_index,snd_id,
snd_pcm_devs,snd_pcm_substreams */
/* format is: snd-dummy=enable,index,id,
pcm_devs,pcm_substreams */
static int __init alsa_card_dummy_setup(char *str)
{
......@@ -611,11 +611,11 @@ static int __init alsa_card_dummy_setup(char *str)
if (nr_dev >= SNDRV_CARDS)
return 0;
(void)(get_option(&str,&snd_enable[nr_dev]) == 2 &&
get_option(&str,&snd_index[nr_dev]) == 2 &&
get_id(&str,&snd_id[nr_dev]) == 2 &&
get_option(&str,&snd_pcm_devs[nr_dev]) == 2 &&
get_option(&str,&snd_pcm_substreams[nr_dev]) == 2);
(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,&pcm_devs[nr_dev]) == 2 &&
get_option(&str,&pcm_substreams[nr_dev]) == 2);
nr_dev++;
return 1;
}
......
......@@ -35,27 +35,27 @@ MODULE_DESCRIPTION("MPU-401 UART");
MODULE_LICENSE("GPL");
MODULE_CLASSES("{sound}");
static int snd_index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *snd_id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int snd_enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
static long snd_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* MPU-401 port number */
static int snd_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* MPU-401 IRQ */
MODULE_PARM(snd_index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_index, "Index value for MPU-401 device.");
MODULE_PARM_SYNTAX(snd_index, SNDRV_INDEX_DESC);
MODULE_PARM(snd_id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
MODULE_PARM_DESC(snd_id, "ID string for MPU-401 device.");
MODULE_PARM_SYNTAX(snd_id, SNDRV_ID_DESC);
MODULE_PARM(snd_enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_enable, "Enable MPU-401 device.");
MODULE_PARM_SYNTAX(snd_enable, SNDRV_ENABLE_DESC);
MODULE_PARM(snd_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
MODULE_PARM_DESC(snd_port, "Port # for MPU-401 device.");
MODULE_PARM_SYNTAX(snd_port, SNDRV_PORT12_DESC);
MODULE_PARM(snd_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_irq, "IRQ # for MPU-401 device.");
MODULE_PARM_SYNTAX(snd_irq, SNDRV_IRQ_DESC);
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* MPU-401 port number */
static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* MPU-401 IRQ */
MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(index, "Index value for MPU-401 device.");
MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
MODULE_PARM_DESC(id, "ID string for MPU-401 device.");
MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(enable, "Enable MPU-401 device.");
MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
MODULE_PARM(port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
MODULE_PARM_DESC(port, "Port # for MPU-401 device.");
MODULE_PARM_SYNTAX(port, SNDRV_PORT12_DESC);
MODULE_PARM(irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(irq, "IRQ # for MPU-401 device.");
MODULE_PARM_SYNTAX(irq, SNDRV_IRQ_DESC);
static snd_card_t *snd_mpu401_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;
......@@ -64,30 +64,30 @@ static int __init snd_card_mpu401_probe(int dev)
snd_card_t *card;
int err;
if (snd_port[dev] == SNDRV_AUTO_PORT) {
snd_printk("specify snd_port\n");
if (port[dev] == SNDRV_AUTO_PORT) {
snd_printk("specify port\n");
return -EINVAL;
}
if (snd_irq[dev] == SNDRV_AUTO_IRQ) {
if (irq[dev] == SNDRV_AUTO_IRQ) {
snd_printk("specify or disable IRQ port\n");
return -EINVAL;
}
card = snd_card_new(snd_index[dev], snd_id[dev], THIS_MODULE, 0);
card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
if (card == NULL)
return -ENOMEM;
if (snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401,
snd_port[dev], 0,
snd_irq[dev], snd_irq[dev] >= 0 ? SA_INTERRUPT : 0, NULL) < 0) {
printk(KERN_ERR "MPU401 not detected at 0x%lx\n", snd_port[dev]);
port[dev], 0,
irq[dev], irq[dev] >= 0 ? SA_INTERRUPT : 0, NULL) < 0) {
printk(KERN_ERR "MPU401 not detected at 0x%lx\n", port[dev]);
snd_card_free(card);
return -ENODEV;
}
strcpy(card->driver, "MPU-401 UART");
strcpy(card->shortname, card->driver);
sprintf(card->longname, "%s at 0x%lx, ", card->shortname, snd_port[dev]);
if (snd_irq[dev] >= 0) {
sprintf(card->longname + strlen(card->longname), "IRQ %d", snd_irq[dev]);
sprintf(card->longname, "%s at 0x%lx, ", card->shortname, port[dev]);
if (irq[dev] >= 0) {
sprintf(card->longname + strlen(card->longname), "IRQ %d", irq[dev]);
} else {
strcat(card->longname, "polled");
}
......@@ -104,7 +104,7 @@ static int __init alsa_card_mpu401_init(void)
int dev, cards = 0;
for (dev = 0; dev < SNDRV_CARDS; dev++) {
if (!snd_enable[dev])
if (!enable[dev])
continue;
if (snd_card_mpu401_probe(dev) >= 0)
cards++;
......@@ -131,7 +131,7 @@ module_exit(alsa_card_mpu401_exit)
#ifndef MODULE
/* format is: snd-mpu401=snd_enable,snd_index,snd_id,snd_port,snd_irq */
/* format is: snd-mpu401=enable,index,id,port,irq */
static int __init alsa_card_mpu401_setup(char *str)
{
......@@ -139,11 +139,11 @@ static int __init alsa_card_mpu401_setup(char *str)
if (nr_dev >= SNDRV_CARDS)
return 0;
(void)(get_option(&str,&snd_enable[nr_dev]) == 2 &&
get_option(&str,&snd_index[nr_dev]) == 2 &&
get_id(&str,&snd_id[nr_dev]) == 2 &&
get_option(&str,(int *)&snd_port[nr_dev]) == 2 &&
get_option(&str,&snd_irq[nr_dev]) == 2);
(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,(int *)&port[nr_dev]) == 2 &&
get_option(&str,&irq[nr_dev]) == 2);
nr_dev++;
return 1;
}
......
......@@ -44,7 +44,7 @@
* Jun 11 2001 Takashi Iwai <tiwai@suse.de>
* - Recoded & debugged
* - Added timer interrupt for midi outputs
* - snd_hwports is between 1 and 8, which specifies the number of hardware ports.
* - hwports is between 1 and 8, which specifies the number of hardware ports.
* The three global ports, computer, adat and broadcast ports, are created
* always after h/w and remote ports.
*
......@@ -75,27 +75,27 @@ MODULE_DEVICES("{{MOTU,MidiTimePiece AV multiport MIDI}}");
#define MTPAV_IRQ 7
#define MTPAV_MAX_PORTS 8
static int snd_index = SNDRV_DEFAULT_IDX1;
static char *snd_id = SNDRV_DEFAULT_STR1;
static long snd_port = MTPAV_IOBASE; /* 0x378, 0x278 */
static int snd_irq = MTPAV_IRQ; /* 7, 5 */
static int snd_hwports = MTPAV_MAX_PORTS; /* use hardware ports 1-8 */
MODULE_PARM(snd_index, "i");
MODULE_PARM_DESC(snd_index, "Index value for MotuMTPAV MIDI.");
MODULE_PARM_SYNTAX(snd_index, SNDRV_INDEX_DESC);
MODULE_PARM(snd_id, "s");
MODULE_PARM_DESC(snd_id, "ID string for MotuMTPAV MIDI.");
MODULE_PARM_SYNTAX(snd_id, SNDRV_ID_DESC);
MODULE_PARM(snd_port, "l");
MODULE_PARM_DESC(snd_port, "Parallel port # for MotuMTPAV MIDI.");
MODULE_PARM_SYNTAX(snd_port, SNDRV_ENABLED ",allows:{{0x378},{0x278}},dialog:list");
MODULE_PARM(snd_irq, "i");
MODULE_PARM_DESC(snd_irq, "Parallel IRQ # for MotuMTPAV MIDI.");
MODULE_PARM_SYNTAX(snd_irq, SNDRV_ENABLED ",allows:{{7},{5}},dialog:list");
MODULE_PARM(snd_hwports, "i");
MODULE_PARM_DESC(snd_hwports, "Hardware ports # for MotuMTPAV MIDI.");
MODULE_PARM_SYNTAX(snd_hwports, SNDRV_ENABLED ",allows:{{1,8}},dialog:list");
static int index = SNDRV_DEFAULT_IDX1;
static char *id = SNDRV_DEFAULT_STR1;
static long port = MTPAV_IOBASE; /* 0x378, 0x278 */
static int irq = MTPAV_IRQ; /* 7, 5 */
static int hwports = MTPAV_MAX_PORTS; /* use hardware ports 1-8 */
MODULE_PARM(index, "i");
MODULE_PARM_DESC(index, "Index value for MotuMTPAV MIDI.");
MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
MODULE_PARM(id, "s");
MODULE_PARM_DESC(id, "ID string for MotuMTPAV MIDI.");
MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
MODULE_PARM(port, "l");
MODULE_PARM_DESC(port, "Parallel port # for MotuMTPAV MIDI.");
MODULE_PARM_SYNTAX(port, SNDRV_ENABLED ",allows:{{0x378},{0x278}},dialog:list");
MODULE_PARM(irq, "i");
MODULE_PARM_DESC(irq, "Parallel IRQ # for MotuMTPAV MIDI.");
MODULE_PARM_SYNTAX(irq, SNDRV_ENABLED ",allows:{{7},{5}},dialog:list");
MODULE_PARM(hwports, "i");
MODULE_PARM_DESC(hwports, "Hardware ports # for MotuMTPAV MIDI.");
MODULE_PARM_SYNTAX(hwports, SNDRV_ENABLED ",allows:{{1,8}},dialog:list");
/*
* defines
......@@ -588,16 +588,16 @@ static void snd_mtpav_irqh(int irq, void *dev_id, struct pt_regs *regs)
*/
static int snd_mtpav_get_ISA(mtpav_t * mcard)
{
if ((mcard->res_port = request_region(snd_port, 3, "MotuMTPAV MIDI")) == NULL) {
snd_printk("MTVAP port 0x%lx is busy\n", snd_port);
if ((mcard->res_port = request_region(port, 3, "MotuMTPAV MIDI")) == NULL) {
snd_printk("MTVAP port 0x%lx is busy\n", port);
return -EBUSY;
}
mcard->port = snd_port;
if (request_irq(snd_irq, snd_mtpav_irqh, SA_INTERRUPT, "MOTU MTPAV", (void *)mcard)) {
snd_printk("MTVAP IRQ %d busy\n", snd_irq);
mcard->port = port;
if (request_irq(irq, snd_mtpav_irqh, SA_INTERRUPT, "MOTU MTPAV", (void *)mcard)) {
snd_printk("MTVAP IRQ %d busy\n", irq);
return -EBUSY;
}
mcard->irq = snd_irq;
mcard->irq = irq;
return 0;
}
......@@ -645,12 +645,12 @@ static int snd_mtpav_get_RAWMIDI(mtpav_t * mcard)
//printk("entering snd_mtpav_get_RAWMIDI\n");
if (snd_hwports < 1)
if (hwports < 1)
mcard->num_ports = 1;
else if (snd_hwports > 8)
else if (hwports > 8)
mcard->num_ports = 8;
else
mcard->num_ports = snd_hwports;
mcard->num_ports = hwports;
if ((rval = snd_rawmidi_new(mcard->card, "MotuMIDI", 0,
mcard->num_ports * 2 + MTPAV_PIDX_BROADCAST + 1,
......@@ -730,7 +730,7 @@ static int __init alsa_card_mtpav_init(void)
if (mtp_card == NULL)
return -ENOMEM;
mtp_card->card = snd_card_new(snd_index, snd_id, THIS_MODULE, 0);
mtp_card->card = snd_card_new(index, id, THIS_MODULE, 0);
if (mtp_card->card == NULL) {
free_mtpav(mtp_card);
return -ENOMEM;
......@@ -760,7 +760,7 @@ static int __init alsa_card_mtpav_init(void)
snd_mtpav_portscan(mtp_card);
printk(KERN_INFO "Motu MidiTimePiece on parallel port irq: %d ioport: 0x%lx\n", snd_irq, snd_port);
printk(KERN_INFO "Motu MidiTimePiece on parallel port irq: %d ioport: 0x%lx\n", irq, port);
return 0;
......@@ -790,19 +790,19 @@ module_exit(alsa_card_mtpav_exit)
#ifndef MODULE
/* format is: snd-mtpav=snd_enable,snd_index,snd_id,
snd_port,snd_irq,snd_hwports */
/* format is: snd-mtpav=snd_enable,index,id,
port,irq,hwports */
static int __init alsa_card_mtpav_setup(char *str)
{
int __attribute__ ((__unused__)) enable = 1;
(void)(get_option(&str,&enable) == 2 &&
get_option(&str,&snd_index) == 2 &&
get_id(&str,&snd_id) == 2 &&
get_option(&str,(int *)&snd_port) == 2 &&
get_option(&str,&snd_irq) == 2 &&
get_option(&str,&snd_hwports) == 2);
get_option(&str,&index) == 2 &&
get_id(&str,&id) == 2 &&
get_option(&str,(int *)&port) == 2 &&
get_option(&str,&irq) == 2 &&
get_option(&str,&hwports) == 2);
return 1;
}
......
......@@ -61,48 +61,48 @@ static char *adaptor_names[] = {
"Generic"
};
static int snd_index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *snd_id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int snd_enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
static long snd_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x3f8,0x2f8,0x3e8,0x2e8 */
static int snd_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 3,4,5,7,9,10,11,14,15 */
static int snd_speed[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 38400}; /* 9600,19200,38400,57600,115200 */
static int snd_base[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 115200}; /* baud base */
static int snd_outs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; /* 1 to 16 */
static int snd_ins[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; /* 1 to 16 */
static int snd_adaptor[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = SNDRV_SERIAL_SOUNDCANVAS};
MODULE_PARM(snd_index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_index, "Index value for Serial MIDI.");
MODULE_PARM_SYNTAX(snd_index, SNDRV_INDEX_DESC);
MODULE_PARM(snd_id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
MODULE_PARM_DESC(snd_id, "ID string for Serial MIDI.");
MODULE_PARM_SYNTAX(snd_id, SNDRV_ID_DESC);
MODULE_PARM(snd_enable, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
MODULE_PARM_DESC(snd_enable, "Enable UART16550A chip.");
MODULE_PARM_SYNTAX(snd_enable, SNDRV_ENABLE_DESC);
MODULE_PARM(snd_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
MODULE_PARM_DESC(snd_port, "Port # for UART16550A chip.");
MODULE_PARM_SYNTAX(snd_port, SNDRV_PORT12_DESC);
MODULE_PARM(snd_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_irq, "IRQ # for UART16550A chip.");
MODULE_PARM_SYNTAX(snd_irq, SNDRV_IRQ_DESC);
MODULE_PARM(snd_speed, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_speed, "Speed in bauds.");
MODULE_PARM_SYNTAX(snd_speed, SNDRV_ENABLED ",allows:{9600,19200,38400,57600,115200},dialog:list");
MODULE_PARM(snd_base, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_base, "Base for divisor in bauds.");
MODULE_PARM_SYNTAX(snd_base, SNDRV_ENABLED ",allows:{57600,115200,230400,460800},dialog:list");
MODULE_PARM(snd_outs, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_outs, "Number of MIDI outputs.");
MODULE_PARM(snd_ins, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_ins, "Number of MIDI inputs.");
MODULE_PARM_SYNTAX(snd_outs, SNDRV_ENABLED ",allows:{{1,16}},dialog:list");
MODULE_PARM_SYNTAX(snd_ins, SNDRV_ENABLED ",allows:{{1,16}},dialog:list");
MODULE_PARM(snd_adaptor, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_adaptor, "Type of adaptor.");
MODULE_PARM_SYNTAX(snd_adaptor, SNDRV_ENABLED ",allows:{{0=Soundcanvas,1=MS-124T,2=MS-124W S/A,3=MS-124W M/B,4=Generic}},dialog:list");
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x3f8,0x2f8,0x3e8,0x2e8 */
static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 3,4,5,7,9,10,11,14,15 */
static int speed[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 38400}; /* 9600,19200,38400,57600,115200 */
static int base[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 115200}; /* baud base */
static int outs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; /* 1 to 16 */
static int ins[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; /* 1 to 16 */
static int adaptor[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = SNDRV_SERIAL_SOUNDCANVAS};
MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(index, "Index value for Serial MIDI.");
MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
MODULE_PARM_DESC(id, "ID string for Serial MIDI.");
MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
MODULE_PARM_DESC(enable, "Enable UART16550A chip.");
MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
MODULE_PARM(port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
MODULE_PARM_DESC(port, "Port # for UART16550A chip.");
MODULE_PARM_SYNTAX(port, SNDRV_PORT12_DESC);
MODULE_PARM(irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(irq, "IRQ # for UART16550A chip.");
MODULE_PARM_SYNTAX(irq, SNDRV_IRQ_DESC);
MODULE_PARM(speed, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(speed, "Speed in bauds.");
MODULE_PARM_SYNTAX(speed, SNDRV_ENABLED ",allows:{9600,19200,38400,57600,115200},dialog:list");
MODULE_PARM(base, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(base, "Base for divisor in bauds.");
MODULE_PARM_SYNTAX(base, SNDRV_ENABLED ",allows:{57600,115200,230400,460800},dialog:list");
MODULE_PARM(outs, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(outs, "Number of MIDI outputs.");
MODULE_PARM(ins, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(ins, "Number of MIDI inputs.");
MODULE_PARM_SYNTAX(outs, SNDRV_ENABLED ",allows:{{1,16}},dialog:list");
MODULE_PARM_SYNTAX(ins, SNDRV_ENABLED ",allows:{{1,16}},dialog:list");
MODULE_PARM(adaptor, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(adaptor, "Type of adaptor.");
MODULE_PARM_SYNTAX(adaptor, SNDRV_ENABLED ",allows:{{0=Soundcanvas,1=MS-124T,2=MS-124W S/A,3=MS-124W M/B,4=Generic}},dialog:list");
/*#define SNDRV_SERIAL_MS124W_MB_NOCOMBO 1*/ /* Address outs as 0-3 instead of bitmap */
......@@ -842,67 +842,67 @@ static int __init snd_serial_probe(int dev)
snd_uart16550_t *uart;
int err;
if (!snd_enable[dev])
if (!enable[dev])
return -ENOENT;
switch (snd_adaptor[dev]) {
switch (adaptor[dev]) {
case SNDRV_SERIAL_SOUNDCANVAS:
snd_ins[dev] = 1;
ins[dev] = 1;
break;
case SNDRV_SERIAL_MS124T:
case SNDRV_SERIAL_MS124W_SA:
snd_outs[dev] = 1;
snd_ins[dev] = 1;
outs[dev] = 1;
ins[dev] = 1;
break;
case SNDRV_SERIAL_MS124W_MB:
snd_outs[dev] = 16;
snd_ins[dev] = 1;
outs[dev] = 16;
ins[dev] = 1;
break;
case SNDRV_SERIAL_GENERIC:
break;
default:
snd_printk("Adaptor type is out of range 0-%d (%d)\n",
SNDRV_SERIAL_MAX_ADAPTOR, snd_adaptor[dev]);
SNDRV_SERIAL_MAX_ADAPTOR, adaptor[dev]);
return -ENODEV;
}
if (snd_outs[dev] < 1 || snd_outs[dev] > SNDRV_SERIAL_MAX_OUTS) {
if (outs[dev] < 1 || outs[dev] > SNDRV_SERIAL_MAX_OUTS) {
snd_printk("Count of outputs is out of range 1-%d (%d)\n",
SNDRV_SERIAL_MAX_OUTS, snd_outs[dev]);
SNDRV_SERIAL_MAX_OUTS, outs[dev]);
return -ENODEV;
}
if (snd_ins[dev] < 1 || snd_ins[dev] > SNDRV_SERIAL_MAX_INS) {
if (ins[dev] < 1 || ins[dev] > SNDRV_SERIAL_MAX_INS) {
snd_printk("Count of inputs is out of range 1-%d (%d)\n",
SNDRV_SERIAL_MAX_INS, snd_ins[dev]);
SNDRV_SERIAL_MAX_INS, ins[dev]);
return -ENODEV;
}
card = snd_card_new(snd_index[dev], snd_id[dev], THIS_MODULE, 0);
card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
if (card == NULL)
return -ENOMEM;
strcpy(card->driver, "Serial");
strcpy(card->shortname, "Serial midi (uart16550A)");
if ((err = snd_uart16550_detect(snd_port[dev])) <= 0) {
if ((err = snd_uart16550_detect(port[dev])) <= 0) {
snd_card_free(card);
printk(KERN_ERR "no UART detected at 0x%lx\n", (long)snd_port[dev]);
printk(KERN_ERR "no UART detected at 0x%lx\n", (long)port[dev]);
return err;
}
if ((err = snd_uart16550_create(card,
snd_port[dev],
snd_irq[dev],
snd_speed[dev],
snd_base[dev],
snd_adaptor[dev],
port[dev],
irq[dev],
speed[dev],
base[dev],
adaptor[dev],
&uart)) < 0) {
snd_card_free(card);
return err;
}
if ((err = snd_uart16550_rmidi(uart, 0, snd_outs[dev], snd_ins[dev], &uart->rmidi)) < 0) {
if ((err = snd_uart16550_rmidi(uart, 0, outs[dev], ins[dev], &uart->rmidi)) < 0) {
snd_card_free(card);
return err;
}
......@@ -913,8 +913,8 @@ static int __init snd_serial_probe(int dev)
uart->irq,
uart->speed,
(int)uart->divisor,
snd_outs[dev],
snd_ins[dev],
outs[dev],
ins[dev],
adaptor_names[uart->adaptor]);
if ((err = snd_card_register(card)) < 0) {
......@@ -959,9 +959,9 @@ module_exit(alsa_card_serial_exit)
#ifndef MODULE
/* format is: snd-serial=snd_enable,snd_index,snd_id,
snd_port,snd_irq,snd_speed,snd_base,snd_outs,
snd_ins,snd_adaptor */
/* format is: snd-serial=enable,index,id,
port,irq,speed,base,outs,
ins,adaptor */
static int __init alsa_card_serial_setup(char *str)
{
......@@ -969,16 +969,16 @@ static int __init alsa_card_serial_setup(char *str)
if (nr_dev >= SNDRV_CARDS)
return 0;
(void)(get_option(&str,&snd_enable[nr_dev]) == 2 &&
get_option(&str,&snd_index[nr_dev]) == 2 &&
get_id(&str,&snd_id[nr_dev]) == 2 &&
get_option(&str,(int *)&snd_port[nr_dev]) == 2 &&
get_option(&str,&snd_irq[nr_dev]) == 2 &&
get_option(&str,&snd_speed[nr_dev]) == 2 &&
get_option(&str,&snd_base[nr_dev]) == 2 &&
get_option(&str,&snd_outs[nr_dev]) == 2 &&
get_option(&str,&snd_ins[nr_dev]) == 2 &&
get_option(&str,&snd_adaptor[nr_dev]) == 2);
(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,(int *)&port[nr_dev]) == 2 &&
get_option(&str,&irq[nr_dev]) == 2 &&
get_option(&str,&speed[nr_dev]) == 2 &&
get_option(&str,&base[nr_dev]) == 2 &&
get_option(&str,&outs[nr_dev]) == 2 &&
get_option(&str,&ins[nr_dev]) == 2 &&
get_option(&str,&adaptor[nr_dev]) == 2);
nr_dev++;
return 1;
}
......
......@@ -30,7 +30,7 @@
*
* Typical usage is like following:
* - Load snd-virmidi module.
* # modprobe snd-virmidi snd_index=2
* # modprobe snd-virmidi index=2
* Then, sequencer clients 72:0 to 75:0 will be created, which are
* mapped from /dev/snd/midiC1D0 to /dev/snd/midiC1D3, respectively.
*
......@@ -59,23 +59,23 @@ MODULE_DEVICES("{{ALSA,Virtual rawmidi device}}");
#define MAX_MIDI_DEVICES 8
static int snd_index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *snd_id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int snd_enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0};
static int snd_midi_devs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 4};
MODULE_PARM(snd_index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_index, "Index value for virmidi soundcard.");
MODULE_PARM_SYNTAX(snd_index, SNDRV_INDEX_DESC);
MODULE_PARM(snd_id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
MODULE_PARM_DESC(snd_id, "ID string for virmidi soundcard.");
MODULE_PARM_SYNTAX(snd_id, SNDRV_ID_DESC);
MODULE_PARM(snd_enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_enable, "Enable this soundcard.");
MODULE_PARM_SYNTAX(snd_enable, SNDRV_ENABLE_DESC);
MODULE_PARM(snd_midi_devs, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_midi_devs, "MIDI devices # (1-8)");
MODULE_PARM_SYNTAX(snd_midi_devs, SNDRV_ENABLED ",allows:{{1,8}}");
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0};
static int midi_devs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 4};
MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(index, "Index value for virmidi soundcard.");
MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
MODULE_PARM_DESC(id, "ID string for virmidi soundcard.");
MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(enable, "Enable this soundcard.");
MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
MODULE_PARM(midi_devs, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(midi_devs, "MIDI devices # (1-8)");
MODULE_PARM_SYNTAX(midi_devs, SNDRV_ENABLED ",allows:{{1,8}}");
typedef struct snd_card_virmidi {
snd_card_t *card;
......@@ -91,20 +91,20 @@ static int __init snd_card_virmidi_probe(int dev)
struct snd_card_virmidi *vmidi;
int idx, err;
if (!snd_enable[dev])
if (!enable[dev])
return -ENODEV;
card = snd_card_new(snd_index[dev], snd_id[dev], THIS_MODULE,
card = snd_card_new(index[dev], id[dev], THIS_MODULE,
sizeof(struct snd_card_virmidi));
if (card == NULL)
return -ENOMEM;
vmidi = (struct snd_card_virmidi *)card->private_data;
vmidi->card = card;
if (snd_midi_devs[dev] > MAX_MIDI_DEVICES) {
if (midi_devs[dev] > MAX_MIDI_DEVICES) {
snd_printk("too much midi devices for virmidi %d: force to use %d\n", dev, MAX_MIDI_DEVICES);
snd_midi_devs[dev] = MAX_MIDI_DEVICES;
midi_devs[dev] = MAX_MIDI_DEVICES;
}
for (idx = 0; idx < snd_midi_devs[dev]; idx++) {
for (idx = 0; idx < midi_devs[dev]; idx++) {
snd_rawmidi_t *rmidi;
snd_virmidi_dev_t *rdev;
if ((err = snd_virmidi_new(card, idx, &rmidi)) < 0)
......@@ -131,7 +131,7 @@ static int __init alsa_card_virmidi_init(void)
{
int dev, cards;
for (dev = cards = 0; dev < SNDRV_CARDS && snd_enable[dev]; dev++) {
for (dev = cards = 0; dev < SNDRV_CARDS && enable[dev]; dev++) {
if (snd_card_virmidi_probe(dev) < 0) {
#ifdef MODULE
printk(KERN_ERR "Card-VirMIDI #%i not found or device busy\n", dev + 1);
......@@ -162,7 +162,7 @@ module_exit(alsa_card_virmidi_exit)
#ifndef MODULE
/* format is: snd-virmidi=snd_enable,snd_index,snd_id,snd_midi_devs */
/* format is: snd-virmidi=enable,index,id,midi_devs */
static int __init alsa_card_virmidi_setup(char *str)
{
......@@ -170,10 +170,10 @@ static int __init alsa_card_virmidi_setup(char *str)
if (nr_dev >= SNDRV_CARDS)
return 0;
(void)(get_option(&str,&snd_enable[nr_dev]) == 2 &&
get_option(&str,&snd_index[nr_dev]) == 2 &&
get_id(&str,&snd_id[nr_dev]) == 2 &&
get_option(&str,&snd_midi_devs[nr_dev]) == 2);
(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,&midi_devs[nr_dev]) == 2);
nr_dev++;
return 1;
}
......
This diff is collapsed.
......@@ -40,31 +40,31 @@ MODULE_DEVICES("{{Analog Devices,AD1848},"
"{Analog Devices,AD1847},"
"{Crystal Semiconductors,CS4248}}");
static int snd_index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *snd_id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int snd_enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
static long snd_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
static int snd_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,11,12,15 */
static int snd_dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */
MODULE_PARM(snd_index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_index, "Index value for AD1848 soundcard.");
MODULE_PARM_SYNTAX(snd_index, SNDRV_INDEX_DESC);
MODULE_PARM(snd_id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
MODULE_PARM_DESC(snd_id, "ID string for AD1848 soundcard.");
MODULE_PARM_SYNTAX(snd_id, SNDRV_ID_DESC);
MODULE_PARM(snd_enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_enable, "Enable AD1848 soundcard.");
MODULE_PARM_SYNTAX(snd_enable, SNDRV_ENABLE_DESC);
MODULE_PARM(snd_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
MODULE_PARM_DESC(snd_port, "Port # for AD1848 driver.");
MODULE_PARM_SYNTAX(snd_port, SNDRV_PORT12_DESC);
MODULE_PARM(snd_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_irq, "IRQ # for AD1848 driver.");
MODULE_PARM_SYNTAX(snd_irq, SNDRV_IRQ_DESC);
MODULE_PARM(snd_dma1, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_dma1, "DMA1 # for AD1848 driver.");
MODULE_PARM_SYNTAX(snd_dma1, SNDRV_DMA_DESC);
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,11,12,15 */
static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */
MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(index, "Index value for AD1848 soundcard.");
MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
MODULE_PARM_DESC(id, "ID string for AD1848 soundcard.");
MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(enable, "Enable AD1848 soundcard.");
MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
MODULE_PARM(port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
MODULE_PARM_DESC(port, "Port # for AD1848 driver.");
MODULE_PARM_SYNTAX(port, SNDRV_PORT12_DESC);
MODULE_PARM(irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(irq, "IRQ # for AD1848 driver.");
MODULE_PARM_SYNTAX(irq, SNDRV_IRQ_DESC);
MODULE_PARM(dma1, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(dma1, "DMA1 # for AD1848 driver.");
MODULE_PARM_SYNTAX(dma1, SNDRV_DMA_DESC);
static snd_card_t *snd_ad1848_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;
......@@ -76,26 +76,26 @@ static int __init snd_card_ad1848_probe(int dev)
snd_pcm_t *pcm;
int err;
if (snd_port[dev] == SNDRV_AUTO_PORT) {
snd_printk("specify snd_port\n");
if (port[dev] == SNDRV_AUTO_PORT) {
snd_printk("specify port\n");
return -EINVAL;
}
if (snd_irq[dev] == SNDRV_AUTO_IRQ) {
snd_printk("specify snd_irq\n");
if (irq[dev] == SNDRV_AUTO_IRQ) {
snd_printk("specify irq\n");
return -EINVAL;
}
if (snd_dma1[dev] == SNDRV_AUTO_DMA) {
snd_printk("specify snd_dma1\n");
if (dma1[dev] == SNDRV_AUTO_DMA) {
snd_printk("specify dma1\n");
return -EINVAL;
}
card = snd_card_new(snd_index[dev], snd_id[dev], THIS_MODULE, 0);
card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
if (card == NULL)
return -ENOMEM;
if ((err = snd_ad1848_create(card, snd_port[dev],
snd_irq[dev],
snd_dma1[dev],
if ((err = snd_ad1848_create(card, port[dev],
irq[dev],
dma1[dev],
AD1848_HW_DETECT,
&chip)) < 0) {
snd_card_free(card);
......@@ -114,7 +114,7 @@ static int __init snd_card_ad1848_probe(int dev)
strcpy(card->shortname, pcm->name);
sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d",
pcm->name, chip->port, snd_irq[dev], snd_dma1[dev]);
pcm->name, chip->port, irq[dev], dma1[dev]);
if ((err = snd_card_register(card)) < 0) {
snd_card_free(card);
......@@ -128,7 +128,7 @@ static int __init alsa_card_ad1848_init(void)
{
int dev, cards;
for (dev = cards = 0; dev < SNDRV_CARDS && snd_enable[dev]; dev++)
for (dev = cards = 0; dev < SNDRV_CARDS && enable[dev]; dev++)
if (snd_card_ad1848_probe(dev) >= 0)
cards++;
......@@ -154,8 +154,8 @@ module_exit(alsa_card_ad1848_exit)
#ifndef MODULE
/* format is: snd-ad1848=snd_enable,snd_index,snd_id,snd_port,
snd_irq,snd_dma1 */
/* format is: snd-ad1848=enable,index,id,port,
irq,dma1 */
static int __init alsa_card_ad1848_setup(char *str)
{
......@@ -163,12 +163,12 @@ static int __init alsa_card_ad1848_setup(char *str)
if (nr_dev >= SNDRV_CARDS)
return 0;
(void)(get_option(&str,&snd_enable[nr_dev]) == 2 &&
get_option(&str,&snd_index[nr_dev]) == 2 &&
get_id(&str,&snd_id[nr_dev]) == 2 &&
get_option(&str,(int *)&snd_port[nr_dev]) == 2 &&
get_option(&str,&snd_irq[nr_dev]) == 2 &&
get_option(&str,&snd_dma1[nr_dev]) == 2);
(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,(int *)&port[nr_dev]) == 2 &&
get_option(&str,&irq[nr_dev]) == 2 &&
get_option(&str,&dma1[nr_dev]) == 2);
nr_dev++;
return 1;
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -38,43 +38,43 @@ MODULE_LICENSE("GPL");
MODULE_CLASSES("{sound}");
MODULE_DEVICES("{{Crystal Semiconductors,CS4231}}");
static int snd_index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *snd_id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int snd_enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
static long snd_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
static long snd_mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
static int snd_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,11,12,15 */
static int snd_mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 9,11,12,15 */
static int snd_dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */
static int snd_dma2[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */
MODULE_PARM(snd_index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_index, "Index value for CS4231 soundcard.");
MODULE_PARM_SYNTAX(snd_index, SNDRV_INDEX_DESC);
MODULE_PARM(snd_id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
MODULE_PARM_DESC(snd_id, "ID string for CS4231 soundcard.");
MODULE_PARM_SYNTAX(snd_id, SNDRV_ID_DESC);
MODULE_PARM(snd_enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_enable, "Enable CS4231 soundcard.");
MODULE_PARM_SYNTAX(snd_enable, SNDRV_ENABLE_DESC);
MODULE_PARM(snd_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
MODULE_PARM_DESC(snd_port, "Port # for CS4231 driver.");
MODULE_PARM_SYNTAX(snd_port, SNDRV_PORT12_DESC);
MODULE_PARM(snd_mpu_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
MODULE_PARM_DESC(snd_mpu_port, "MPU-401 port # for CS4231 driver.");
MODULE_PARM_SYNTAX(snd_mpu_port, SNDRV_PORT12_DESC);
MODULE_PARM(snd_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_irq, "IRQ # for CS4231 driver.");
MODULE_PARM_SYNTAX(snd_irq, SNDRV_IRQ_DESC);
MODULE_PARM(snd_mpu_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_mpu_irq, "MPU-401 IRQ # for CS4231 driver.");
MODULE_PARM_SYNTAX(snd_mpu_irq, SNDRV_IRQ_DESC);
MODULE_PARM(snd_dma1, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_dma1, "DMA1 # for CS4231 driver.");
MODULE_PARM_SYNTAX(snd_dma1, SNDRV_DMA_DESC);
MODULE_PARM(snd_dma2, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_dma2, "DMA2 # for CS4231 driver.");
MODULE_PARM_SYNTAX(snd_dma2, SNDRV_DMA_DESC);
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,11,12,15 */
static int mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 9,11,12,15 */
static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */
static int dma2[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */
MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(index, "Index value for CS4231 soundcard.");
MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
MODULE_PARM_DESC(id, "ID string for CS4231 soundcard.");
MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(enable, "Enable CS4231 soundcard.");
MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
MODULE_PARM(port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
MODULE_PARM_DESC(port, "Port # for CS4231 driver.");
MODULE_PARM_SYNTAX(port, SNDRV_PORT12_DESC);
MODULE_PARM(mpu_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
MODULE_PARM_DESC(mpu_port, "MPU-401 port # for CS4231 driver.");
MODULE_PARM_SYNTAX(mpu_port, SNDRV_PORT12_DESC);
MODULE_PARM(irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(irq, "IRQ # for CS4231 driver.");
MODULE_PARM_SYNTAX(irq, SNDRV_IRQ_DESC);
MODULE_PARM(mpu_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for CS4231 driver.");
MODULE_PARM_SYNTAX(mpu_irq, SNDRV_IRQ_DESC);
MODULE_PARM(dma1, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(dma1, "DMA1 # for CS4231 driver.");
MODULE_PARM_SYNTAX(dma1, SNDRV_DMA_DESC);
MODULE_PARM(dma2, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(dma2, "DMA2 # for CS4231 driver.");
MODULE_PARM_SYNTAX(dma2, SNDRV_DMA_DESC);
static snd_card_t *snd_cs4231_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;
......@@ -87,28 +87,28 @@ static int __init snd_card_cs4231_probe(int dev)
cs4231_t *chip;
int err;
if (snd_port[dev] == SNDRV_AUTO_PORT) {
snd_printk("specify snd_port\n");
if (port[dev] == SNDRV_AUTO_PORT) {
snd_printk("specify port\n");
return -EINVAL;
}
if (snd_irq[dev] == SNDRV_AUTO_IRQ) {
snd_printk("specify snd_irq\n");
if (irq[dev] == SNDRV_AUTO_IRQ) {
snd_printk("specify irq\n");
return -EINVAL;
}
if (snd_dma1[dev] == SNDRV_AUTO_DMA) {
snd_printk("specify snd_dma1\n");
if (dma1[dev] == SNDRV_AUTO_DMA) {
snd_printk("specify dma1\n");
return -EINVAL;
}
card = snd_card_new(snd_index[dev], snd_id[dev], THIS_MODULE, 0);
card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
if (card == NULL)
return -ENOMEM;
acard = (struct snd_card_cs4231 *)card->private_data;
if (snd_mpu_port[dev] < 0)
snd_mpu_port[dev] = SNDRV_AUTO_PORT;
if ((err = snd_cs4231_create(card, snd_port[dev], -1,
snd_irq[dev],
snd_dma1[dev],
snd_dma2[dev],
if (mpu_port[dev] < 0)
mpu_port[dev] = SNDRV_AUTO_PORT;
if ((err = snd_cs4231_create(card, port[dev], -1,
irq[dev],
dma1[dev],
dma2[dev],
CS4231_HW_DETECT,
0, &chip)) < 0) {
snd_card_free(card);
......@@ -128,19 +128,19 @@ static int __init snd_card_cs4231_probe(int dev)
return err;
}
if (snd_mpu_irq[dev] >= 0 && snd_mpu_irq[dev] != SNDRV_AUTO_IRQ) {
if (mpu_irq[dev] >= 0 && mpu_irq[dev] != SNDRV_AUTO_IRQ) {
if (snd_mpu401_uart_new(card, 0, MPU401_HW_CS4232,
snd_mpu_port[dev], 0,
snd_mpu_irq[dev], SA_INTERRUPT,
mpu_port[dev], 0,
mpu_irq[dev], SA_INTERRUPT,
NULL) < 0)
printk(KERN_ERR "cs4231: MPU401 not detected\n");
}
strcpy(card->driver, "CS4231");
strcpy(card->shortname, pcm->name);
sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d",
pcm->name, chip->port, snd_irq[dev], snd_dma1[dev]);
if (snd_dma2[dev] >= 0)
sprintf(card->longname + strlen(card->longname), "&%d", snd_dma2[dev]);
pcm->name, chip->port, irq[dev], dma1[dev]);
if (dma2[dev] >= 0)
sprintf(card->longname + strlen(card->longname), "&%d", dma2[dev]);
if ((err = snd_card_register(card)) < 0) {
snd_card_free(card);
return err;
......@@ -153,7 +153,7 @@ static int __init alsa_card_cs4231_init(void)
{
int dev, cards;
for (dev = cards = 0; dev < SNDRV_CARDS && snd_enable[dev]; dev++) {
for (dev = cards = 0; dev < SNDRV_CARDS && enable[dev]; dev++) {
if (snd_card_cs4231_probe(dev) >= 0)
cards++;
}
......@@ -179,9 +179,9 @@ module_exit(alsa_card_cs4231_exit)
#ifndef MODULE
/* format is: snd-cs4231=snd_enable,snd_index,snd_id,
snd_port,snd_mpu_port,snd_irq,snd_mpu_irq,
snd_dma1,snd_dma2 */
/* format is: snd-cs4231=enable,index,id,
port,mpu_port,irq,mpu_irq,
dma1,dma2 */
static int __init alsa_card_cs4231_setup(char *str)
{
......@@ -190,16 +190,16 @@ static int __init alsa_card_cs4231_setup(char *str)
if (nr_dev >= SNDRV_CARDS)
return 0;
(void)(get_option(&str,&snd_enable[nr_dev]) == 2 &&
get_option(&str,&snd_index[nr_dev]) == 2 &&
get_id(&str,&snd_id[nr_dev]) == 2 &&
(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,&pnp) == 2 &&
get_option(&str,(int *)&snd_port[nr_dev]) == 2 &&
get_option(&str,(int *)&snd_mpu_port[nr_dev]) == 2 &&
get_option(&str,&snd_irq[nr_dev]) == 2 &&
get_option(&str,&snd_mpu_irq[nr_dev]) == 2 &&
get_option(&str,&snd_dma1[nr_dev]) == 2 &&
get_option(&str,&snd_dma2[nr_dev]) == 2);
get_option(&str,(int *)&port[nr_dev]) == 2 &&
get_option(&str,(int *)&mpu_port[nr_dev]) == 2 &&
get_option(&str,&irq[nr_dev]) == 2 &&
get_option(&str,&mpu_irq[nr_dev]) == 2 &&
get_option(&str,&dma1[nr_dev]) == 2 &&
get_option(&str,&dma2[nr_dev]) == 2);
nr_dev++;
return 1;
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -45,39 +45,39 @@ MODULE_DEVICES("{{ESS,ES688 PnP AudioDrive,pnp:ESS0100},"
"{ESS,ES688 AudioDrive,pnp:ESS6881},"
"{ESS,ES1688 AudioDrive,pnp:ESS1681}}");
static int snd_index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *snd_id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int snd_enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
static long snd_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */
static long snd_mpu_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1};
static int snd_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,10 */
static int snd_mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,10 */
static int snd_dma8[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3 */
MODULE_PARM(snd_index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_index, "Index value for ESx688 soundcard.");
MODULE_PARM_SYNTAX(snd_index, SNDRV_INDEX_DESC);
MODULE_PARM(snd_id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
MODULE_PARM_DESC(snd_id, "ID string for ESx688 soundcard.");
MODULE_PARM_SYNTAX(snd_id, SNDRV_ID_DESC);
MODULE_PARM(snd_enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_enable, "Enable ESx688 soundcard.");
MODULE_PARM_SYNTAX(snd_enable, SNDRV_ENABLE_DESC);
MODULE_PARM(snd_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
MODULE_PARM_DESC(snd_port, "Port # for ESx688 driver.");
MODULE_PARM_SYNTAX(snd_port, SNDRV_PORT12_DESC);
MODULE_PARM(snd_mpu_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
MODULE_PARM_DESC(snd_mpu_port, "MPU-401 port # for ESx688 driver.");
MODULE_PARM_SYNTAX(snd_mpu_port, SNDRV_PORT12_DESC);
MODULE_PARM(snd_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_irq, "IRQ # for ESx688 driver.");
MODULE_PARM_SYNTAX(snd_irq, SNDRV_IRQ_DESC);
MODULE_PARM(snd_mpu_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_mpu_irq, "MPU-401 IRQ # for ESx688 driver.");
MODULE_PARM_SYNTAX(snd_mpu_irq, SNDRV_IRQ_DESC);
MODULE_PARM(snd_dma8, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_dma8, "8-bit DMA # for ESx688 driver.");
MODULE_PARM_SYNTAX(snd_dma8, SNDRV_DMA8_DESC);
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */
static long mpu_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1};
static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,10 */
static int mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,10 */
static int dma8[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3 */
MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(index, "Index value for ESx688 soundcard.");
MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
MODULE_PARM_DESC(id, "ID string for ESx688 soundcard.");
MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(enable, "Enable ESx688 soundcard.");
MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
MODULE_PARM(port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
MODULE_PARM_DESC(port, "Port # for ESx688 driver.");
MODULE_PARM_SYNTAX(port, SNDRV_PORT12_DESC);
MODULE_PARM(mpu_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
MODULE_PARM_DESC(mpu_port, "MPU-401 port # for ESx688 driver.");
MODULE_PARM_SYNTAX(mpu_port, SNDRV_PORT12_DESC);
MODULE_PARM(irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(irq, "IRQ # for ESx688 driver.");
MODULE_PARM_SYNTAX(irq, SNDRV_IRQ_DESC);
MODULE_PARM(mpu_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for ESx688 driver.");
MODULE_PARM_SYNTAX(mpu_irq, SNDRV_IRQ_DESC);
MODULE_PARM(dma8, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(dma8, "8-bit DMA # for ESx688 driver.");
MODULE_PARM_SYNTAX(dma8, SNDRV_DMA8_DESC);
static snd_card_t *snd_audiodrive_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;
......@@ -86,37 +86,37 @@ static int __init snd_audiodrive_probe(int dev)
{
static int possible_irqs[] = {5, 9, 10, 7, -1};
static int possible_dmas[] = {1, 3, 0, -1};
int irq, dma, mpu_irq;
int xirq, xdma, xmpu_irq;
snd_card_t *card;
es1688_t *chip;
opl3_t *opl3;
snd_pcm_t *pcm;
int err;
card = snd_card_new(snd_index[dev], snd_id[dev], THIS_MODULE, 0);
card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
if (card == NULL)
return -ENOMEM;
irq = snd_irq[dev];
if (irq == SNDRV_AUTO_IRQ) {
if ((irq = snd_legacy_find_free_irq(possible_irqs)) < 0) {
xirq = irq[dev];
if (xirq == SNDRV_AUTO_IRQ) {
if ((xirq = snd_legacy_find_free_irq(possible_irqs)) < 0) {
snd_card_free(card);
snd_printk("unable to find a free IRQ\n");
return -EBUSY;
}
}
mpu_irq = snd_mpu_irq[dev];
dma = snd_dma8[dev];
if (dma == SNDRV_AUTO_DMA) {
if ((dma = snd_legacy_find_free_dma(possible_dmas)) < 0) {
xmpu_irq = mpu_irq[dev];
xdma = dma8[dev];
if (xdma == SNDRV_AUTO_DMA) {
if ((xdma = snd_legacy_find_free_dma(possible_dmas)) < 0) {
snd_card_free(card);
snd_printk("unable to find a free DMA\n");
return -EBUSY;
}
}
if ((err = snd_es1688_create(card, snd_port[dev], snd_mpu_port[dev],
irq, mpu_irq, dma,
if ((err = snd_es1688_create(card, port[dev], mpu_port[dev],
xirq, xmpu_irq, xdma,
ES1688_HW_AUTO, &chip)) < 0) {
snd_card_free(card);
return err;
......@@ -139,10 +139,10 @@ static int __init snd_audiodrive_probe(int dev)
}
}
if (mpu_irq >= 0) {
if (xmpu_irq >= 0) {
if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_ES1688,
chip->mpu_port, 0,
mpu_irq,
xmpu_irq,
SA_INTERRUPT,
NULL)) < 0) {
snd_card_free(card);
......@@ -151,7 +151,7 @@ static int __init snd_audiodrive_probe(int dev)
}
strcpy(card->driver, "ES1688");
strcpy(card->shortname, pcm->name);
sprintf(card->longname, "%s at 0x%lx, irq %i, dma %i", pcm->name, chip->port, irq, dma);
sprintf(card->longname, "%s at 0x%lx, irq %i, dma %i", pcm->name, chip->port, xirq, xdma);
if ((err = snd_card_register(card)) < 0) {
snd_card_free(card);
return err;
......@@ -161,18 +161,18 @@ static int __init snd_audiodrive_probe(int dev)
}
static int __init snd_audiodrive_legacy_auto_probe(unsigned long port)
static int __init snd_audiodrive_legacy_auto_probe(unsigned long xport)
{
static int dev;
int res;
for ( ; dev < SNDRV_CARDS; dev++) {
if (!snd_enable[dev] || snd_port[dev] != SNDRV_AUTO_PORT)
if (!enable[dev] || port[dev] != SNDRV_AUTO_PORT)
continue;
snd_port[dev] = port;
port[dev] = xport;
res = snd_audiodrive_probe(dev);
if (res < 0)
snd_port[dev] = SNDRV_AUTO_PORT;
port[dev] = SNDRV_AUTO_PORT;
return res;
}
return -ENODEV;
......@@ -183,8 +183,8 @@ static int __init alsa_card_es1688_init(void)
static unsigned long possible_ports[] = {0x220, 0x240, 0x260, -1};
int dev, cards = 0;
for (dev = cards = 0; dev < SNDRV_CARDS && snd_enable[dev]; dev++) {
if (snd_port[dev] == SNDRV_AUTO_PORT)
for (dev = cards = 0; dev < SNDRV_CARDS && enable[dev]; dev++) {
if (port[dev] == SNDRV_AUTO_PORT)
continue;
if (snd_audiodrive_probe(dev) >= 0)
cards++;
......@@ -212,10 +212,10 @@ module_exit(alsa_card_es1688_exit)
#ifndef MODULE
/* format is: snd-es1688=snd_enable,snd_index,snd_id,
snd_port,snd_mpu_port,
snd_irq,snd_mpu_irq,
snd_dma8 */
/* format is: snd-es1688=enable,index,id,
port,mpu_port,
irq,mpu_irq,
dma8 */
static int __init alsa_card_es1688_setup(char *str)
{
......@@ -223,14 +223,14 @@ static int __init alsa_card_es1688_setup(char *str)
if (nr_dev >= SNDRV_CARDS)
return 0;
(void)(get_option(&str,&snd_enable[nr_dev]) == 2 &&
get_option(&str,&snd_index[nr_dev]) == 2 &&
get_id(&str,&snd_id[nr_dev]) == 2 &&
get_option(&str,(int *)&snd_port[nr_dev]) == 2 &&
get_option(&str,(int *)&snd_mpu_port[nr_dev]) == 2 &&
get_option(&str,&snd_irq[nr_dev]) == 2 &&
get_option(&str,&snd_mpu_irq[nr_dev]) == 2 &&
get_option(&str,&snd_dma8[nr_dev]) == 2);
(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,(int *)&port[nr_dev]) == 2 &&
get_option(&str,(int *)&mpu_port[nr_dev]) == 2 &&
get_option(&str,&irq[nr_dev]) == 2 &&
get_option(&str,&mpu_irq[nr_dev]) == 2 &&
get_option(&str,&dma8[nr_dev]) == 2);
nr_dev++;
return 1;
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -41,31 +41,31 @@ MODULE_LICENSE("GPL");
MODULE_CLASSES("{sound}");
MODULE_DEVICES("{{ESS,AudioDrive ES968}}");
static int snd_index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *snd_id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int snd_enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */
static long snd_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
static int snd_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* Pnp setup */
static int snd_dma8[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* PnP setup */
MODULE_PARM(snd_index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_index, "Index value for es968 based soundcard.");
MODULE_PARM_SYNTAX(snd_index, SNDRV_INDEX_DESC);
MODULE_PARM(snd_id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
MODULE_PARM_DESC(snd_id, "ID string for es968 based soundcard.");
MODULE_PARM_SYNTAX(snd_id, SNDRV_ID_DESC);
MODULE_PARM(snd_enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_enable, "Enable es968 based soundcard.");
MODULE_PARM_SYNTAX(snd_enable, SNDRV_ENABLE_DESC);
MODULE_PARM(snd_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
MODULE_PARM_DESC(snd_port, "Port # for es968 driver.");
MODULE_PARM_SYNTAX(snd_port, SNDRV_PORT12_DESC);
MODULE_PARM(snd_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_irq, "IRQ # for es968 driver.");
MODULE_PARM_SYNTAX(snd_irq, SNDRV_IRQ_DESC);
MODULE_PARM(snd_dma8, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_dma8, "8-bit DMA # for es968 driver.");
MODULE_PARM_SYNTAX(snd_dma8, SNDRV_DMA8_DESC);
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */
static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* Pnp setup */
static int dma8[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* PnP setup */
MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(index, "Index value for es968 based soundcard.");
MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
MODULE_PARM_DESC(id, "ID string for es968 based soundcard.");
MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(enable, "Enable es968 based soundcard.");
MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
MODULE_PARM(port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
MODULE_PARM_DESC(port, "Port # for es968 driver.");
MODULE_PARM_SYNTAX(port, SNDRV_PORT12_DESC);
MODULE_PARM(irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(irq, "IRQ # for es968 driver.");
MODULE_PARM_SYNTAX(irq, SNDRV_IRQ_DESC);
MODULE_PARM(dma8, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(dma8, "8-bit DMA # for es968 driver.");
MODULE_PARM_SYNTAX(dma8, SNDRV_DMA8_DESC);
struct snd_card_es968 {
#ifdef __ISAPNP__
......@@ -123,22 +123,22 @@ static int __init snd_card_es968_isapnp(int dev, struct snd_card_es968 *acard)
if (pdev->prepare(pdev)<0)
return -EAGAIN;
if (snd_port[dev] != SNDRV_AUTO_PORT)
isapnp_resource_change(&pdev->resource[0], snd_port[dev], 16);
if (snd_dma8[dev] != SNDRV_AUTO_DMA)
isapnp_resource_change(&pdev->dma_resource[0], snd_dma8[dev],
if (port[dev] != SNDRV_AUTO_PORT)
isapnp_resource_change(&pdev->resource[0], port[dev], 16);
if (dma8[dev] != SNDRV_AUTO_DMA)
isapnp_resource_change(&pdev->dma_resource[0], dma8[dev],
1);
if (snd_irq[dev] != SNDRV_AUTO_IRQ)
isapnp_resource_change(&pdev->irq_resource[0], snd_irq[dev], 1);
if (irq[dev] != SNDRV_AUTO_IRQ)
isapnp_resource_change(&pdev->irq_resource[0], irq[dev], 1);
if (pdev->activate(pdev)<0) {
snd_printk("AUDIO isapnp configure failure\n");
return -EBUSY;
}
snd_port[dev] = pdev->resource[0].start;
snd_dma8[dev] = pdev->dma_resource[0].start;
snd_irq[dev] = pdev->irq_resource[0].start;
port[dev] = pdev->resource[0].start;
dma8[dev] = pdev->dma_resource[0].start;
irq[dev] = pdev->irq_resource[0].start;
return 0;
}
......@@ -170,7 +170,7 @@ static int __init snd_card_es968_probe(int dev)
snd_card_t *card;
struct snd_card_es968 *acard;
if ((card = snd_card_new(snd_index[dev], snd_id[dev], THIS_MODULE,
if ((card = snd_card_new(index[dev], id[dev], THIS_MODULE,
sizeof(struct snd_card_es968))) == NULL)
return -ENOMEM;
acard = (struct snd_card_es968 *)card->private_data;
......@@ -187,10 +187,10 @@ static int __init snd_card_es968_probe(int dev)
return -ENOSYS;
#endif /* __ISAPNP__ */
if ((error = snd_sbdsp_create(card, snd_port[dev],
snd_irq[dev],
if ((error = snd_sbdsp_create(card, port[dev],
irq[dev],
snd_card_es968_interrupt,
snd_dma8[dev],
dma8[dev],
-1,
SB_HW_AUTO, &chip)) < 0) {
snd_card_free(card);
......@@ -215,7 +215,7 @@ static int __init snd_card_es968_probe(int dev)
strcpy(card->driver, "ES968");
strcpy(card->shortname, "ESS ES968");
sprintf(card->longname, "%s soundcard, %s at 0x%lx, irq %d, dma %d",
card->shortname, chip->name, chip->port, snd_irq[dev], snd_dma8[dev]);
card->shortname, chip->name, chip->port, irq[dev], dma8[dev]);
if ((error = snd_card_register(card)) < 0) {
snd_card_free(card);
......@@ -233,7 +233,7 @@ static int __init snd_es968_isapnp_detect(struct isapnp_card *card,
int res;
for ( ; dev < SNDRV_CARDS; dev++) {
if (!snd_enable[dev])
if (!enable[dev])
continue;
snd_es968_isapnp_cards[dev] = card;
snd_es968_isapnp_id[dev] = id;
......@@ -276,8 +276,8 @@ module_exit(alsa_card_es968_exit)
#ifndef MODULE
/* format is: snd-es968=snd_enable,snd_index,snd_id,
snd_port,snd_irq,snd_dma1 */
/* format is: snd-es968=enable,index,id,
port,irq,snd_dma1 */
static int __init alsa_card_es968_setup(char *str)
{
......@@ -285,12 +285,12 @@ static int __init alsa_card_es968_setup(char *str)
if (nr_dev >= SNDRV_CARDS)
return 0;
(void)(get_option(&str,&snd_enable[nr_dev]) == 2 &&
get_option(&str,&snd_index[nr_dev]) == 2 &&
get_id(&str,&snd_id[nr_dev]) == 2 &&
get_option(&str,(int *)&snd_port[nr_dev]) == 2 &&
get_option(&str,&snd_irq[nr_dev]) == 2 &&
get_option(&str,&snd_dma8[nr_dev]) == 2);
(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,(int *)&port[nr_dev]) == 2 &&
get_option(&str,&irq[nr_dev]) == 2 &&
get_option(&str,&dma8[nr_dev]) == 2);
nr_dev++;
return 1;
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -48,9 +48,9 @@
/* export */
static int snd_enable[8] = {1,1,1,1,1,1,1,1};
MODULE_PARM(snd_enable, "1-" __MODULE_STRING(HAMMERFALL_CARDS) "i");
MODULE_PARM_DESC(snd_enable, "Enable cards to allocate buffers for.");
static int enable[8] = {1,1,1,1,1,1,1,1};
MODULE_PARM(enable, "1-" __MODULE_STRING(HAMMERFALL_CARDS) "i");
MODULE_PARM_DESC(enable, "Enable cards to allocate buffers for.");
MODULE_AUTHOR("Winfried Ritsch, Paul Barton-Davis <pbd@op.net>");
MODULE_DESCRIPTION("Memory allocator for RME Hammerfall");
......@@ -236,7 +236,7 @@ static int __init alsa_hammerfall_mem_init(void)
if (pci->vendor != 0x10ee || (pci->device != 0x3fc4 && pci->device != 0x3fc5))
continue;
if (!snd_enable[i])
if (!enable[i])
continue;
for (k = 0; k < 2; ++k) {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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