aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/atiixp.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/atiixp.c')
-rw-r--r--sound/pci/atiixp.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c
index 476c3433073e..7d8053b5e8d5 100644
--- a/sound/pci/atiixp.c
+++ b/sound/pci/atiixp.c
@@ -45,6 +45,7 @@ static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
45static int ac97_clock = 48000; 45static int ac97_clock = 48000;
46static char *ac97_quirk; 46static char *ac97_quirk;
47static int spdif_aclink = 1; 47static int spdif_aclink = 1;
48static int ac97_codec = -1;
48 49
49module_param(index, int, 0444); 50module_param(index, int, 0444);
50MODULE_PARM_DESC(index, "Index value for ATI IXP controller."); 51MODULE_PARM_DESC(index, "Index value for ATI IXP controller.");
@@ -54,6 +55,8 @@ module_param(ac97_clock, int, 0444);
54MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (default 48000Hz)."); 55MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (default 48000Hz).");
55module_param(ac97_quirk, charp, 0444); 56module_param(ac97_quirk, charp, 0444);
56MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware."); 57MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware.");
58module_param(ac97_codec, int, 0444);
59MODULE_PARM_DESC(ac97_codec, "Specify codec instead of probing.");
57module_param(spdif_aclink, bool, 0444); 60module_param(spdif_aclink, bool, 0444);
58MODULE_PARM_DESC(spdif_aclink, "S/PDIF over AC-link."); 61MODULE_PARM_DESC(spdif_aclink, "S/PDIF over AC-link.");
59 62
@@ -293,6 +296,10 @@ static struct pci_device_id snd_atiixp_ids[] = {
293 296
294MODULE_DEVICE_TABLE(pci, snd_atiixp_ids); 297MODULE_DEVICE_TABLE(pci, snd_atiixp_ids);
295 298
299static struct snd_pci_quirk atiixp_quirks[] __devinitdata = {
300 SND_PCI_QUIRK(0x15bd, 0x3100, "DFI RS482", 0),
301 { } /* terminator */
302};
296 303
297/* 304/*
298 * lowlevel functions 305 * lowlevel functions
@@ -553,11 +560,33 @@ static int snd_atiixp_aclink_down(struct atiixp *chip)
553 ATI_REG_ISR_CODEC2_NOT_READY) 560 ATI_REG_ISR_CODEC2_NOT_READY)
554#define CODEC_CHECK_BITS (ALL_CODEC_NOT_READY|ATI_REG_ISR_NEW_FRAME) 561#define CODEC_CHECK_BITS (ALL_CODEC_NOT_READY|ATI_REG_ISR_NEW_FRAME)
555 562
563static int ac97_probing_bugs(struct pci_dev *pci)
564{
565 const struct snd_pci_quirk *q;
566
567 q = snd_pci_quirk_lookup(pci, atiixp_quirks);
568 if (q) {
569 snd_printdd(KERN_INFO "Atiixp quirk for %s. "
570 "Forcing codec %d\n", q->name, q->value);
571 return q->value;
572 }
573 /* this hardware doesn't need workarounds. Probe for codec */
574 return -1;
575}
576
556static int snd_atiixp_codec_detect(struct atiixp *chip) 577static int snd_atiixp_codec_detect(struct atiixp *chip)
557{ 578{
558 int timeout; 579 int timeout;
559 580
560 chip->codec_not_ready_bits = 0; 581 chip->codec_not_ready_bits = 0;
582 if (ac97_codec == -1)
583 ac97_codec = ac97_probing_bugs(chip->pci);
584 if (ac97_codec >= 0) {
585 chip->codec_not_ready_bits |=
586 CODEC_CHECK_BITS ^ (1 << (ac97_codec + 10));
587 return 0;
588 }
589
561 atiixp_write(chip, IER, CODEC_CHECK_BITS); 590 atiixp_write(chip, IER, CODEC_CHECK_BITS);
562 /* wait for the interrupts */ 591 /* wait for the interrupts */
563 timeout = 50; 592 timeout = 50;
@@ -1396,7 +1425,7 @@ static int __devinit snd_atiixp_mixer_new(struct atiixp *chip, int clock,
1396 ac97.private_data = chip; 1425 ac97.private_data = chip;
1397 ac97.pci = chip->pci; 1426 ac97.pci = chip->pci;
1398 ac97.num = i; 1427 ac97.num = i;
1399 ac97.scaps = AC97_SCAP_SKIP_MODEM; 1428 ac97.scaps = AC97_SCAP_SKIP_MODEM | AC97_SCAP_POWER_SAVE;
1400 if (! chip->spdif_over_aclink) 1429 if (! chip->spdif_over_aclink)
1401 ac97.scaps |= AC97_SCAP_NO_SPDIF; 1430 ac97.scaps |= AC97_SCAP_NO_SPDIF;
1402 if ((err = snd_ac97_mixer(pbus, &ac97, &chip->ac97[i])) < 0) { 1431 if ((err = snd_ac97_mixer(pbus, &ac97, &chip->ac97[i])) < 0) {