From 535b6c51fe8293c88ce919cdfc4390c67a1cb6d1 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Mon, 20 Aug 2012 21:25:22 +0200
Subject: [PATCH] ALSA: hda - Fix leftover codec->power_transition
Git-commit: 535b6c51fe8293c88ce919cdfc4390c67a1cb6d1
Patch-mainline: 3.6-rc3
References: FATE#313695

When the codec turn-on operation is canceled by the immediate
power-on, the driver left the power_transition flag as is.
This caused the persistent avoidance of power-save behavior.

Cc: <stable@vger.kernel.org> [v3.5+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>

---
 sound/pci/hda/hda_codec.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -4456,8 +4456,11 @@ static void __snd_hda_power_up(struct hd
 	/* If the power down delayed work was cancelled above before starting,
 	 * then there is no need to go through power up here.
 	 */
-	if (codec->power_on)
+	if (codec->power_on) {
+		if (codec->power_transition < 0)
+			codec->power_transition = 0;
 		return;
+	}
 
 	trace_hda_power_up(codec);
 	snd_hda_update_power_acct(codec);
