ALSA: hda - Avoid unnecessary verbs to clear PCM formats
[pandora-kernel.git] / sound / pci / hda / hda_codec.c
index 6b611d5..e3db196 100644 (file)
@@ -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;
 }