summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-pcm.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2019-05-06 22:51:52 +0900
committerMark Brown <broonie@kernel.org>2019-05-06 22:51:52 +0900
commit7f5a466f2ea1115a4a73d987b7b6a73d23475305 (patch)
treef7e9399912fae24b6364f7e8b2e327623324f516 /sound/soc/soc-pcm.c
parente93c9c99a629c61837d5a7fc2120cd2b6c70dbdd (diff)
parentf47b9ad927c6370b80922af434dda98764a43804 (diff)
downloadlinux-7f5a466f2ea1115a4a73d987b7b6a73d23475305.tar.gz
linux-7f5a466f2ea1115a4a73d987b7b6a73d23475305.tar.bz2
linux-7f5a466f2ea1115a4a73d987b7b6a73d23475305.zip
Merge branch 'asoc-5.1' into asoc-linus
Diffstat (limited to 'sound/soc/soc-pcm.c')
-rw-r--r--sound/soc/soc-pcm.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index be80a12fba27..69ea962de585 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -43,8 +43,8 @@ static bool snd_soc_dai_stream_valid(struct snd_soc_dai *dai, int stream)
else
codec_stream = &dai->driver->capture;
- /* If the codec specifies any rate at all, it supports the stream. */
- return codec_stream->rates;
+ /* If the codec specifies any channels at all, it supports the stream */
+ return codec_stream->channels_min;
}
/**
@@ -1033,6 +1033,9 @@ interface_err:
codec_err:
for_each_rtd_codec_dai_rollback(rtd, i, codec_dai) {
+ if (!snd_soc_dai_stream_valid(codec_dai, substream->stream))
+ continue;
+
if (codec_dai->driver->ops->hw_free)
codec_dai->driver->ops->hw_free(substream, codec_dai);
codec_dai->rate = 0;
@@ -1090,6 +1093,9 @@ static int soc_pcm_hw_free(struct snd_pcm_substream *substream)
/* now free hw params for the DAIs */
for_each_rtd_codec_dai(rtd, i, codec_dai) {
+ if (!snd_soc_dai_stream_valid(codec_dai, substream->stream))
+ continue;
+
if (codec_dai->driver->ops->hw_free)
codec_dai->driver->ops->hw_free(substream, codec_dai);
}