Skip to content

Commit

Permalink
ALSA: hda - Fix Skylake codec timeout
Browse files Browse the repository at this point in the history
When the controller is powered up but the HDMI codec is powered down
on Skylake, the power well is turned off. When the codec is then
powered up again, we need to poke the codec a little extra to make
sure it wakes up. Otherwise we'll get sad "no response from codec"
messages and broken audio.

This also changes azx_runtime_resume to actually call
snd_hdac_set_codec_wakeup for Skylake (before STATETS read).
(Otherwise it would only have been called for Haswell and Broadwell,
which both do not need it, so this probably was not the author's
intention.)

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Reviewed-by: Libin Yang <libin.yang@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
David Henningsson authored and Takashi Iwai committed Jul 20, 2015
1 parent 0420694 commit 033ea34
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
5 changes: 4 additions & 1 deletion sound/hda/hdac_i915.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,11 @@ int snd_hdac_display_power(struct hdac_bus *bus, bool enable)
enable ? "enable" : "disable");

if (enable) {
if (!bus->i915_power_refcount++)
if (!bus->i915_power_refcount++) {
acomp->ops->get_power(acomp->dev);
snd_hdac_set_codec_wakeup(bus, true);
snd_hdac_set_codec_wakeup(bus, false);
}
} else {
WARN_ON(!bus->i915_power_refcount);
if (!--bus->i915_power_refcount)
Expand Down
18 changes: 10 additions & 8 deletions sound/pci/hda/hda_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -979,14 +979,16 @@ static int azx_runtime_resume(struct device *dev)
if (!azx_has_pm_runtime(chip))
return 0;

if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL
&& hda->need_i915_power) {
bus = azx_bus(chip);
snd_hdac_display_power(bus, true);
haswell_set_bclk(hda);
/* toggle codec wakeup bit for STATESTS read */
snd_hdac_set_codec_wakeup(bus, true);
snd_hdac_set_codec_wakeup(bus, false);
if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) {
bus = azx_bus(chip);
if (hda->need_i915_power) {
snd_hdac_display_power(bus, true);
haswell_set_bclk(hda);
} else {
/* toggle codec wakeup bit for STATESTS read */
snd_hdac_set_codec_wakeup(bus, true);
snd_hdac_set_codec_wakeup(bus, false);
}
}

/* Read STATESTS before controller reset */
Expand Down

0 comments on commit 033ea34

Please sign in to comment.