summaryrefslogtreecommitdiff
path: root/include/sound/soc-dai.h
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2023-01-31 04:59:07 +0300
committerMark Brown <broonie@kernel.org>2023-01-31 14:04:52 +0300
commitd4c0326e6ea038cf99fde6f22296e4e68de4f2b5 (patch)
treec0ed8726070ba321ef1667238d6a548e84b3f2d8 /include/sound/soc-dai.h
parent60df5935c27e19cc6595bd1740479a60f1880a32 (diff)
downloadlinux-d4c0326e6ea038cf99fde6f22296e4e68de4f2b5.tar.xz
ASoC: soc-dai.h: add snd_soc_dai_tdm_mask_set/get() helper
Current ASoC has tx/rx_mask, and is directly accessing to them, but accessing to it via function is nice idea. This patch adds snd_soc_dai_tdm_mask_set/get() for 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/878rhjfor8.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/sound/soc-dai.h')
-rw-r--r--include/sound/soc-dai.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index f27b33dd97bd..9b18e230e5b3 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -520,6 +520,23 @@ static inline void snd_soc_dai_init_dma_data(struct snd_soc_dai *dai,
dai->capture_dma_data = capture;
}
+static inline unsigned int snd_soc_dai_tdm_mask_get(struct snd_soc_dai *dai, int stream)
+{
+ if (stream == SNDRV_PCM_STREAM_PLAYBACK)
+ return dai->tx_mask;
+ else
+ return dai->rx_mask;
+}
+
+static inline void snd_soc_dai_tdm_mask_set(struct snd_soc_dai *dai, int stream,
+ unsigned int tdm_mask)
+{
+ if (stream == SNDRV_PCM_STREAM_PLAYBACK)
+ dai->tx_mask = tdm_mask;
+ else
+ dai->rx_mask = tdm_mask;
+}
+
static inline void snd_soc_dai_set_drvdata(struct snd_soc_dai *dai,
void *data)
{