From c9adeefda0e29bed628e40e7f9da1f84243937e7 Mon Sep 17 00:00:00 2001
From: David Henningsson <david.henningsson@canonical.com>
Date: Wed, 7 Nov 2012 09:22:33 +0100
Subject: [PATCH] ALSA: hda - Keep power link on for PantherPoint HDMI
Git-commit: c9adeefda0e29bed628e40e7f9da1f84243937e7
Patch-mainline: v3.8-rc1
References: FATE#313695

On some of the PantherPoint HDMI machines we currently enable, we're seeing
trouble with unsol events, i e detecting monitor presence, especially when
on battery and after suspend/resume.

Buglink: https://bugs.launchpad.net/bugs/1075882
Tested-by: Cyrus Lien <cyrus.lien@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

---
 sound/pci/hda/patch_hdmi.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -1144,13 +1144,17 @@ static int hdmi_parse_codec(struct hda_c
 		}
 	}
 
+#ifdef CONFIG_PM
+	/* We're seeing some problems with unsolicited hot plug events on
+	 * PantherPoint after S3, if this is not enabled */
+	if (codec->vendor_id == 0x80862806)
+		codec->bus->power_keep_link_on = 1;
 	/*
 	 * G45/IbexPeak don't support EPSS: the unsolicited pin hot plug event
 	 * can be lost and presence sense verb will become inaccurate if the
 	 * HDA link is powered off at hot plug or hw initialization time.
 	 */
-#ifdef CONFIG_PM
-	if (!(snd_hda_param_read(codec, codec->afg, AC_PAR_POWER_STATE) &
+	else if (!(snd_hda_param_read(codec, codec->afg, AC_PAR_POWER_STATE) &
 	      AC_PWRST_EPSS))
 		codec->bus->power_keep_link_on = 1;
 #endif
