ALSA: hda - Fix DMA mask for ATI controllers
[pandora-kernel.git] / sound / pci / hda / hda_intel.c
index 11e791b..643f0e4 100644 (file)
@@ -1947,16 +1947,13 @@ static int azx_suspend(struct pci_dev *pci, pm_message_t state)
        return 0;
 }
 
-static int azx_resume_early(struct pci_dev *pci)
-{
-       return pci_restore_state(pci);
-}
-
 static int azx_resume(struct pci_dev *pci)
 {
        struct snd_card *card = pci_get_drvdata(pci);
        struct azx *chip = card->private_data;
 
+       pci_set_power_state(pci, PCI_D0);
+       pci_restore_state(pci);
        if (pci_enable_device(pci) < 0) {
                printk(KERN_ERR "hda-intel: pci_enable_device failed, "
                       "disabling device\n");
@@ -2098,6 +2095,8 @@ static struct snd_pci_quirk probe_mask_list[] __devinitdata = {
        SND_PCI_QUIRK(0x1028, 0x20ac, "Dell Studio Desktop", 0x01),
        /* including bogus ALC268 in slot#2 that conflicts with ALC888 */
        SND_PCI_QUIRK(0x17c0, 0x4085, "Medion MD96630", 0x01),
+       /* conflict of ALC268 in slot#3 (digital I/O); a temporary fix */
+       SND_PCI_QUIRK(0x1179, 0xff00, "Toshiba laptop", 0x03),
        {}
 };
 
@@ -2211,9 +2210,17 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci,
        gcap = azx_readw(chip, GCAP);
        snd_printdd("chipset global capabilities = 0x%x\n", gcap);
 
+       /* ATI chips seems buggy about 64bit DMA addresses */
+       if (chip->driver_type == AZX_DRIVER_ATI)
+               gcap &= ~0x01;
+
        /* allow 64bit DMA address if supported by H/W */
        if ((gcap & 0x01) && !pci_set_dma_mask(pci, DMA_64BIT_MASK))
                pci_set_consistent_dma_mask(pci, DMA_64BIT_MASK);
+       else {
+               pci_set_dma_mask(pci, DMA_32BIT_MASK);
+               pci_set_consistent_dma_mask(pci, DMA_32BIT_MASK);
+       }
 
        /* read number of streams from GCAP register instead of using
         * hardcoded value
@@ -2468,7 +2475,6 @@ static struct pci_driver driver = {
        .remove = __devexit_p(azx_remove),
 #ifdef CONFIG_PM
        .suspend = azx_suspend,
-       .resume_early = azx_resume_early,
        .resume = azx_resume,
 #endif
 };