提交 218264ae 编写于 作者: T Takashi Iwai

ALSA: hda - Avoid unnecessary verbs to clear PCM formats

Since really_cleanup_stream() is called from both purity_inactive_streams()
and hda_cleanup_all_streams(), the verbs to clear the PCM channel and
format may be called multiple times unnecessarily.

This patch adds checks to skip these unneeded verbs.
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 5ec02a1c
......@@ -1491,8 +1491,11 @@ static void really_cleanup_stream(struct hda_codec *codec,
struct hda_cvt_setup *q)
{
hda_nid_t nid = q->nid;
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_CHANNEL_STREAMID, 0);
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_STREAM_FORMAT, 0);
if (q->stream_tag || q->channel_id)
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_CHANNEL_STREAMID, 0);
if (q->format_id)
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_STREAM_FORMAT, 0
);
memset(q, 0, sizeof(*q));
q->nid = nid;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册