summaryrefslogtreecommitdiff
path: root/sound/pci/hda/hda_generic.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-17 07:17:48 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-17 07:17:48 -0700
commit8f710dd34a46500e135203816c71c3ec567c46fd (patch)
treea8ac50c86a5d77da4d1486a50342f7709dc7b8d5 /sound/pci/hda/hda_generic.c
parentec50f2a97a4a7098a81b40030e0bfe28bdc43740 (diff)
parente6135fe960bba1d1a3a6b6818839e6d8d3f21293 (diff)
Merge tag 'sound-3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "A fairly calm update at this time, as seen in the short log, only one fix per person: including, - a few ASoC fixes (da7213 dmic, ux500 AD slot, wm0010 error path) - a copule of HD-audio fixes - a few other misc fixes (MIPS allmodconfig, proc output in usb, old PowerBook support)" * tag 'sound-3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: usb-audio: proc: use found syncmaxsize to determine feedback format ALSA: hda - Add headset mic support for another Dell machine ALSA: snd-aoa: Add a layout entry for PowerBook6,5 ALSA: hda - Check the activity of the NID to be powered down sound: Fix make allmodconfig on MIPS correctly ASoC: da7213: Fix setting dmic_samplephase and dmic_clk_rate ASoC: ux500: Swap even/odd AD slot definitions ASoC: wm0010: fix error return code in wm0010_boot()
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,
return false;
}
+/* check whether the NID is referred by any active paths */
+#define is_active_nid_for_any(codec, nid) \
+ is_active_nid(codec, nid, HDA_OUTPUT, 0)
+
/* get the default amp value for the target state */
static int get_amp_val_to_activate(struct hda_codec *codec, hda_nid_t nid,
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)
for (i = 0; i < path->depth; i++) {
hda_nid_t nid = path->path[i];
- if (!snd_hda_check_power_state(codec, nid, AC_PWRST_D3)) {
+ if (!snd_hda_check_power_state(codec, nid, AC_PWRST_D3) &&
+ !is_active_nid_for_any(codec, nid)) {
snd_hda_codec_write(codec, nid, 0,
AC_VERB_SET_POWER_STATE,
AC_PWRST_D3);
@@ -4157,7 +4162,7 @@ static unsigned int snd_hda_gen_path_power_filter(struct hda_codec *codec,
return power_state;
if (get_wcaps_type(get_wcaps(codec, nid)) >= AC_WID_POWER)
return power_state;
- if (is_active_nid(codec, nid, HDA_OUTPUT, 0))
+ if (is_active_nid_for_any(codec, nid))
return power_state;
return AC_PWRST_D3;
}