aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-10-21 03:03:25 -0400
committerTakashi Iwai <tiwai@suse.de>2010-10-21 03:03:25 -0400
commit14d34f166c57e77e3d7f9bc8b43d349186d922c1 (patch)
tree18688ebb3622102a0af999336627abb5b72e1b14
parent24b55c69b66eb2a122842820ec14ab215fc8572f (diff)
ALSA: hda - Add some workarounds for Creative IBG
Creative HD-audio controller chips require some workarounds: - Additional delay before RIRB response - Set the initial RIRB counter to 0xc0 The latter seems to be done in general in Windows driver, so we may use this value later for all types if it's confirmed to work better. Reported-by: Wai Yew CHAY <wychay@ctl.creative.com> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/hda/hda_intel.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 5cbea85a6453..ee445bc6e810 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -458,6 +458,7 @@ enum {
458 AZX_DRIVER_ULI, 458 AZX_DRIVER_ULI,
459 AZX_DRIVER_NVIDIA, 459 AZX_DRIVER_NVIDIA,
460 AZX_DRIVER_TERA, 460 AZX_DRIVER_TERA,
461 AZX_DRIVER_CTX,
461 AZX_DRIVER_GENERIC, 462 AZX_DRIVER_GENERIC,
462 AZX_NUM_DRIVERS, /* keep this as last entry */ 463 AZX_NUM_DRIVERS, /* keep this as last entry */
463}; 464};
@@ -473,6 +474,7 @@ static char *driver_short_names[] __devinitdata = {
473 [AZX_DRIVER_ULI] = "HDA ULI M5461", 474 [AZX_DRIVER_ULI] = "HDA ULI M5461",
474 [AZX_DRIVER_NVIDIA] = "HDA NVidia", 475 [AZX_DRIVER_NVIDIA] = "HDA NVidia",
475 [AZX_DRIVER_TERA] = "HDA Teradici", 476 [AZX_DRIVER_TERA] = "HDA Teradici",
477 [AZX_DRIVER_CTX] = "HDA Creative",
476 [AZX_DRIVER_GENERIC] = "HD-Audio Generic", 478 [AZX_DRIVER_GENERIC] = "HD-Audio Generic",
477}; 479};
478 480
@@ -563,7 +565,10 @@ static void azx_init_cmd_io(struct azx *chip)
563 /* reset the rirb hw write pointer */ 565 /* reset the rirb hw write pointer */
564 azx_writew(chip, RIRBWP, ICH6_RIRBWP_RST); 566 azx_writew(chip, RIRBWP, ICH6_RIRBWP_RST);
565 /* set N=1, get RIRB response interrupt for new entry */ 567 /* set N=1, get RIRB response interrupt for new entry */
566 azx_writew(chip, RINTCNT, 1); 568 if (chip->driver_type == AZX_DRIVER_CTX)
569 azx_writew(chip, RINTCNT, 0xc0);
570 else
571 azx_writew(chip, RINTCNT, 1);
567 /* enable rirb dma and response irq */ 572 /* enable rirb dma and response irq */
568 azx_writeb(chip, RIRBCTL, ICH6_RBCTL_DMA_EN | ICH6_RBCTL_IRQ_EN); 573 azx_writeb(chip, RIRBCTL, ICH6_RBCTL_DMA_EN | ICH6_RBCTL_IRQ_EN);
569 spin_unlock_irq(&chip->reg_lock); 574 spin_unlock_irq(&chip->reg_lock);
@@ -1136,8 +1141,11 @@ static irqreturn_t azx_interrupt(int irq, void *dev_id)
1136 /* clear rirb int */ 1141 /* clear rirb int */
1137 status = azx_readb(chip, RIRBSTS); 1142 status = azx_readb(chip, RIRBSTS);
1138 if (status & RIRB_INT_MASK) { 1143 if (status & RIRB_INT_MASK) {
1139 if (status & RIRB_INT_RESPONSE) 1144 if (status & RIRB_INT_RESPONSE) {
1145 if (chip->driver_type == AZX_DRIVER_CTX)
1146 udelay(80);
1140 azx_update_rirb(chip); 1147 azx_update_rirb(chip);
1148 }
1141 azx_writeb(chip, RIRBSTS, RIRB_INT_MASK); 1149 azx_writeb(chip, RIRBSTS, RIRB_INT_MASK);
1142 } 1150 }
1143 1151
@@ -2784,10 +2792,10 @@ static DEFINE_PCI_DEVICE_TABLE(azx_ids) = {
2784 { PCI_DEVICE(PCI_VENDOR_ID_CREATIVE, PCI_ANY_ID), 2792 { PCI_DEVICE(PCI_VENDOR_ID_CREATIVE, PCI_ANY_ID),
2785 .class = PCI_CLASS_MULTIMEDIA_HD_AUDIO << 8, 2793 .class = PCI_CLASS_MULTIMEDIA_HD_AUDIO << 8,
2786 .class_mask = 0xffffff, 2794 .class_mask = 0xffffff,
2787 .driver_data = AZX_DRIVER_GENERIC }, 2795 .driver_data = AZX_DRIVER_CTX },
2788#else 2796#else
2789 /* this entry seems still valid -- i.e. without emu20kx chip */ 2797 /* this entry seems still valid -- i.e. without emu20kx chip */
2790 { PCI_DEVICE(0x1102, 0x0009), .driver_data = AZX_DRIVER_GENERIC }, 2798 { PCI_DEVICE(0x1102, 0x0009), .driver_data = AZX_DRIVER_CTX },
2791#endif 2799#endif
2792 /* Vortex86MX */ 2800 /* Vortex86MX */
2793 { PCI_DEVICE(0x17f3, 0x3010), .driver_data = AZX_DRIVER_GENERIC }, 2801 { PCI_DEVICE(0x17f3, 0x3010), .driver_data = AZX_DRIVER_GENERIC },