aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibin Yang <libin.yang@linux.intel.com>2016-01-29 07:39:09 -0500
committerTakashi Iwai <tiwai@suse.de>2016-01-29 08:00:41 -0500
commit6639484ddaf6707b41082c9fa9ca9af342df6402 (patch)
tree833c0a8964f6939c95c14f393439ca9cac7185c2
parent3ec622f40913ae036f218e5e7e92df9c1f1753d9 (diff)
ALSA: hda - disable dynamic clock gating on Broxton before reset
On Broxton, to make sure the reset controller works properly, MISCBDCGE bit (bit 6) in CGCTL (0x48) of PCI configuration space need be cleared before reset and set back to 1 after reset. Otherwise, it may prevent the CORB/RIRB logic from being reset. Signed-off-by: Libin Yang <libin.yang@linux.intel.com> Cc: <stable@vger.kernel.org> # v4.4+ Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/hda/hda_intel.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 256e6cda218f..4045dca3d699 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -90,6 +90,8 @@ enum {
90#define NVIDIA_HDA_ENABLE_COHBIT 0x01 90#define NVIDIA_HDA_ENABLE_COHBIT 0x01
91 91
92/* Defines for Intel SCH HDA snoop control */ 92/* Defines for Intel SCH HDA snoop control */
93#define INTEL_HDA_CGCTL 0x48
94#define INTEL_HDA_CGCTL_MISCBDCGE (0x1 << 6)
93#define INTEL_SCH_HDA_DEVC 0x78 95#define INTEL_SCH_HDA_DEVC 0x78
94#define INTEL_SCH_HDA_DEVC_NOSNOOP (0x1<<11) 96#define INTEL_SCH_HDA_DEVC_NOSNOOP (0x1<<11)
95 97
@@ -534,10 +536,21 @@ static void hda_intel_init_chip(struct azx *chip, bool full_reset)
534{ 536{
535 struct hdac_bus *bus = azx_bus(chip); 537 struct hdac_bus *bus = azx_bus(chip);
536 struct pci_dev *pci = chip->pci; 538 struct pci_dev *pci = chip->pci;
539 u32 val;
537 540
538 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) 541 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL)
539 snd_hdac_set_codec_wakeup(bus, true); 542 snd_hdac_set_codec_wakeup(bus, true);
543 if (IS_BROXTON(pci)) {
544 pci_read_config_dword(pci, INTEL_HDA_CGCTL, &val);
545 val = val & ~INTEL_HDA_CGCTL_MISCBDCGE;
546 pci_write_config_dword(pci, INTEL_HDA_CGCTL, val);
547 }
540 azx_init_chip(chip, full_reset); 548 azx_init_chip(chip, full_reset);
549 if (IS_BROXTON(pci)) {
550 pci_read_config_dword(pci, INTEL_HDA_CGCTL, &val);
551 val = val | INTEL_HDA_CGCTL_MISCBDCGE;
552 pci_write_config_dword(pci, INTEL_HDA_CGCTL, val);
553 }
541 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) 554 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL)
542 snd_hdac_set_codec_wakeup(bus, false); 555 snd_hdac_set_codec_wakeup(bus, false);
543 556