aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-08-24 04:52:06 -0400
committerTakashi Iwai <tiwai@suse.de>2015-08-25 01:59:02 -0400
commitc7cd0ef66aade29e37ee08821a0e195ee776c6e6 (patch)
tree3ea3e88cb85c6405f4562f78236cd55c89254f00
parent9d2b48f7304aafaefbf0794a556ab4e307929d24 (diff)
ALSA: hda - Fix path power activation
The widget power-saving code tries to turn up/down the power of each widget in the I/O paths that are modified at each jack plug/unplug. The recent report revealed that the power activation leaves some widgets unpowered after plugging. This is because snd_hda_activate_path() turns on path->active flag at the end of the function while the path power management is done before that. Then it's regarded as if nothing is active, and the driver turns off the power. The fix is simply to set the flag at the beginning of the function, before trying to power up. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=102521 Cc: <stable@vger.kernel.org> [v4.1+] Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/hda/hda_generic.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index 368181d8b0ce..24f91114a32c 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -884,8 +884,7 @@ void snd_hda_activate_path(struct hda_codec *codec, struct nid_path *path,
884 struct hda_gen_spec *spec = codec->spec; 884 struct hda_gen_spec *spec = codec->spec;
885 int i; 885 int i;
886 886
887 if (!enable) 887 path->active = enable;
888 path->active = false;
889 888
890 /* make sure the widget is powered up */ 889 /* make sure the widget is powered up */
891 if (enable && (spec->power_down_unused || codec->power_save_node)) 890 if (enable && (spec->power_down_unused || codec->power_save_node))
@@ -903,9 +902,6 @@ void snd_hda_activate_path(struct hda_codec *codec, struct nid_path *path,
903 if (has_amp_out(codec, path, i)) 902 if (has_amp_out(codec, path, i))
904 activate_amp_out(codec, path, i, enable); 903 activate_amp_out(codec, path, i, enable);
905 } 904 }
906
907 if (enable)
908 path->active = true;
909} 905}
910EXPORT_SYMBOL_GPL(snd_hda_activate_path); 906EXPORT_SYMBOL_GPL(snd_hda_activate_path);
911 907