Skip to content

Commit

Permalink
ASoC: SOF: hda: fix stream id setting
Browse files Browse the repository at this point in the history
snd_hdac_ext_link_clear_stream_id maps stream id to link output,
which is for playback, not capture.

Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
  • Loading branch information
RanderWang committed Jul 4, 2019
1 parent 68b2f3c commit eadddd2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sound/soc/sof/intel/hda-dai.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,8 @@ static int hda_link_pcm_trigger(struct snd_pcm_substream *substream,
if (ret < 0)
return ret;
stream_tag = hdac_stream(link_dev)->stream_tag;
snd_hdac_ext_link_clear_stream_id(link, stream_tag);
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
snd_hdac_ext_link_clear_stream_id(link, stream_tag);

/* fallthrough */
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
Expand Down Expand Up @@ -372,7 +373,8 @@ static int hda_link_hw_free(struct snd_pcm_substream *substream,
return -EINVAL;

stream_tag = hdac_stream(link_dev)->stream_tag;
snd_hdac_ext_link_clear_stream_id(link, stream_tag);
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
snd_hdac_ext_link_clear_stream_id(link, stream_tag);
snd_hdac_ext_stream_release(link_dev, HDAC_EXT_STREAM_TYPE_LINK);
snd_soc_dai_set_dma_data(dai, substream, NULL);
link_dev->link_prepared = 0;
Expand Down
5 changes: 5 additions & 0 deletions sound/soc/sof/intel/hda-dsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,11 @@ int hda_dsp_set_hw_params_upon_resume(struct snd_sof_dev *sdev)
if (!link)
return -EINVAL;
stream_tag = hdac_stream(stream)->stream_tag;

if (hdac_stream(stream)->direction ==
SNDRV_PCM_STREAM_CAPTURE)
continue;

snd_hdac_ext_link_clear_stream_id(link, stream_tag);
}
#endif
Expand Down

0 comments on commit eadddd2

Please sign in to comment.