Skip to content

Commit

Permalink
ALSA: hda - Avoid unnecessary verbs to clear PCM formats
Browse files Browse the repository at this point in the history
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: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Sep 27, 2011
1 parent 5ec02a1 commit 218264a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sound/pci/hda/hda_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 218264a

Please sign in to comment.