aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_generic.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-05-26 21:40:19 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-05-26 21:40:19 -0400
commitf35c69b736e4f910d7447346980145212c283570 (patch)
tree824b90cd870e6de07bbba19d761c1c74cf1fb4a7 /sound/pci/hda/hda_generic.c
parentcd4373984a5903276f52777a6003425e023eaa7e (diff)
parente4aa937ec75df0eea0bee03bffa3303ad36c986b (diff)
Merge 3.10-rc3 into char-misc-next
We want the changes in here. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/pci/hda/hda_generic.c')
-rw-r--r--sound/pci/hda/hda_generic.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index ac079f93c535..ae85bbd2e6f8 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -606,6 +606,10 @@ static bool is_active_nid(struct hda_codec *codec, hda_nid_t nid,
606 return false; 606 return false;
607} 607}
608 608
609/* check whether the NID is referred by any active paths */
610#define is_active_nid_for_any(codec, nid) \
611 is_active_nid(codec, nid, HDA_OUTPUT, 0)
612
609/* get the default amp value for the target state */ 613/* get the default amp value for the target state */
610static int get_amp_val_to_activate(struct hda_codec *codec, hda_nid_t nid, 614static int get_amp_val_to_activate(struct hda_codec *codec, hda_nid_t nid,
611 int dir, unsigned int caps, bool enable) 615 int dir, unsigned int caps, bool enable)
@@ -759,7 +763,8 @@ static void path_power_down_sync(struct hda_codec *codec, struct nid_path *path)
759 763
760 for (i = 0; i < path->depth; i++) { 764 for (i = 0; i < path->depth; i++) {
761 hda_nid_t nid = path->path[i]; 765 hda_nid_t nid = path->path[i];
762 if (!snd_hda_check_power_state(codec, nid, AC_PWRST_D3)) { 766 if (!snd_hda_check_power_state(codec, nid, AC_PWRST_D3) &&
767 !is_active_nid_for_any(codec, nid)) {
763 snd_hda_codec_write(codec, nid, 0, 768 snd_hda_codec_write(codec, nid, 0,
764 AC_VERB_SET_POWER_STATE, 769 AC_VERB_SET_POWER_STATE,
765 AC_PWRST_D3); 770 AC_PWRST_D3);
@@ -4157,7 +4162,7 @@ static unsigned int snd_hda_gen_path_power_filter(struct hda_codec *codec,
4157 return power_state; 4162 return power_state;
4158 if (get_wcaps_type(get_wcaps(codec, nid)) >= AC_WID_POWER) 4163 if (get_wcaps_type(get_wcaps(codec, nid)) >= AC_WID_POWER)
4159 return power_state; 4164 return power_state;
4160 if (is_active_nid(codec, nid, HDA_OUTPUT, 0)) 4165 if (is_active_nid_for_any(codec, nid))
4161 return power_state; 4166 return power_state;
4162 return AC_PWRST_D3; 4167 return AC_PWRST_D3;
4163} 4168}