aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_codec.c
diff options
context:
space:
mode:
authorMaxim Levitsky <maximlevitsky@gmail.com>2007-09-03 09:28:04 -0400
committerJaroslav Kysela <perex@perex.cz>2007-10-16 09:59:47 -0400
commitd804ad9258c1460916a5e5854655a0dc543fd8a5 (patch)
tree783900a809c48f73bb5849d11cb7fce8e88d4484 /sound/pci/hda/hda_codec.c
parent2e4924628ad957f702631a7a049c586a780f00f8 (diff)
[ALSA] hda-intel - Fix resume logic, when dynamic power managment is on
Comment in hda_intel.c states that 'the explicit resume is needed only when POWER_SAVE isn't set', but this is not true. There is no code that will automaticly power up the codec on resume, but only code that powers it up when user accesses it. So if user leaves a sound playing, codec will not be powered To fix that I check if there are any codecs that should be powered codec->power_count, and if so I power them up together with main controller. Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r--sound/pci/hda/hda_codec.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 08104e2a3e99..e594de0b153e 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -2787,7 +2787,6 @@ int snd_hda_suspend(struct hda_bus *bus, pm_message_t state)
2787 return 0; 2787 return 0;
2788} 2788}
2789 2789
2790#ifndef CONFIG_SND_HDA_POWER_SAVE
2791/** 2790/**
2792 * snd_hda_resume - resume the codecs 2791 * snd_hda_resume - resume the codecs
2793 * @bus: the HDA bus 2792 * @bus: the HDA bus
@@ -2803,10 +2802,21 @@ int snd_hda_resume(struct hda_bus *bus)
2803 struct hda_codec *codec; 2802 struct hda_codec *codec;
2804 2803
2805 list_for_each_entry(codec, &bus->codec_list, list) { 2804 list_for_each_entry(codec, &bus->codec_list, list) {
2806 hda_call_codec_resume(codec); 2805 if (snd_hda_codec_needs_resume(codec))
2806 hda_call_codec_resume(codec);
2807 } 2807 }
2808 return 0; 2808 return 0;
2809} 2809}
2810#endif /* !CONFIG_SND_HDA_POWER_SAVE */ 2810#ifdef CONFIG_SND_HDA_POWER_SAVE
2811int snd_hda_codecs_inuse(struct hda_bus *bus)
2812{
2813 struct hda_codec *codec;
2811 2814
2815 list_for_each_entry(codec, &bus->codec_list, list) {
2816 if (snd_hda_codec_needs_resume(codec))
2817 return 1;
2818 }
2819 return 0;
2820}
2821#endif
2812#endif 2822#endif