for_each_rtd_codec_dais(rtd, i, codec_dai) {
struct snd_pcm_hw_params codec_params;
for_each_rtd_codec_dais(rtd, i, codec_dai) {
struct snd_pcm_hw_params codec_params;
+ unsigned int tdm_mask = snd_soc_dai_tdm_mask_get(codec_dai, substream->stream);
/*
* Skip CODECs which don't support the current stream type,
/*
* Skip CODECs which don't support the current stream type,
codec_params = *params;
/* fixup params based on TDM slot masks */
codec_params = *params;
/* fixup params based on TDM slot masks */
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
- codec_dai->tx_mask)
- soc_pcm_codec_params_fixup(&codec_params,
- codec_dai->tx_mask);
-
- if (substream->stream == SNDRV_PCM_STREAM_CAPTURE &&
- codec_dai->rx_mask)
- soc_pcm_codec_params_fixup(&codec_params,
- codec_dai->rx_mask);
+ if (tdm_mask)
+ soc_pcm_codec_params_fixup(&codec_params, tdm_mask);
ret = snd_soc_dai_hw_params(codec_dai, substream,
&codec_params);
ret = snd_soc_dai_hw_params(codec_dai, substream,
&codec_params);