aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-02-22 12:36:22 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-22 17:20:08 -0500
commit90a5ad52bf2ce54aa7153735dc4488f00c050e54 (patch)
treebbb7ae0ce83e538382ff2bba4e6ad5d6ff5d7357 /sound
parent92eed66d5e612216369b27330ac43f6f094d0130 (diff)
[ALSA] HDA - enable snoop on SCH
This patch enables snoop on Intel SCH chipset, eliminating static during playback. Signed-off-by: Tobin Davis <tdavis@dsl-only.net> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/hda_intel.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 56f8a3050751..a1098bb875de 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -275,6 +275,11 @@ enum {
275#define NVIDIA_HDA_TRANSREG_ADDR 0x4e 275#define NVIDIA_HDA_TRANSREG_ADDR 0x4e
276#define NVIDIA_HDA_ENABLE_COHBITS 0x0f 276#define NVIDIA_HDA_ENABLE_COHBITS 0x0f
277 277
278/* Defines for Intel SCH HDA snoop control */
279#define INTEL_SCH_HDA_DEVC 0x78
280#define INTEL_SCH_HDA_DEVC_NOSNOOP (0x1<<11)
281
282
278/* 283/*
279 */ 284 */
280 285
@@ -868,6 +873,8 @@ static void update_pci_byte(struct pci_dev *pci, unsigned int reg,
868 873
869static void azx_init_pci(struct azx *chip) 874static void azx_init_pci(struct azx *chip)
870{ 875{
876 unsigned short snoop;
877
871 /* Clear bits 0-2 of PCI register TCSEL (at offset 0x44) 878 /* Clear bits 0-2 of PCI register TCSEL (at offset 0x44)
872 * TCSEL == Traffic Class Select Register, which sets PCI express QOS 879 * TCSEL == Traffic Class Select Register, which sets PCI express QOS
873 * Ensuring these bits are 0 clears playback static on some HD Audio 880 * Ensuring these bits are 0 clears playback static on some HD Audio
@@ -888,6 +895,19 @@ static void azx_init_pci(struct azx *chip)
888 NVIDIA_HDA_TRANSREG_ADDR, 895 NVIDIA_HDA_TRANSREG_ADDR,
889 0x0f, NVIDIA_HDA_ENABLE_COHBITS); 896 0x0f, NVIDIA_HDA_ENABLE_COHBITS);
890 break; 897 break;
898 case AZX_DRIVER_SCH:
899 pci_read_config_word(chip->pci, INTEL_SCH_HDA_DEVC, &snoop);
900 if (snoop & INTEL_SCH_HDA_DEVC_NOSNOOP) {
901 pci_write_config_word(chip->pci, INTEL_SCH_HDA_DEVC, \
902 snoop & (~INTEL_SCH_HDA_DEVC_NOSNOOP));
903 pci_read_config_word(chip->pci,
904 INTEL_SCH_HDA_DEVC, &snoop);
905 snd_printdd("HDA snoop disabled, enabling ... %s\n",\
906 (snoop & INTEL_SCH_HDA_DEVC_NOSNOOP) \
907 ? "Failed" : "OK");
908 }
909 break;
910
891 } 911 }
892} 912}
893 913
@@ -1040,6 +1060,7 @@ static int azx_setup_controller(struct azx *chip, struct azx_dev *azx_dev)
1040 1060
1041static unsigned int azx_max_codecs[] __devinitdata = { 1061static unsigned int azx_max_codecs[] __devinitdata = {
1042 [AZX_DRIVER_ICH] = 3, 1062 [AZX_DRIVER_ICH] = 3,
1063 [AZX_DRIVER_SCH] = 3,
1043 [AZX_DRIVER_ATI] = 4, 1064 [AZX_DRIVER_ATI] = 4,
1044 [AZX_DRIVER_ATIHDMI] = 4, 1065 [AZX_DRIVER_ATIHDMI] = 4,
1045 [AZX_DRIVER_VIA] = 3, /* FIXME: correct? */ 1066 [AZX_DRIVER_VIA] = 3, /* FIXME: correct? */