aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_codec.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-08-13 05:56:53 -0400
committerTakashi Iwai <tiwai@suse.de>2010-08-13 05:56:53 -0400
commitf0cea79724f03ee55e7b5933b6a6f6a3fd177710 (patch)
treebc0552e35dd5248d19f8d85f2ad84783371f9e08 /sound/pci/hda/hda_codec.c
parentbbbe33900d1f3c4402148ccb85234a741a6606a3 (diff)
ALSA: hda - Fix dynamic ADC change working again
The commit eb541337b7a43822fce7d0c9d967ee149b2d9a96 ALSA: hda - Make converter setups sticky changes the semantics of snd_hda_codec_cleanup_stream() not to clean up the stream at that moment but delay the action. This broke the codes expecting that the clean-up is done immediately, such as dynamic ADC changes in some codec drivers. This patch fixes the issue by introducing a lower helper, __snd_hda_codec_cleanup_stream(), to allow the immediate clean up. The original snd_hda_codec_cleanup_stream() is kept as is now. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r--sound/pci/hda/hda_codec.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 720a81d711e3..dd8fb86c842b 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -1261,12 +1261,17 @@ void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid,
1261} 1261}
1262EXPORT_SYMBOL_HDA(snd_hda_codec_setup_stream); 1262EXPORT_SYMBOL_HDA(snd_hda_codec_setup_stream);
1263 1263
1264static void really_cleanup_stream(struct hda_codec *codec,
1265 struct hda_cvt_setup *q);
1266
1264/** 1267/**
1265 * snd_hda_codec_cleanup_stream - clean up the codec for closing 1268 * __snd_hda_codec_cleanup_stream - clean up the codec for closing
1266 * @codec: the CODEC to clean up 1269 * @codec: the CODEC to clean up
1267 * @nid: the NID to clean up 1270 * @nid: the NID to clean up
1271 * @do_now: really clean up the stream instead of clearing the active flag
1268 */ 1272 */
1269void snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid) 1273void __snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid,
1274 int do_now)
1270{ 1275{
1271 struct hda_cvt_setup *p; 1276 struct hda_cvt_setup *p;
1272 1277
@@ -1274,14 +1279,19 @@ void snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid)
1274 return; 1279 return;
1275 1280
1276 snd_printdd("hda_codec_cleanup_stream: NID=0x%x\n", nid); 1281 snd_printdd("hda_codec_cleanup_stream: NID=0x%x\n", nid);
1277 /* here we just clear the active flag; actual clean-ups will be done
1278 * in purify_inactive_streams()
1279 */
1280 p = get_hda_cvt_setup(codec, nid); 1282 p = get_hda_cvt_setup(codec, nid);
1281 if (p) 1283 if (p) {
1282 p->active = 0; 1284 /* here we just clear the active flag when do_now isn't set;
1285 * actual clean-ups will be done later in
1286 * purify_inactive_streams() called from snd_hda_codec_prpapre()
1287 */
1288 if (do_now)
1289 really_cleanup_stream(codec, p);
1290 else
1291 p->active = 0;
1292 }
1283} 1293}
1284EXPORT_SYMBOL_HDA(snd_hda_codec_cleanup_stream); 1294EXPORT_SYMBOL_HDA(__snd_hda_codec_cleanup_stream);
1285 1295
1286static void really_cleanup_stream(struct hda_codec *codec, 1296static void really_cleanup_stream(struct hda_codec *codec,
1287 struct hda_cvt_setup *q) 1297 struct hda_cvt_setup *q)