From 339876d70a5794c0d5fe09d37827c63148d5017a Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Tue, 8 May 2012 16:57:12 +0200
Subject: [PATCH] ALSA: hda - Clear the power-saving states properly at reset
Git-commit: 339876d70a5794c0d5fe09d37827c63148d5017a
Patch-mainline: 3.5-rc1
References: FATE#313695

Some power-saving states have been left unchanged in
snd_hda_codec_reset(), and this is a potential danger because the
function may be called in various situations including the continuous
operation after that call.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

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

--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -2264,6 +2264,9 @@ int snd_hda_codec_reset(struct hda_codec
 
 #ifdef CONFIG_SND_HDA_POWER_SAVE
 	cancel_delayed_work(&codec->power_work);
+	codec->power_on = 0;
+	codec->power_transition = 0;
+	codec->power_jiffies = jiffies;
 	flush_workqueue(codec->bus->workq);
 #endif
 	snd_hda_ctls_clear(codec);
