/* first calculate min/max only for CPUs in the DAI link */
for_each_rtd_cpu_dai(rtd, i, cpu_dai) {
+
+ /*
+ * Skip CPUs which don't support the current stream type.
+ * Otherwise, since the rate, channel, and format values will
+ * zero in that case, we would have no usable settings left,
+ * causing the resulting setup to fail.
+ * At least one CPU should match, otherwise we should have
+ * bailed out on a higher level, since there would be no
+ * CPU to support the transfer direction in that case.
+ */
+ if (!snd_soc_dai_stream_valid(cpu_dai,
+ substream->stream))
+ continue;
+
cpu_stream = snd_soc_dai_get_pcm_stream(cpu_dai, stream);
cpu_chan_min = max(cpu_chan_min, cpu_stream->channels_min);
}
for_each_rtd_cpu_dai(rtd, i, cpu_dai) {
+ /*
+ * Skip CPUs which don't support the current stream
+ * type. See soc_pcm_init_runtime_hw() for more details
+ */
+ if (!snd_soc_dai_stream_valid(cpu_dai, substream->stream))
+ continue;
+
ret = snd_soc_dai_hw_params(cpu_dai, substream, params);
if (ret < 0)
goto interface_err;
interface_err:
for_each_rtd_cpu_dai_rollback(rtd, i, cpu_dai) {
+ if (!snd_soc_dai_stream_valid(cpu_dai, substream->stream))
+ continue;
+
snd_soc_dai_hw_free(cpu_dai, substream);
cpu_dai->rate = 0;
}
snd_soc_dai_hw_free(codec_dai, substream);
}
- for_each_rtd_cpu_dai(rtd, i, cpu_dai)
+ for_each_rtd_cpu_dai(rtd, i, cpu_dai) {
+ if (!snd_soc_dai_stream_valid(cpu_dai, substream->stream))
+ continue;
+
snd_soc_dai_hw_free(cpu_dai, substream);
+ }
mutex_unlock(&rtd->card->pcm_mutex);
return 0;
int i;
for_each_rtd_cpu_dai(be, i, dai) {
+ /*
+ * Skip CPUs which don't support the current stream
+ * type. See soc_pcm_init_runtime_hw() for more details
+ */
+ if (!snd_soc_dai_stream_valid(dai, stream))
+ continue;
+
cpu_stream = snd_soc_dai_get_pcm_stream(dai, stream);
*channels_min = max(*channels_min,
int i;
for_each_rtd_cpu_dai(be, i, dai) {
+ /*
+ * Skip CPUs which don't support the current stream
+ * type. See soc_pcm_init_runtime_hw() for more details
+ */
+ if (!snd_soc_dai_stream_valid(dai, stream))
+ continue;
+
cpu_stream = snd_soc_dai_get_pcm_stream(dai, stream);
*rate_min = max(*rate_min, cpu_stream->rate_min);
int i;
for_each_rtd_cpu_dai(rtd, i, cpu_dai) {
+ /*
+ * Skip CPUs which don't support the current stream
+ * type. See soc_pcm_init_runtime_hw() for more details
+ */
+ if (!snd_soc_dai_stream_valid(cpu_dai, substream->stream))
+ continue;
+
cpu_dai_drv = cpu_dai->driver;
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
dpcm_init_runtime_hw(runtime, &cpu_dai_drv->playback);