Commit 5516118c authored by Jaroslav Kysela's avatar Jaroslav Kysela

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

ALSA Core,ALS100 driver,AZT2320 driver,DT019x driver,CS4231 driver
CS4236+ driver,PC98(CS423x) driver,Opti9xx drivers,SB16/AWE driver
Wavefront drivers
use the standard port address, 0 = disable, 1 = auto-probe, others manual.
negative values are accepted as disable, too.
parent 6b8430f4
......@@ -35,7 +35,7 @@ static const char __module_generic_string_##name [] \
#define MODULE_DEVICES(val) MODULE_GENERIC_STRING(info_devices, val)
#define MODULE_PARM_SYNTAX(id, val) MODULE_GENERIC_STRING(info_parm_##id, val)
#define SNDRV_AUTO_PORT 0xffff
#define SNDRV_AUTO_PORT 1
#define SNDRV_AUTO_IRQ 0xffff
#define SNDRV_AUTO_DMA 0xffff
#define SNDRV_AUTO_DMA_SIZE (0x7fffffff)
......@@ -58,7 +58,7 @@ static const char __module_generic_string_##name [] \
#else
#define SNDRV_DEFAULT_ENABLE_ISAPNP SNDRV_DEFAULT_ENABLE
#endif
#define SNDRV_DEFAULT_PORT { SNDRV_AUTO_PORT, [1 ... (SNDRV_CARDS-1)] = -1 }
#define SNDRV_DEFAULT_PORT { [0 ... (SNDRV_CARDS-1)] = SNDRV_AUTO_PORT }
#define SNDRV_DEFAULT_IRQ { [0 ... (SNDRV_CARDS-1)] = SNDRV_AUTO_IRQ }
#define SNDRV_DEFAULT_DMA { [0 ... (SNDRV_CARDS-1)] = SNDRV_AUTO_DMA }
#define SNDRV_DEFAULT_DMA_SIZE { [0 ... (SNDRV_CARDS-1)] = SNDRV_AUTO_DMA_SIZE }
......
......@@ -249,7 +249,7 @@ static int __init snd_card_als100_probe(int dev,
return error;
}
if (mpu_port[dev] > 0) {
if (mpu_port[dev] > 0 && mpu_port[dev] != SNDRV_AUTO_PORT) {
if (snd_mpu401_uart_new(card, 0, MPU401_HW_ALS100,
mpu_port[dev], 0,
mpu_irq[dev], SA_INTERRUPT,
......@@ -257,7 +257,7 @@ static int __init snd_card_als100_probe(int dev,
snd_printk(KERN_ERR PFX "no MPU-401 device at 0x%lx\n", mpu_port[dev]);
}
if (fm_port[dev] > 0) {
if (fm_port[dev] > 0 && fm_port[dev] != SNDRV_AUTO_PORT) {
if (snd_opl3_create(card,
fm_port[dev], fm_port[dev] + 2,
OPL3_HW_AUTO, 0, &opl3) < 0) {
......
......@@ -283,7 +283,7 @@ static int __devinit snd_card_azt2320_probe(int dev,
return error;
}
if (mpu_port[dev] > 0) {
if (mpu_port[dev] > 0 && mpu_port[dev] != SNDRV_AUTO_PORT) {
if (snd_mpu401_uart_new(card, 0, MPU401_HW_AZT2320,
mpu_port[dev], 0,
mpu_irq[dev], SA_INTERRUPT,
......@@ -291,7 +291,7 @@ static int __devinit snd_card_azt2320_probe(int dev,
snd_printk(KERN_ERR PFX "no MPU-401 device at 0x%lx\n", mpu_port[dev]);
}
if (fm_port[dev] > 0) {
if (fm_port[dev] > 0 && fm_port[dev] != SNDRV_AUTO_PORT) {
if (snd_opl3_create(card,
fm_port[dev], fm_port[dev] + 2,
OPL3_HW_AUTO, 0, &opl3) < 0) {
......
......@@ -103,8 +103,6 @@ static int __init snd_card_cs4231_probe(int dev)
if (card == NULL)
return -ENOMEM;
acard = (struct snd_card_cs4231 *)card->private_data;
if (mpu_port[dev] < 0)
mpu_port[dev] = SNDRV_AUTO_PORT;
if ((err = snd_cs4231_create(card, port[dev], -1,
irq[dev],
dma1[dev],
......@@ -128,10 +126,13 @@ static int __init snd_card_cs4231_probe(int dev)
return err;
}
if (mpu_irq[dev] >= 0 && mpu_irq[dev] != SNDRV_AUTO_IRQ) {
if (mpu_port[dev] > 0 && mpu_port[dev] != SNDRV_AUTO_PORT) {
if (mpu_irq[dev] == SNDRV_AUTO_IRQ)
mpu_irq[dev] = -1;
if (snd_mpu401_uart_new(card, 0, MPU401_HW_CS4232,
mpu_port[dev], 0,
mpu_irq[dev], SA_INTERRUPT,
mpu_irq[dev],
mpu_irq[dev] >= 0 ? SA_INTERRUPT : 0,
NULL) < 0)
printk(KERN_ERR "cs4231: MPU401 not detected\n");
}
......
......@@ -307,7 +307,7 @@ static int __devinit snd_card_cs4236_pnp(int dev, struct snd_card_cs4236 *acard,
pnp_init_resource_table(cfg);
if (port[dev] != SNDRV_AUTO_PORT)
pnp_resource_change(&cfg->port_resource[0], port[dev], 4);
if (fm_port[dev] != SNDRV_AUTO_PORT && fm_port[dev] >= 0)
if (fm_port[dev] != SNDRV_AUTO_PORT && fm_port[dev] > 0)
pnp_resource_change(&cfg->port_resource[1], fm_port[dev], 4);
if (sb_port[dev] != SNDRV_AUTO_PORT)
pnp_resource_change(&cfg->port_resource[2], sb_port[dev], 16);
......@@ -327,7 +327,7 @@ static int __devinit snd_card_cs4236_pnp(int dev, struct snd_card_cs4236 *acard,
return -EBUSY;
}
port[dev] = pnp_port_start(pdev, 0);
if (fm_port[dev] >= 0)
if (fm_port[dev] > 0)
fm_port[dev] = pnp_port_start(pdev, 1);
sb_port[dev] = pnp_port_start(pdev, 2);
irq[dev] = pnp_irq(pdev, 0);
......@@ -338,7 +338,7 @@ static int __devinit snd_card_cs4236_pnp(int dev, struct snd_card_cs4236 *acard,
snd_printdd("isapnp WSS: irq=%i, dma1=%i, dma2=%i\n",
irq[dev], dma1[dev], dma2[dev]);
/* CTRL initialization */
if (acard->ctrl && cport[dev] >= 0) {
if (acard->ctrl && cport[dev] > 0) {
pdev = acard->ctrl;
pnp_init_resource_table(cfg);
if (cport[dev] != SNDRV_AUTO_PORT)
......@@ -356,12 +356,13 @@ static int __devinit snd_card_cs4236_pnp(int dev, struct snd_card_cs4236 *acard,
snd_printdd("isapnp CTRL: control port=0x%lx\n", cport[dev]);
}
/* MPU initialization */
if (acard->mpu && mpu_port[dev] >= 0) {
if (acard->mpu && mpu_port[dev] > 0) {
pdev = acard->mpu;
pnp_init_resource_table(cfg);
if (mpu_port[dev] != SNDRV_AUTO_PORT)
pnp_resource_change(&cfg->port_resource[0], mpu_port[dev], 2);
if (mpu_irq[dev] != SNDRV_AUTO_IRQ && mpu_irq[dev] >= 0)
if (mpu_irq[dev] != SNDRV_AUTO_IRQ && mpu_irq[dev] >= 0 &&
pnp_irq_valid(pdev, 0))
pnp_resource_change(&cfg->irq_resource[0], mpu_irq[dev], 1);
err = pnp_manual_config_dev(pdev, cfg, 0);
if (err < 0)
......@@ -373,7 +374,8 @@ static int __devinit snd_card_cs4236_pnp(int dev, struct snd_card_cs4236 *acard,
mpu_irq[dev] = SNDRV_AUTO_IRQ;
} else {
mpu_port[dev] = pnp_port_start(pdev, 0);
if (pnp_irq_valid(pdev, 0) && pnp_irq(pdev, 0) >= 0) {
if (mpu_irq[dev] >= 0 &&
pnp_irq_valid(pdev, 0) && pnp_irq(pdev, 0) >= 0) {
mpu_irq[dev] = pnp_irq(pdev, 0);
} else {
mpu_irq[dev] = -1; /* disable interrupt */
......@@ -435,13 +437,7 @@ static int __devinit snd_card_cs423x_probe(int dev, struct pnp_card_link *pcard,
return -ENXIO;
}
#endif
if (mpu_port[dev] < 0)
mpu_port[dev] = SNDRV_AUTO_PORT;
if (fm_port[dev] < 0)
fm_port[dev] = SNDRV_AUTO_PORT;
if (sb_port[dev] < 0)
sb_port[dev] = SNDRV_AUTO_PORT;
if (sb_port[dev] != SNDRV_AUTO_PORT)
if (sb_port[dev] > 0 && sb_port[dev] != SNDRV_AUTO_PORT)
if ((acard->res_sb_port = request_region(sb_port[dev], 16, IDENT " SB")) == NULL) {
printk(KERN_ERR IDENT ": unable to register SB port at 0x%lx\n", sb_port[dev]);
snd_card_free(card);
......@@ -498,7 +494,7 @@ static int __devinit snd_card_cs423x_probe(int dev, struct pnp_card_link *pcard,
return err;
}
if (fm_port[dev] != SNDRV_AUTO_PORT) {
if (fm_port[dev] > 0 && fm_port[dev] != SNDRV_AUTO_PORT) {
if (snd_opl3_create(card,
fm_port[dev], fm_port[dev] + 2,
OPL3_HW_OPL3_CS, 0, &opl3) < 0) {
......@@ -511,7 +507,9 @@ static int __devinit snd_card_cs423x_probe(int dev, struct pnp_card_link *pcard,
}
}
if (mpu_port[dev] != SNDRV_AUTO_PORT) {
if (mpu_port[dev] > 0 && mpu_port[dev] != SNDRV_AUTO_PORT) {
if (mpu_irq[dev] == SNDRV_AUTO_IRQ)
mpu_irq[dev] = -1;
if (snd_mpu401_uart_new(card, 0, MPU401_HW_CS4232,
mpu_port[dev], 0,
mpu_irq[dev],
......
......@@ -327,10 +327,6 @@ static int __init snd_card_pc98_probe(int dev)
card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
if (card == NULL)
return -ENOMEM;
if (mpu_port[dev] < 0 || mpu_irq[dev] < 0)
mpu_port[dev] = SNDRV_AUTO_PORT;
if (fm_port[dev] < 0)
fm_port[dev] = SNDRV_AUTO_PORT;
if ((err = pc98_cs4231_chip_init(dev)) < 0) {
snd_card_free(card);
......@@ -363,7 +359,7 @@ static int __init snd_card_pc98_probe(int dev)
return err;
}
if (fm_port[dev] != SNDRV_AUTO_PORT) {
if (fm_port[dev] > 0 && fm_port[dev] != SNDRV_AUTO_PORT) {
/* ??? */
outb(0x00, fm_port[dev] + 6);
inb(fm_port[dev] + 7);
......@@ -381,7 +377,7 @@ static int __init snd_card_pc98_probe(int dev)
}
}
if (mpu_port[dev] != SNDRV_AUTO_PORT) {
if (mpu_port[dev] > 0 && mpu_port[dev] != SNDRV_AUTO_PORT) {
err = pc98_mpu401_init(mpu_irq[dev]);
if (! err) {
err = snd_mpu401_uart_new(card, 0,
......
......@@ -235,18 +235,20 @@ static int __devinit snd_card_dt019x_probe(int dev, struct pnp_card_link *pcard,
return error;
}
if (mpu_port[dev] > 0) {
if (mpu_port[dev] > 0 && mpu_port[dev] != SNDRV_AUTO_PORT) {
if (mpu_irq[dev] == SNDRV_AUTO_IRQ)
mpu_irq[dev] = -1;
if (snd_mpu401_uart_new(card, 0,
/* MPU401_HW_SB,*/
MPU401_HW_MPU401,
mpu_port[dev], 0,
mpu_irq[dev],
SA_INTERRUPT,
mpu_irq[dev] >= 0 ? SA_INTERRUPT : 0,
NULL) < 0)
snd_printk(KERN_ERR PFX "no MPU-401 device at 0x%lx ?\n", mpu_port[dev]);
}
if (fm_port[dev] > 0) {
if (fm_port[dev] > 0 && fm_port[dev] != SNDRV_AUTO_PORT) {
if (snd_opl3_create(card,
fm_port[dev],
fm_port[dev] + 2,
......
......@@ -604,6 +604,7 @@ static int __devinit snd_opti9xx_configure(opti9xx_t *chip)
__skip_resources:
if (chip->hardware > OPTi9XX_HW_82C928) {
switch (chip->mpu_port) {
case 0:
case -1:
break;
case 0x300:
......@@ -644,7 +645,7 @@ static int __devinit snd_opti9xx_configure(opti9xx_t *chip)
}
snd_opti9xx_write_mask(chip, OPTi9XX_MC_REG(6),
(chip->mpu_port == -1) ? 0x00 :
(chip->mpu_port <= 0) ? 0x00 :
0x80 | mpu_port_bits << 5 | mpu_irq_bits << 3,
0xf8);
}
......@@ -2093,7 +2094,7 @@ static int __devinit snd_card_opti9xx_probe(struct pnp_card_link *pcard,
}
#endif
if (chip->mpu_port <= 0)
if (chip->mpu_port <= 0 || chip->mpu_port == SNDRV_AUTO_PORT)
rmidi = NULL;
else
if ((error = snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401,
......@@ -2101,7 +2102,7 @@ static int __devinit snd_card_opti9xx_probe(struct pnp_card_link *pcard,
&rmidi)))
snd_printk("no MPU-401 device at 0x%lx?\n", chip->mpu_port);
if (chip->fm_port > 0) {
if (chip->fm_port > 0 && chip->fm_port != SNDRV_AUTO_PORT) {
opl3_t *opl3 = NULL;
#ifndef OPTi93X
if (chip->hardware == OPTi9XX_HW_82C928 ||
......
......@@ -465,7 +465,7 @@ static int __init snd_sb16_probe(int dev,
return -ENXIO;
}
if (chip->mpu_port) {
if (chip->mpu_port > 0 && chip->mpu_port != SNDRV_AUTO_PORT) {
if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_SB,
chip->mpu_port, 0,
xirq, 0, &chip->rmidi)) < 0) {
......@@ -475,7 +475,12 @@ static int __init snd_sb16_probe(int dev,
chip->rmidi_callback = snd_mpu401_uart_interrupt;
}
if (fm_port[dev] > 0) {
#ifdef SNDRV_SBAWE_EMU8000
if (awe_port[dev] == SNDRV_AUTO_PORT)
awe_port[dev] = 0; /* disable */
#endif
if (fm_port[dev] > 0 && fm_port[dev] != SNDRV_AUTO_PORT) {
if (snd_opl3_create(card, fm_port[dev], fm_port[dev] + 2,
OPL3_HW_OPL3,
fm_port[dev] == port[dev] || fm_port[dev] == 0x388,
......
......@@ -418,13 +418,6 @@ snd_wavefront_probe (int dev, struct pnp_card_link *pcard,
snd_hwdep_t *fx_processor;
int hw_dev = 0, midi_dev = 0, err;
if (cs4232_mpu_port[dev] < 0)
cs4232_mpu_port[dev] = SNDRV_AUTO_PORT;
if (fm_port[dev] < 0)
fm_port[dev] = SNDRV_AUTO_PORT;
if (ics2115_port[dev] < 0)
ics2115_port[dev] = SNDRV_AUTO_PORT;
#ifdef CONFIG_PNP
if (!isapnp[dev]) {
#endif
......@@ -490,7 +483,7 @@ snd_wavefront_probe (int dev, struct pnp_card_link *pcard,
/* ---------- OPL3 synth --------- */
if (fm_port[dev] != SNDRV_AUTO_PORT) {
if (fm_port[dev] > 0 && fm_port[dev] != SNDRV_AUTO_PORT) {
opl3_t *opl3;
if ((err = snd_opl3_create(card,
......@@ -561,7 +554,7 @@ snd_wavefront_probe (int dev, struct pnp_card_link *pcard,
/* ------ ICS2115 internal MIDI ------------ */
if (ics2115_port[dev] >= 0 && ics2115_port[dev] != SNDRV_AUTO_PORT) {
if (ics2115_port[dev] > 0 && ics2115_port[dev] != SNDRV_AUTO_PORT) {
ics2115_internal_rmidi =
snd_wavefront_new_midi (card,
midi_dev,
......@@ -578,7 +571,7 @@ snd_wavefront_probe (int dev, struct pnp_card_link *pcard,
/* ------ ICS2115 external MIDI ------------ */
if (ics2115_port[dev] >= 0 && ics2115_port[dev] != SNDRV_AUTO_PORT) {
if (ics2115_port[dev] > 0 && ics2115_port[dev] != SNDRV_AUTO_PORT) {
ics2115_external_rmidi =
snd_wavefront_new_midi (card,
midi_dev,
......@@ -631,7 +624,7 @@ snd_wavefront_probe (int dev, struct pnp_card_link *pcard,
if (dma2[dev] >= 0 && dma2[dev] < 8)
sprintf(card->longname + strlen(card->longname), "&%d", dma2[dev]);
if (cs4232_mpu_port[dev] != SNDRV_AUTO_PORT) {
if (cs4232_mpu_port[dev] > 0 && cs4232_mpu_port[dev] != SNDRV_AUTO_PORT) {
sprintf (card->longname + strlen (card->longname),
" MPU-401 0x%lx irq %d",
cs4232_mpu_port[dev],
......
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