aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_codec.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-06-21 07:33:53 -0400
committerTakashi Iwai <tiwai@suse.de>2018-06-21 07:46:56 -0400
commit57cb54e53bddb59f5f542ddd4b0bfe005d31a8d5 (patch)
treeec1faa541bf6d2c619a80be938b3538f6b36c3a4 /sound/pci/hda/hda_codec.c
parentf04684b4d85d6371126f476d3268ebf6a0bd57cf (diff)
ALSA: hda - Force to link down at runtime suspend on ATI/AMD HDMI
Henning Kühn reported that the discrete AMD GPU on his hybrid graphics laptop no longer runtime-suspends due to the recent commit 07f4f97d7b4b ("vga_switcheroo: Use device link for HDA controller"). The root cause is that the HDMI codec on AMD GPU doesn't support CLKSTOP and EPSS, which are currently mandatory for powering down the HD-audio link at runtime suspend. Because the HD-audio link is still up, HD-audio controller driver blocks the transition to D3. For addressing the regression, this patch adds a new flag to indicate the forced link-down, and sets it for AMD HDMI codecs appropriately in the codec driver. Fixes: 07f4f97d7b4b ("vga_switcheroo: Use device link for HDA controller") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106957 Reported-by: Lukas Wunner <lukas@wunner.de> Reported-and-tested-by: Henning Kühn <prg@cooco.de> Cc: <stable@vger.kernel.org> # v4.17+ Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r--sound/pci/hda/hda_codec.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index d91c87e41756..20a171ac4bb2 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -2899,8 +2899,9 @@ static int hda_codec_runtime_suspend(struct device *dev)
2899 list_for_each_entry(pcm, &codec->pcm_list_head, list) 2899 list_for_each_entry(pcm, &codec->pcm_list_head, list)
2900 snd_pcm_suspend_all(pcm->pcm); 2900 snd_pcm_suspend_all(pcm->pcm);
2901 state = hda_call_codec_suspend(codec); 2901 state = hda_call_codec_suspend(codec);
2902 if (codec_has_clkstop(codec) && codec_has_epss(codec) && 2902 if (codec->link_down_at_suspend ||
2903 (state & AC_PWRST_CLK_STOP_OK)) 2903 (codec_has_clkstop(codec) && codec_has_epss(codec) &&
2904 (state & AC_PWRST_CLK_STOP_OK)))
2904 snd_hdac_codec_link_down(&codec->core); 2905 snd_hdac_codec_link_down(&codec->core);
2905 snd_hdac_link_power(&codec->core, false); 2906 snd_hdac_link_power(&codec->core, false);
2906 return 0; 2907 return 0;