Commit e15ff262 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: soc-pcm.c: use helper function

Current ASoC has many helper function.
This patch use it.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/87fsbrea25.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 8ede4b71
...@@ -1012,6 +1012,7 @@ static int __soc_pcm_hw_params(struct snd_soc_pcm_runtime *rtd, ...@@ -1012,6 +1012,7 @@ static int __soc_pcm_hw_params(struct snd_soc_pcm_runtime *rtd,
for_each_rtd_codec_dais(rtd, i, codec_dai) { for_each_rtd_codec_dais(rtd, i, codec_dai) {
struct snd_pcm_hw_params codec_params; 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,
...@@ -1034,15 +1035,8 @@ static int __soc_pcm_hw_params(struct snd_soc_pcm_runtime *rtd, ...@@ -1034,15 +1035,8 @@ static int __soc_pcm_hw_params(struct snd_soc_pcm_runtime *rtd,
codec_params = *params; codec_params = *params;
/* fixup params based on TDM slot masks */ /* fixup params based on TDM slot masks */
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && if (tdm_mask)
codec_dai->tx_mask) soc_pcm_codec_params_fixup(&codec_params, tdm_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);
ret = snd_soc_dai_hw_params(codec_dai, substream, ret = snd_soc_dai_hw_params(codec_dai, substream,
&codec_params); &codec_params);
......
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