]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ALSA: hda - Workaround for buggy DMA position on ATI controllers
authorTakashi Iwai <tiwai@suse.de>
Tue, 17 Mar 2009 06:49:14 +0000 (07:49 +0100)
committerTakashi Iwai <tiwai@suse.de>
Wed, 18 Mar 2009 06:46:21 +0000 (07:46 +0100)
The position-buffer on ATI controllers are unreliable as well as
on VIA chips, thus the same workaround for DMA position reading as
VIA is useful for ATI.

Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_intel.c

index 643f0e49929280a1d3f405a078e105f09ebc7f1b..f3b5723c285953201abe089d2830c48facda7613 100644 (file)
@@ -2059,26 +2059,31 @@ static int __devinit check_position_fix(struct azx *chip, int fix)
 {
        const struct snd_pci_quirk *q;
 
-       /* Check VIA HD Audio Controller exist */
-       if (chip->pci->vendor == PCI_VENDOR_ID_VIA &&
-           chip->pci->device == VIA_HDAC_DEVICE_ID) {
+       switch (fix) {
+       case POS_FIX_LPIB:
+       case POS_FIX_POSBUF:
+               return fix;
+       }
+
+       /* Check VIA/ATI HD Audio Controller exist */
+       switch (chip->driver_type) {
+       case AZX_DRIVER_VIA:
+       case AZX_DRIVER_ATI:
                chip->via_dmapos_patch = 1;
                /* Use link position directly, avoid any transfer problem. */
                return POS_FIX_LPIB;
        }
        chip->via_dmapos_patch = 0;
 
-       if (fix == POS_FIX_AUTO) {
-               q = snd_pci_quirk_lookup(chip->pci, position_fix_list);
-               if (q) {
-                       printk(KERN_INFO
-                                   "hda_intel: position_fix set to %d "
-                                   "for device %04x:%04x\n",
-                                   q->value, q->subvendor, q->subdevice);
-                       return q->value;
-               }
+       q = snd_pci_quirk_lookup(chip->pci, position_fix_list);
+       if (q) {
+               printk(KERN_INFO
+                      "hda_intel: position_fix set to %d "
+                      "for device %04x:%04x\n",
+                      q->value, q->subvendor, q->subdevice);
+               return q->value;
        }
-       return fix;
+       return POS_FIX_AUTO;
 }
 
 /*