aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_intel.c
diff options
context:
space:
mode:
authorVinod G <vinodg@nvidia.com>2005-09-13 12:49:12 -0400
committerJaroslav Kysela <perex@suse.cz>2005-11-04 07:15:45 -0500
commitda3fca21996414a263d36804d9afb2e701abbfef (patch)
tree3276863010372babbaa1334a10e5fed16e37703c /sound/pci/hda/hda_intel.c
parenteb9b4142b3af98d808012081c4dd6d36e2964d43 (diff)
[ALSA] hda-intel - Add NVidia support
Modules: HDA Intel driver This patch is to make the Intel HDA code work for NVIDIA azalia controller. Modified by Takashi Iwai <tiwai@suse.de> Signed-off-by: Vinod G. <vinodg@nvidia.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_intel.c')
-rw-r--r--sound/pci/hda/hda_intel.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 6fe696e53ea6..2c5d41147718 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -223,6 +223,9 @@ enum {
223#define ATI_SB450_HDAUDIO_MISC_CNTR2_ADDR 0x42 223#define ATI_SB450_HDAUDIO_MISC_CNTR2_ADDR 0x42
224#define ATI_SB450_HDAUDIO_ENABLE_SNOOP 0x02 224#define ATI_SB450_HDAUDIO_ENABLE_SNOOP 0x02
225 225
226/* Defines for Nvidia HDA support */
227#define NVIDIA_HDA_TRANSREG_ADDR 0x4e
228#define NVIDIA_HDA_ENABLE_COHBITS 0x0f
226 229
227/* 230/*
228 * Use CORB/RIRB for communication from/to codecs. 231 * Use CORB/RIRB for communication from/to codecs.
@@ -328,6 +331,7 @@ enum {
328 AZX_DRIVER_VIA, 331 AZX_DRIVER_VIA,
329 AZX_DRIVER_SIS, 332 AZX_DRIVER_SIS,
330 AZX_DRIVER_ULI, 333 AZX_DRIVER_ULI,
334 AZX_DRIVER_NVIDIA,
331}; 335};
332 336
333static char *driver_short_names[] __devinitdata = { 337static char *driver_short_names[] __devinitdata = {
@@ -335,7 +339,8 @@ static char *driver_short_names[] __devinitdata = {
335 [AZX_DRIVER_ATI] = "HDA ATI SB", 339 [AZX_DRIVER_ATI] = "HDA ATI SB",
336 [AZX_DRIVER_VIA] = "HDA VIA VT82xx", 340 [AZX_DRIVER_VIA] = "HDA VIA VT82xx",
337 [AZX_DRIVER_SIS] = "HDA SIS966", 341 [AZX_DRIVER_SIS] = "HDA SIS966",
338 [AZX_DRIVER_ULI] = "HDA ULI M5461" 342 [AZX_DRIVER_ULI] = "HDA ULI M5461",
343 [AZX_DRIVER_NVIDIA] = "HDA NVidia",
339}; 344};
340 345
341/* 346/*
@@ -710,14 +715,14 @@ static void azx_stream_stop(azx_t *chip, azx_dev_t *azx_dev)
710 */ 715 */
711static void azx_init_chip(azx_t *chip) 716static void azx_init_chip(azx_t *chip)
712{ 717{
713 unsigned char tcsel_reg, ati_misc_cntl2; 718 unsigned char reg;
714 719
715 /* Clear bits 0-2 of PCI register TCSEL (at offset 0x44) 720 /* Clear bits 0-2 of PCI register TCSEL (at offset 0x44)
716 * TCSEL == Traffic Class Select Register, which sets PCI express QOS 721 * TCSEL == Traffic Class Select Register, which sets PCI express QOS
717 * Ensuring these bits are 0 clears playback static on some HD Audio codecs 722 * Ensuring these bits are 0 clears playback static on some HD Audio codecs
718 */ 723 */
719 pci_read_config_byte (chip->pci, ICH6_PCIREG_TCSEL, &tcsel_reg); 724 pci_read_config_byte (chip->pci, ICH6_PCIREG_TCSEL, &reg);
720 pci_write_config_byte(chip->pci, ICH6_PCIREG_TCSEL, tcsel_reg & 0xf8); 725 pci_write_config_byte(chip->pci, ICH6_PCIREG_TCSEL, reg & 0xf8);
721 726
722 /* reset controller */ 727 /* reset controller */
723 azx_reset(chip); 728 azx_reset(chip);
@@ -733,13 +738,21 @@ static void azx_init_chip(azx_t *chip)
733 azx_writel(chip, DPLBASE, (u32)chip->posbuf.addr); 738 azx_writel(chip, DPLBASE, (u32)chip->posbuf.addr);
734 azx_writel(chip, DPUBASE, upper_32bit(chip->posbuf.addr)); 739 azx_writel(chip, DPUBASE, upper_32bit(chip->posbuf.addr));
735 740
736 /* For ATI SB450 azalia HD audio, we need to enable snoop */ 741 switch (chip->driver_type) {
737 if (chip->driver_type == AZX_DRIVER_ATI) { 742 case AZX_DRIVER_ATI:
743 /* For ATI SB450 azalia HD audio, we need to enable snoop */
738 pci_read_config_byte(chip->pci, ATI_SB450_HDAUDIO_MISC_CNTR2_ADDR, 744 pci_read_config_byte(chip->pci, ATI_SB450_HDAUDIO_MISC_CNTR2_ADDR,
739 &ati_misc_cntl2); 745 &reg);
740 pci_write_config_byte(chip->pci, ATI_SB450_HDAUDIO_MISC_CNTR2_ADDR, 746 pci_write_config_byte(chip->pci, ATI_SB450_HDAUDIO_MISC_CNTR2_ADDR,
741 (ati_misc_cntl2 & 0xf8) | ATI_SB450_HDAUDIO_ENABLE_SNOOP); 747 (reg & 0xf8) | ATI_SB450_HDAUDIO_ENABLE_SNOOP);
742 } 748 break;
749 case AZX_DRIVER_NVIDIA:
750 /* For NVIDIA HDA, enable snoop */
751 pci_read_config_byte(chip->pci,NVIDIA_HDA_TRANSREG_ADDR, &reg);
752 pci_write_config_byte(chip->pci,NVIDIA_HDA_TRANSREG_ADDR,
753 (reg & 0xf0) | NVIDIA_HDA_ENABLE_COHBITS);
754 break;
755 }
743} 756}
744 757
745 758
@@ -1601,6 +1614,8 @@ static struct pci_device_id azx_ids[] = {
1601 { 0x1106, 0x3288, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_VIA }, /* VIA VT8251/VT8237A */ 1614 { 0x1106, 0x3288, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_VIA }, /* VIA VT8251/VT8237A */
1602 { 0x1039, 0x7502, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_SIS }, /* SIS966 */ 1615 { 0x1039, 0x7502, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_SIS }, /* SIS966 */
1603 { 0x10b9, 0x5461, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ULI }, /* ULI M5461 */ 1616 { 0x10b9, 0x5461, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ULI }, /* ULI M5461 */
1617 { 0x10de, 0x026c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_NVIDIA }, /* NVIDIA 026c */
1618 { 0x10de, 0x0371, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_NVIDIA }, /* NVIDIA 0371 */
1604 { 0, } 1619 { 0, }
1605}; 1620};
1606MODULE_DEVICE_TABLE(pci, azx_ids); 1621MODULE_DEVICE_TABLE(pci, azx_ids);