Commit e5c51454 authored by Jaroslav Kysela's avatar Jaroslav Kysela

Merge suse.cz:/home/perex/bk/linux-sound/linux-2.5

into suse.cz:/home/perex/bk/linux-sound/linux-sound
parents 8754a8e2 45b68e44
......@@ -281,7 +281,8 @@ int snd_card_free(snd_card_t * card)
}
if (card->private_free)
card->private_free(card);
snd_info_unregister(card->proc_id);
if (card->proc_id)
snd_info_unregister(card->proc_id);
if (snd_info_card_free(card) < 0) {
snd_printk(KERN_WARNING "unable to free card info\n");
/* Not fatal error */
......
......@@ -342,7 +342,7 @@ static int __init snd_uart16550_detect(snd_uart16550_t *uart)
unsigned char c;
/* Do some vague tests for the presence of the uart */
if (io_base == 0) {
if (io_base == 0 || io_base == SNDRV_AUTO_PORT) {
return -ENODEV; /* Not configured */
}
......@@ -804,10 +804,9 @@ static int __init snd_uart16550_create(snd_card_t * card,
return err;
}
if (irq >= 0) {
if (irq >= 0 && irq != SNDRV_AUTO_IRQ) {
if (request_irq(irq, snd_uart16550_interrupt,
SA_INTERRUPT, "Serial MIDI", (void *) uart)) {
uart->irq = -1;
snd_printk("irq %d busy. Using Polling.\n", irq);
} else {
uart->irq = irq;
......
......@@ -553,6 +553,7 @@ int snd_cs8427_iec958_pcm(snd_i2c_device_t *cs8427, unsigned int rate)
SNDRV_CTL_EVENT_MASK_VALUE,
&chip->playback.pcm_ctl->id);
reset = chip->rate != rate;
chip->rate = rate;
snd_i2c_unlock(cs8427->bus);
if (reset)
snd_cs8427_reset(cs8427);
......
......@@ -296,8 +296,8 @@ static int __devinit snd_dt019x_pnp_probe(struct pnp_card_link *card,
return res;
dev++;
return 0;
}
return -ENODEV;
}
return -ENODEV;
}
static void __devexit snd_dt019x_pnp_remove(struct pnp_card_link * pcard)
......@@ -322,8 +322,10 @@ static int __init alsa_card_dt019x_init(void)
cards += pnp_register_card_driver(&dt019x_pnpc_driver);
#ifdef MODULE
if (!cards)
if (!cards) {
pnp_unregister_card_driver(&dt019x_pnpc_driver);
snd_printk(KERN_ERR "no DT-019X / ALS-007 based soundcards found\n");
}
#endif
return cards ? 0 : -ENODEV;
}
......
......@@ -182,7 +182,7 @@ static int __init snd_audiodrive_legacy_auto_probe(unsigned long xport)
static int __init alsa_card_es1688_init(void)
{
static unsigned long possible_ports[] = {0x220, 0x240, 0x260, -1};
int dev, cards = 0;
int dev, cards = 0, i;
for (dev = cards = 0; dev < SNDRV_CARDS && enable[dev]; dev++) {
if (port[dev] == SNDRV_AUTO_PORT)
......@@ -190,7 +190,10 @@ static int __init alsa_card_es1688_init(void)
if (snd_audiodrive_probe(dev) >= 0)
cards++;
}
cards += snd_legacy_auto_probe(possible_ports, snd_audiodrive_legacy_auto_probe);
i = snd_legacy_auto_probe(possible_ports, snd_audiodrive_legacy_auto_probe);
if (i > 0)
cards += i;
if (!cards) {
#ifdef MODULE
printk(KERN_ERR "ESS AudioDrive ES1688 soundcard not found or device busy\n");
......
......@@ -2232,7 +2232,7 @@ static struct pnp_card_driver es18xx_pnpc_driver = {
static int __init alsa_card_es18xx_init(void)
{
static unsigned long possible_ports[] = {0x220, 0x240, 0x260, 0x280, -1};
int dev, cards = 0;
int dev, cards = 0, i;
/* legacy non-auto cards at first */
for (dev = 0; dev < SNDRV_CARDS; dev++) {
......@@ -2246,10 +2246,16 @@ static int __init alsa_card_es18xx_init(void)
cards++;
}
/* legacy auto configured cards */
cards += snd_legacy_auto_probe(possible_ports, snd_audiodrive_probe_legacy_port);
i = snd_legacy_auto_probe(possible_ports, snd_audiodrive_probe_legacy_port);
if (i > 0)
cards += i;
#ifdef CONFIG_PNP
/* ISA PnP cards at last */
cards += pnp_register_card_driver(&es18xx_pnpc_driver);
i = pnp_register_card_driver(&es18xx_pnpc_driver);
if (i > 0)
cards += i;
#endif
if(!cards) {
#ifdef CONFIG_PNP
......
......@@ -238,7 +238,7 @@ static int __init snd_gusclassic_legacy_auto_probe(unsigned long xport)
static int __init alsa_card_gusclassic_init(void)
{
static unsigned long possible_ports[] = {0x220, 0x230, 0x240, 0x250, 0x260, -1};
int dev, cards;
int dev, cards, i;
for (dev = cards = 0; dev < SNDRV_CARDS && enable[dev]; dev++) {
if (port[dev] == SNDRV_AUTO_PORT)
......@@ -246,7 +246,10 @@ static int __init alsa_card_gusclassic_init(void)
if (snd_gusclassic_probe(dev) >= 0)
cards++;
}
cards += snd_legacy_auto_probe(possible_ports, snd_gusclassic_legacy_auto_probe);
i = snd_legacy_auto_probe(possible_ports, snd_gusclassic_legacy_auto_probe);
if (i > 0)
cards += i;
if (!cards) {
#ifdef MODULE
printk(KERN_ERR "GUS Classic soundcard not found or device busy\n");
......
......@@ -220,17 +220,17 @@ static int __init snd_gusextreme_probe(int dev)
xgf1_irq = gf1_irq[dev];
if (xgf1_irq == SNDRV_AUTO_IRQ) {
if ((xgf1_irq = snd_legacy_find_free_irq(possible_gf1_irqs)) < 0) {
snd_card_free(card);
snd_printk("unable to find a free IRQ for GF1\n");
return -EBUSY;
err = -EBUSY;
goto out;
}
}
xess_irq = irq[dev];
if (xess_irq == SNDRV_AUTO_IRQ) {
if ((xess_irq = snd_legacy_find_free_irq(possible_ess_irqs)) < 0) {
snd_card_free(card);
snd_printk("unable to find a free IRQ for ES1688\n");
return -EBUSY;
err = -EBUSY;
goto out;
}
}
if (mpu_port[dev] == SNDRV_AUTO_PORT)
......@@ -241,26 +241,24 @@ static int __init snd_gusextreme_probe(int dev)
xgf1_dma = dma1[dev];
if (xgf1_dma == SNDRV_AUTO_DMA) {
if ((xgf1_dma = snd_legacy_find_free_dma(possible_gf1_dmas)) < 0) {
snd_card_free(card);
snd_printk("unable to find a free DMA for GF1\n");
return -EBUSY;
err = -EBUSY;
goto out;
}
}
xess_dma = dma8[dev];
if (xess_dma == SNDRV_AUTO_DMA) {
if ((xess_dma = snd_legacy_find_free_dma(possible_ess_dmas)) < 0) {
snd_card_free(card);
snd_printk("unable to find a free DMA for ES1688\n");
return -EBUSY;
err = -EBUSY;
goto out;
}
}
if ((err = snd_es1688_create(card, port[dev], mpu_port[dev],
xess_irq, xmpu_irq, xess_dma,
ES1688_HW_1688, &es1688)) < 0) {
snd_card_free(card);
return err;
}
ES1688_HW_1688, &es1688)) < 0)
goto out;
if (gf1_port[dev] < 0)
gf1_port[dev] = port[dev] + 0x20;
if ((err = snd_gus_create(card,
......@@ -270,77 +268,65 @@ static int __init snd_gusextreme_probe(int dev)
-1,
0, channels[dev],
pcm_channels[dev], 0,
&gus)) < 0) {
snd_card_free(card);
return err;
}
if ((err = snd_gusextreme_detect(dev, card, gus, es1688)) < 0) {
snd_card_free(card);
return err;
}
&gus)) < 0)
goto out;
if ((err = snd_gusextreme_detect(dev, card, gus, es1688)) < 0)
goto out;
snd_gusextreme_init(dev, gus);
if ((err = snd_gus_initialize(gus)) < 0) {
snd_card_free(card);
return err;
}
if ((err = snd_gus_initialize(gus)) < 0)
goto out;
if (!gus->ess_flag) {
snd_printdd("GUS Extreme soundcard was not detected at 0x%lx\n", gus->gf1.port);
snd_card_free(card);
return -ENODEV;
}
if ((err = snd_es1688_pcm(es1688, 0, NULL)) < 0) {
snd_card_free(card);
return err;
}
if ((err = snd_es1688_mixer(es1688)) < 0) {
snd_card_free(card);
return err;
err = -ENODEV;
goto out;
}
if ((err = snd_es1688_pcm(es1688, 0, NULL)) < 0)
goto out;
if ((err = snd_es1688_mixer(es1688)) < 0)
goto out;
snd_component_add(card, "ES1688");
if (pcm_channels[dev] > 0) {
if ((err = snd_gf1_pcm_new(gus, 1, 1, NULL)) < 0) {
snd_card_free(card);
return err;
}
}
if ((err = snd_gf1_new_mixer(gus)) < 0) {
snd_card_free(card);
return err;
}
if ((err = snd_gusextreme_mixer(es1688)) < 0) {
snd_card_free(card);
return err;
if ((err = snd_gf1_pcm_new(gus, 1, 1, NULL)) < 0)
goto out;
}
if ((err = snd_gf1_new_mixer(gus)) < 0)
goto out;
if ((err = snd_gusextreme_mixer(es1688)) < 0)
goto out;
if (snd_opl3_create(card, es1688->port, es1688->port + 2,
OPL3_HW_OPL3, 0, &opl3) < 0) {
printk(KERN_ERR "gusextreme: opl3 not detected at 0x%lx\n", es1688->port);
} else {
if ((err = snd_opl3_hwdep_new(opl3, 0, 2, NULL)) < 0) {
snd_card_free(card);
return err;
}
if ((err = snd_opl3_hwdep_new(opl3, 0, 2, NULL)) < 0)
goto out;
}
if (es1688->mpu_port >= 0x300) {
if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_ES1688,
if (es1688->mpu_port >= 0x300 &&
(err = snd_mpu401_uart_new(card, 0, MPU401_HW_ES1688,
es1688->mpu_port, 0,
xmpu_irq,
SA_INTERRUPT,
NULL)) < 0) {
snd_card_free(card);
return err;
}
}
NULL)) < 0)
goto out;
sprintf(card->longname, "Gravis UltraSound Extreme at 0x%lx, irq %i&%i, dma %i&%i",
es1688->port, xgf1_irq, xess_irq, xgf1_dma, xess_dma);
if ((err = snd_card_register(card)) < 0) {
snd_card_free(card);
return err;
}
if ((err = snd_card_register(card)) < 0)
goto out;
snd_gusextreme_cards[dev] = card;
return 0;
out:
snd_card_free(card);
return err;
}
static int __init snd_gusextreme_legacy_auto_probe(unsigned long xport)
......@@ -363,7 +349,7 @@ static int __init snd_gusextreme_legacy_auto_probe(unsigned long xport)
static int __init alsa_card_gusextreme_init(void)
{
static unsigned long possible_ports[] = {0x220, 0x240, 0x260, -1};
int dev, cards;
int dev, cards, i;
for (dev = cards = 0; dev < SNDRV_CARDS && enable[dev] > 0; dev++) {
if (port[dev] == SNDRV_AUTO_PORT)
......@@ -371,7 +357,10 @@ static int __init alsa_card_gusextreme_init(void)
if (snd_gusextreme_probe(dev) >= 0)
cards++;
}
cards += snd_legacy_auto_probe(possible_ports, snd_gusextreme_legacy_auto_probe);
i = snd_legacy_auto_probe(possible_ports, snd_gusextreme_legacy_auto_probe);
if (i > 0)
cards += i;
if (!cards) {
#ifdef MODULE
printk(KERN_ERR "GUS Extreme soundcard not found or device busy\n");
......
......@@ -378,7 +378,7 @@ static int __init snd_gusmax_legacy_auto_probe(unsigned long xport)
static int __init alsa_card_gusmax_init(void)
{
static unsigned long possible_ports[] = {0x220, 0x230, 0x240, 0x250, 0x260, -1};
int dev, cards;
int dev, cards, i;
for (dev = cards = 0; dev < SNDRV_CARDS && enable[dev] > 0; dev++) {
if (port[dev] == SNDRV_AUTO_PORT)
......@@ -386,7 +386,10 @@ static int __init alsa_card_gusmax_init(void)
if (snd_gusmax_probe(dev) >= 0)
cards++;
}
cards += snd_legacy_auto_probe(possible_ports, snd_gusmax_legacy_auto_probe);
i = snd_legacy_auto_probe(possible_ports, snd_gusmax_legacy_auto_probe);
if (i > 0)
cards += i;
if (!cards) {
#ifdef MODULE
printk(KERN_ERR "GUS MAX soundcard not found or device busy\n");
......
......@@ -929,7 +929,7 @@ static struct pnp_card_driver interwave_pnpc_driver = {
static int __init alsa_card_interwave_init(void)
{
int cards = 0;
int cards = 0, i;
static long possible_ports[] = {0x210, 0x220, 0x230, 0x240, 0x250, 0x260, -1};
int dev;
......@@ -949,10 +949,14 @@ static int __init alsa_card_interwave_init(void)
#endif
}
/* legacy auto configured cards */
cards += snd_legacy_auto_probe(possible_ports, snd_interwave_probe_legacy_port);
i = snd_legacy_auto_probe(possible_ports, snd_interwave_probe_legacy_port);
if (i > 0)
cards += i;
#ifdef CONFIG_PNP
/* ISA PnP cards */
cards += pnp_register_card_driver(&interwave_pnpc_driver);
/* ISA PnP cards */
i = pnp_register_card_driver(&interwave_pnpc_driver);
if (i > 0)
cards += i;
#endif
if (!cards) {
......
......@@ -203,8 +203,8 @@ static int __devinit snd_es968_pnp_detect(struct pnp_card_link *card,
return res;
dev++;
return 0;
}
return -ENODEV;
}
return -ENODEV;
}
static void __devexit snd_es968_pnp_remove(struct pnp_card_link * pcard)
......@@ -225,15 +225,14 @@ static struct pnp_card_driver es968_pnpc_driver = {
static int __init alsa_card_es968_init(void)
{
int res = pnp_register_card_driver(&es968_pnpc_driver);
if (res == 0)
{
pnp_unregister_card_driver(&es968_pnpc_driver);
int cards = pnp_register_card_driver(&es968_pnpc_driver);
#ifdef MODULE
if (cards == 0) {
pnp_unregister_card_driver(&es968_pnpc_driver);
snd_printk(KERN_ERR "no ES968 based soundcards found\n");
#endif
}
return res < 0 ? res : 0;
#endif
return cards ? 0 : -ENODEV;
}
static void __exit alsa_card_es968_exit(void)
......
......@@ -629,7 +629,7 @@ static struct pnp_card_driver sb16_pnpc_driver = {
static int __init alsa_card_sb16_init(void)
{
int dev, cards = 0;
int dev, cards = 0, i;
static unsigned long possible_ports[] = {0x220, 0x240, 0x260, 0x280, -1};
/* legacy non-auto cards at first */
......@@ -649,10 +649,15 @@ static int __init alsa_card_sb16_init(void)
#endif
}
/* legacy auto configured cards */
cards += snd_legacy_auto_probe(possible_ports, snd_sb16_probe_legacy_port);
i = snd_legacy_auto_probe(possible_ports, snd_sb16_probe_legacy_port);
if (i > 0)
cards += i;
#ifdef CONFIG_PNP
/* PnP cards at last */
cards += pnp_register_card_driver(&sb16_pnpc_driver);
i = pnp_register_card_driver(&sb16_pnpc_driver);
if (i >0)
cards += i;
#endif
if (!cards) {
......
......@@ -199,7 +199,7 @@ static int __init snd_card_sb8_legacy_auto_probe(unsigned long xport)
static int __init alsa_card_sb8_init(void)
{
static unsigned long possible_ports[] = {0x220, 0x240, 0x260, -1};
int dev, cards;
int dev, cards, i;
for (dev = cards = 0; dev < SNDRV_CARDS && enable[dev]; dev++) {
if (port[dev] == SNDRV_AUTO_PORT)
......@@ -207,7 +207,10 @@ static int __init alsa_card_sb8_init(void)
if (snd_sb8_probe(dev) >= 0)
cards++;
}
cards += snd_legacy_auto_probe(possible_ports, snd_card_sb8_legacy_auto_probe);
i = snd_legacy_auto_probe(possible_ports, snd_card_sb8_legacy_auto_probe);
if (i > 0)
cards += i;
if (!cards) {
#ifdef MODULE
snd_printk(KERN_ERR "Sound Blaster soundcard not found or device busy\n");
......
......@@ -426,7 +426,7 @@ start_voice(snd_emux_voice_t *vp)
snd_emu10k1_ptr_write(hw, CDF, ch, sample);
/* invalidate maps */
temp = ((unsigned int)hw->silent_page_dmaaddr << 1) | MAP_PTI_MASK;
temp = ((unsigned int)hw->silent_page.addr << 1) | MAP_PTI_MASK;
snd_emu10k1_ptr_write(hw, MAPA, ch, temp);
snd_emu10k1_ptr_write(hw, MAPB, ch, temp);
......
......@@ -62,7 +62,7 @@ static inline void set_silent_ptb(emu10k1_t *emu, int page)
page *= UNIT_PAGES;
for (i = 0; i < UNIT_PAGES; i++, page++)
/* do not increment ptr */
__set_ptb_entry(emu, page, emu->silent_page_dmaaddr);
__set_ptb_entry(emu, page, emu->silent_page.addr);
}
#endif /* PAGE_SIZE */
......
......@@ -76,8 +76,8 @@ static inline void set_tlb_bus(trident_t *trident, int page, unsigned long ptr,
static inline void set_silent_tlb(trident_t *trident, int page)
{
page <<= 1;
__set_tlb_bus(trident, page, (unsigned long)trident->tlb.silent_page, trident->tlb.silent_page_dmaaddr);
__set_tlb_bus(trident, page+1, (unsigned long)trident->tlb.silent_page, trident->tlb.silent_page_dmaaddr);
__set_tlb_bus(trident, page, (unsigned long)trident->tlb.silent_page.area, trident->tlb.silent_page.addr);
__set_tlb_bus(trident, page+1, (unsigned long)trident->tlb.silent_page.area, trident->tlb.silent_page.addr);
}
#else
......@@ -111,7 +111,7 @@ static inline void set_silent_tlb(trident_t *trident, int page)
int i;
page *= UNIT_PAGES;
for (i = 0; i < UNIT_PAGES; i++, page++)
__set_tlb_bus(trident, page, (unsigned long)trident->tlb.silent_page, trident->tlb.silent_page_dmaaddr);
__set_tlb_bus(trident, page, (unsigned long)trident->tlb.silent_page.area, trident->tlb.silent_page.addr);
}
#endif /* PAGE_SIZE */
......
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