X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=sound%2Fpci%2Fhda%2Fhda_intel.c;h=4be36c84b36c7c8354a707d9956430602de45e73;hb=c523aef0f7284970463ebd77a54bca9069711d4a;hp=fe07bdff60d015064463dc020573e384446c3143;hpb=52987656fb3d43192639a7d585feb564c075c864;p=linux-2.6-omap-h63xx.git diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index fe07bdff60d..4be36c84b36 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -96,6 +96,8 @@ MODULE_SUPPORTED_DEVICE("{{Intel, ICH6}," "{Intel, ESB2}," "{Intel, ICH8}," "{Intel, ICH9}," + "{Intel, ICH10}," + "{Intel, SCH}," "{ATI, SB450}," "{ATI, SB600}," "{ATI, RS600}," @@ -273,6 +275,11 @@ enum { #define NVIDIA_HDA_TRANSREG_ADDR 0x4e #define NVIDIA_HDA_ENABLE_COHBITS 0x0f +/* Defines for Intel SCH HDA snoop control */ +#define INTEL_SCH_HDA_DEVC 0x78 +#define INTEL_SCH_HDA_DEVC_NOSNOOP (0x1<<11) + + /* */ @@ -374,6 +381,7 @@ struct azx { /* driver types */ enum { AZX_DRIVER_ICH, + AZX_DRIVER_SCH, AZX_DRIVER_ATI, AZX_DRIVER_ATIHDMI, AZX_DRIVER_VIA, @@ -384,6 +392,7 @@ enum { static char *driver_short_names[] __devinitdata = { [AZX_DRIVER_ICH] = "HDA Intel", + [AZX_DRIVER_SCH] = "HDA Intel MID", [AZX_DRIVER_ATI] = "HDA ATI SB", [AZX_DRIVER_ATIHDMI] = "HDA ATI HDMI", [AZX_DRIVER_VIA] = "HDA VIA VT82xx", @@ -551,7 +560,7 @@ static unsigned int azx_rirb_get_response(struct hda_codec *codec) again: timeout = jiffies + msecs_to_jiffies(1000); - do { + for (;;) { if (chip->polling_mode) { spin_lock_irq(&chip->reg_lock); azx_update_rirb(chip); @@ -559,13 +568,15 @@ static unsigned int azx_rirb_get_response(struct hda_codec *codec) } if (!chip->rirb.cmds) return chip->rirb.res; /* the last value */ + if (time_after(jiffies, timeout)) + break; if (codec->bus->needs_damn_long_delay) msleep(2); /* temporary workaround */ else { udelay(10); cond_resched(); } - } while (time_after_eq(timeout, jiffies)); + } if (chip->msi) { snd_printk(KERN_WARNING "hda_intel: No response from codec, " @@ -627,8 +638,9 @@ static int azx_single_send_cmd(struct hda_codec *codec, u32 val) } udelay(1); } - snd_printd(SFX "send_cmd timeout: IRS=0x%x, val=0x%x\n", - azx_readw(chip, IRS), val); + if (printk_ratelimit()) + snd_printd(SFX "send_cmd timeout: IRS=0x%x, val=0x%x\n", + azx_readw(chip, IRS), val); return -EIO; } @@ -644,8 +656,9 @@ static unsigned int azx_single_get_response(struct hda_codec *codec) return azx_readl(chip, IR); udelay(1); } - snd_printd(SFX "get_response timeout: IRS=0x%x\n", - azx_readw(chip, IRS)); + if (printk_ratelimit()) + snd_printd(SFX "get_response timeout: IRS=0x%x\n", + azx_readw(chip, IRS)); return (unsigned int)-1; } @@ -860,6 +873,8 @@ static void update_pci_byte(struct pci_dev *pci, unsigned int reg, static void azx_init_pci(struct azx *chip) { + unsigned short snoop; + /* Clear bits 0-2 of PCI register TCSEL (at offset 0x44) * TCSEL == Traffic Class Select Register, which sets PCI express QOS * Ensuring these bits are 0 clears playback static on some HD Audio @@ -880,6 +895,19 @@ static void azx_init_pci(struct azx *chip) NVIDIA_HDA_TRANSREG_ADDR, 0x0f, NVIDIA_HDA_ENABLE_COHBITS); break; + case AZX_DRIVER_SCH: + pci_read_config_word(chip->pci, INTEL_SCH_HDA_DEVC, &snoop); + if (snoop & INTEL_SCH_HDA_DEVC_NOSNOOP) { + pci_write_config_word(chip->pci, INTEL_SCH_HDA_DEVC, \ + snoop & (~INTEL_SCH_HDA_DEVC_NOSNOOP)); + pci_read_config_word(chip->pci, + INTEL_SCH_HDA_DEVC, &snoop); + snd_printdd("HDA snoop disabled, enabling ... %s\n",\ + (snoop & INTEL_SCH_HDA_DEVC_NOSNOOP) \ + ? "Failed" : "OK"); + } + break; + } } @@ -1032,6 +1060,7 @@ static int azx_setup_controller(struct azx *chip, struct azx_dev *azx_dev) static unsigned int azx_max_codecs[] __devinitdata = { [AZX_DRIVER_ICH] = 3, + [AZX_DRIVER_SCH] = 3, [AZX_DRIVER_ATI] = 4, [AZX_DRIVER_ATIHDMI] = 4, [AZX_DRIVER_VIA] = 3, /* FIXME: correct? */ @@ -1789,7 +1818,7 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci, */ chip->playback_streams = (gcap & (0xF << 12)) >> 12; chip->capture_streams = (gcap & (0xF << 8)) >> 8; - chip->playback_index_offset = (gcap & (0xF << 12)) >> 12; + chip->playback_index_offset = chip->capture_streams; chip->capture_index_offset = 0; } else { /* gcap didn't give any info, switching to old method */ @@ -1971,6 +2000,9 @@ static struct pci_device_id azx_ids[] = { { 0x8086, 0x284b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH8 */ { 0x8086, 0x293e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH9 */ { 0x8086, 0x293f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH9 */ + { 0x8086, 0x3a3e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH10 */ + { 0x8086, 0x3a6e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH10 */ + { 0x8086, 0x811b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_SCH }, /* SCH*/ { 0x1002, 0x437b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATI }, /* ATI SB450 */ { 0x1002, 0x4383, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATI }, /* ATI SB600 */ { 0x1002, 0x793b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATIHDMI }, /* ATI RS600 HDMI */