Commit 810dbea3 authored by Rander Wang's avatar Rander Wang Committed by Mark Brown

ASoC: SOF: Intel: hda: fix stream id setting

snd_hdac_ext_link_clear_stream_id maps stream id to
link output, which is for playback, not capture.

Tested on Whiskey Lake platform.
Signed-off-by: default avatarRander Wang <rander.wang@linux.intel.com>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20190722141402.7194-20-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 934bf822
...@@ -327,8 +327,12 @@ static int hda_link_pcm_trigger(struct snd_pcm_substream *substream, ...@@ -327,8 +327,12 @@ static int hda_link_pcm_trigger(struct snd_pcm_substream *substream,
DMA_CHAN_INVALID, substream->stream); DMA_CHAN_INVALID, substream->stream);
if (ret < 0) if (ret < 0)
return ret; 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) {
stream_tag = hdac_stream(link_dev)->stream_tag;
snd_hdac_ext_link_clear_stream_id(link, stream_tag);
}
link_dev->link_prepared = 0; link_dev->link_prepared = 0;
/* fallthrough */ /* fallthrough */
...@@ -369,8 +373,11 @@ static int hda_link_hw_free(struct snd_pcm_substream *substream, ...@@ -369,8 +373,11 @@ static int hda_link_hw_free(struct snd_pcm_substream *substream,
if (!link) if (!link)
return -EINVAL; return -EINVAL;
stream_tag = hdac_stream(link_dev)->stream_tag; if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
snd_hdac_ext_link_clear_stream_id(link, stream_tag); stream_tag = hdac_stream(link_dev)->stream_tag;
snd_hdac_ext_link_clear_stream_id(link, stream_tag);
}
snd_soc_dai_set_dma_data(dai, substream, NULL); snd_soc_dai_set_dma_data(dai, substream, NULL);
snd_hdac_ext_stream_release(link_dev, HDAC_EXT_STREAM_TYPE_LINK); snd_hdac_ext_stream_release(link_dev, HDAC_EXT_STREAM_TYPE_LINK);
link_dev->link_prepared = 0; link_dev->link_prepared = 0;
......
...@@ -450,9 +450,15 @@ int hda_dsp_set_hw_params_upon_resume(struct snd_sof_dev *sdev) ...@@ -450,9 +450,15 @@ int hda_dsp_set_hw_params_upon_resume(struct snd_sof_dev *sdev)
link = snd_hdac_ext_bus_get_link(bus, name); link = snd_hdac_ext_bus_get_link(bus, name);
if (!link) if (!link)
return -EINVAL; return -EINVAL;
stream->link_prepared = 0;
if (hdac_stream(stream)->direction ==
SNDRV_PCM_STREAM_CAPTURE)
continue;
stream_tag = hdac_stream(stream)->stream_tag; stream_tag = hdac_stream(stream)->stream_tag;
snd_hdac_ext_link_clear_stream_id(link, stream_tag); snd_hdac_ext_link_clear_stream_id(link, stream_tag);
stream->link_prepared = 0;
} }
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment