aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/soc-pcm.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2023-01-31 02:01:54 +0000
committerMark Brown <broonie@kernel.org>2023-01-31 11:05:10 +0000
commite15ff262e212387a05316dc465d754c0a62d9691 (patch)
tree85d0cd6e4d07fff96b1abba19e82aff16aea2d7f /sound/soc/soc-pcm.c
parent8ede4b7109f618b3267a9577083b38984857a267 (diff)
ASoC: soc-pcm.c: use helper function
Current ASoC has many helper function. This patch use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/87fsbrea25.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-pcm.c')
-rw-r--r--sound/soc/soc-pcm.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index f6caa55ef322..005b179a770a 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -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) {
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,
@@ -1034,15 +1035,8 @@ static int __soc_pcm_hw_params(struct snd_soc_pcm_runtime *rtd,
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);