Commit e0474e53 authored by James Courtier-Dutton's avatar James Courtier-Dutton Committed by Jaroslav Kysela

[ALSA] snd-emu10k1: Card capabilities tidy up.

EMU10K1/EMU10K2 driver
Signed-off-by: default avatarJames Courtier-Dutton <James@superbug.co.uk>
parent 7bc71ecd
...@@ -140,7 +140,7 @@ static int __devinit snd_card_emu10k1_probe(struct pci_dev *pci, ...@@ -140,7 +140,7 @@ static int __devinit snd_card_emu10k1_probe(struct pci_dev *pci,
return err; return err;
} }
/* This stores the periods table. */ /* This stores the periods table. */
if (emu->audigy && emu->revision == 4) { /* P16V */ if (emu->card_capabilities->ca0151_chip) { /* P16V */
if(snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci), 1024, &emu->p16v_buffer) < 0) { if(snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci), 1024, &emu->p16v_buffer) < 0) {
snd_p16v_free(emu); snd_p16v_free(emu);
return -ENOMEM; return -ENOMEM;
...@@ -161,7 +161,7 @@ static int __devinit snd_card_emu10k1_probe(struct pci_dev *pci, ...@@ -161,7 +161,7 @@ static int __devinit snd_card_emu10k1_probe(struct pci_dev *pci,
snd_card_free(card); snd_card_free(card);
return err; return err;
} }
if (emu->audigy && emu->revision == 4) { /* P16V */ if (emu->card_capabilities->ca0151_chip) { /* P16V */
if ((err = snd_p16v_pcm(emu, 4, NULL)) < 0) { if ((err = snd_p16v_pcm(emu, 4, NULL)) < 0) {
snd_card_free(card); snd_card_free(card);
return err; return err;
......
...@@ -191,7 +191,7 @@ static int __devinit snd_emu10k1_init(emu10k1_t * emu, int enable_ir) ...@@ -191,7 +191,7 @@ static int __devinit snd_emu10k1_init(emu10k1_t * emu, int enable_ir)
/* Set playback routing. */ /* Set playback routing. */
snd_emu10k1_ptr20_write(emu, CAPTURE_P16V_SOURCE, 0, 0x78e4); snd_emu10k1_ptr20_write(emu, CAPTURE_P16V_SOURCE, 0, 0x78e4);
} }
if (emu->audigy && (emu->serial == 0x10011102) ) { /* audigy2 Value */ if (emu->card_capabilities->ca0108_chip) { /* audigy2 Value */
/* Hacks for Alice3 to work independent of haP16V driver */ /* Hacks for Alice3 to work independent of haP16V driver */
u32 tmp; u32 tmp;
...@@ -253,6 +253,8 @@ static int __devinit snd_emu10k1_init(emu10k1_t * emu, int enable_ir) ...@@ -253,6 +253,8 @@ static int __devinit snd_emu10k1_init(emu10k1_t * emu, int enable_ir)
HCFG_AUTOMUTE | HCFG_JOYENABLE, emu->port + HCFG); HCFG_AUTOMUTE | HCFG_JOYENABLE, emu->port + HCFG);
else else
outl(HCFG_AUTOMUTE | HCFG_JOYENABLE, emu->port + HCFG); outl(HCFG_AUTOMUTE | HCFG_JOYENABLE, emu->port + HCFG);
/* FIXME: Remove all these emu->model and replace it with a card recognition parameter,
* e.g. card_capabilities->joystick */
} else if (emu->model == 0x20 || } else if (emu->model == 0x20 ||
emu->model == 0xc400 || emu->model == 0xc400 ||
(emu->model == 0x21 && emu->revision < 6)) (emu->model == 0x21 && emu->revision < 6))
...@@ -299,12 +301,12 @@ static int __devinit snd_emu10k1_init(emu10k1_t * emu, int enable_ir) ...@@ -299,12 +301,12 @@ static int __devinit snd_emu10k1_init(emu10k1_t * emu, int enable_ir)
if (emu->audigy) { if (emu->audigy) {
outl(inl(emu->port + A_IOCFG) & ~0x44, emu->port + A_IOCFG); outl(inl(emu->port + A_IOCFG) & ~0x44, emu->port + A_IOCFG);
if (emu->revision == 4) { /* audigy2 */ if (emu->card_capabilities->ca0151_chip) { /* audigy2 */
/* Unmute Analog now. Set GPO6 to 1 for Apollo. /* Unmute Analog now. Set GPO6 to 1 for Apollo.
* This has to be done after init ALice3 I2SOut beyond 48KHz. * This has to be done after init ALice3 I2SOut beyond 48KHz.
* So, sequence is important. */ * So, sequence is important. */
outl(inl(emu->port + A_IOCFG) | 0x0040, emu->port + A_IOCFG); outl(inl(emu->port + A_IOCFG) | 0x0040, emu->port + A_IOCFG);
} else if (emu->serial == 0x10011102) { /* audigy2 value */ } else if (emu->card_capabilities->ca0108_chip) { /* audigy2 value */
/* Unmute Analog now. */ /* Unmute Analog now. */
outl(inl(emu->port + A_IOCFG) | 0x0060, emu->port + A_IOCFG); outl(inl(emu->port + A_IOCFG) | 0x0060, emu->port + A_IOCFG);
} else { } else {
......
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