]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'fix/hda' into topic/hda
authorTakashi Iwai <tiwai@suse.de>
Wed, 18 Mar 2009 06:50:56 +0000 (07:50 +0100)
committerTakashi Iwai <tiwai@suse.de>
Wed, 18 Mar 2009 06:50:56 +0000 (07:50 +0100)
1  2 
sound/pci/hda/hda_intel.c

index 47a5833feb7ade9e61f096d8971cde75ea56255a,f3b5723c285953201abe089d2830c48facda7613..6bcf5af6edcef34806770c7f41430195fe91d58d
@@@ -381,7 -381,6 +381,7 @@@ struct azx 
  
        /* HD codec */
        unsigned short codec_mask;
 +      int  codec_probe_mask; /* copied from probe_mask option */
        struct hda_bus *bus;
  
        /* CORB/RIRB */
@@@ -1229,6 -1228,7 +1229,6 @@@ static unsigned int azx_max_codecs[AZX_
  };
  
  static int __devinit azx_codec_create(struct azx *chip, const char *model,
 -                                    unsigned int codec_probe_mask,
                                      int no_init)
  {
        struct hda_bus_template bus_temp;
  
        /* First try to probe all given codec slots */
        for (c = 0; c < max_slots; c++) {
 -              if ((chip->codec_mask & (1 << c)) & codec_probe_mask) {
 +              if ((chip->codec_mask & (1 << c)) & chip->codec_probe_mask) {
                        if (probe_codec(chip, c) < 0) {
                                /* Some BIOSen give you wrong codec addresses
                                 * that don't exist
  
        /* Then create codec instances */
        for (c = 0; c < max_slots; c++) {
 -              if ((chip->codec_mask & (1 << c)) & codec_probe_mask) {
 +              if ((chip->codec_mask & (1 << c)) & chip->codec_probe_mask) {
                        struct hda_codec *codec;
                        err = snd_hda_codec_new(chip->bus, c, !no_init, &codec);
                        if (err < 0)
@@@ -2059,26 -2059,31 +2059,31 @@@ static int __devinit check_position_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;
  }
  
  /*
@@@ -2095,36 -2100,25 +2100,36 @@@ static struct snd_pci_quirk probe_mask_
        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),
 +      /* forced codec slots */
 +      SND_PCI_QUIRK(0x1046, 0x1262, "ASUS W5F", 0x103),
        {}
  };
  
 +#define AZX_FORCE_CODEC_MASK  0x100
 +
  static void __devinit check_probe_mask(struct azx *chip, int dev)
  {
        const struct snd_pci_quirk *q;
  
 -      if (probe_mask[dev] == -1) {
 +      chip->codec_probe_mask = probe_mask[dev];
 +      if (chip->codec_probe_mask == -1) {
                q = snd_pci_quirk_lookup(chip->pci, probe_mask_list);
                if (q) {
                        printk(KERN_INFO
                               "hda_intel: probe_mask set to 0x%x "
                               "for device %04x:%04x\n",
                               q->value, q->subvendor, q->subdevice);
 -                      probe_mask[dev] = q->value;
 +                      chip->codec_probe_mask = q->value;
                }
        }
 +
 +      /* check forced option */
 +      if (chip->codec_probe_mask != -1 &&
 +          (chip->codec_probe_mask & AZX_FORCE_CODEC_MASK)) {
 +              chip->codec_mask = chip->codec_probe_mask & 0xff;
 +              printk(KERN_INFO "hda_intel: codec_mask forced to 0x%x\n",
 +                     chip->codec_mask);
 +      }
  }
  
  
@@@ -2221,9 -2215,17 +2226,17 @@@ static int __devinit azx_create(struct 
        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
@@@ -2357,7 -2359,8 +2370,7 @@@ static int __devinit azx_probe(struct p
        card->private_data = chip;
  
        /* create codec instances */
 -      err = azx_codec_create(chip, model[dev], probe_mask[dev],
 -                             probe_only[dev]);
 +      err = azx_codec_create(chip, model[dev], probe_only[dev]);
        if (err < 0)
                goto out_free;
  
@@@ -2454,10 -2457,10 +2467,10 @@@ static struct pci_device_id azx_ids[] 
        { PCI_DEVICE(0x10de, 0x0ac1), .driver_data = AZX_DRIVER_NVIDIA },
        { PCI_DEVICE(0x10de, 0x0ac2), .driver_data = AZX_DRIVER_NVIDIA },
        { PCI_DEVICE(0x10de, 0x0ac3), .driver_data = AZX_DRIVER_NVIDIA },
 -      { PCI_DEVICE(0x10de, 0x0bd4), .driver_data = AZX_DRIVER_NVIDIA },
 -      { PCI_DEVICE(0x10de, 0x0bd5), .driver_data = AZX_DRIVER_NVIDIA },
 -      { PCI_DEVICE(0x10de, 0x0bd6), .driver_data = AZX_DRIVER_NVIDIA },
 -      { PCI_DEVICE(0x10de, 0x0bd7), .driver_data = AZX_DRIVER_NVIDIA },
 +      { PCI_DEVICE(0x10de, 0x0d94), .driver_data = AZX_DRIVER_NVIDIA },
 +      { PCI_DEVICE(0x10de, 0x0d95), .driver_data = AZX_DRIVER_NVIDIA },
 +      { PCI_DEVICE(0x10de, 0x0d96), .driver_data = AZX_DRIVER_NVIDIA },
 +      { PCI_DEVICE(0x10de, 0x0d97), .driver_data = AZX_DRIVER_NVIDIA },
        /* Teradici */
        { PCI_DEVICE(0x6549, 0x1200), .driver_data = AZX_DRIVER_TERA },
        /* AMD Generic, PCI class code and Vendor ID for HD Audio */