summaryrefslogtreecommitdiffstats
path: root/include/sound
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2020-05-15 09:46:37 +0900
committerMark Brown <broonie@kernel.org>2020-05-18 16:15:01 +0100
commitefffd9b344adbf813e3ae6f6136df80000bf2833 (patch)
treede2f30fa14d21ce2c84f544b1666b941801e32ca /include/sound
parent45eb8666e52d2d1733fda7353e48906d34a71e5d (diff)
downloadlinux-efffd9b344adbf813e3ae6f6136df80000bf2833.tar.bz2
ASoC: soc-dai: add snd_soc_dai_active()
Current snd_soc_dai_action() is updating dai->stream_active for Playback/Capture (A), dai->active for DAI (B) void snd_soc_dai_action(struct snd_soc_dai *dai, int stream, int action) { (A) dai->stream_active[stream] += action; (B) dai->active += action; dai->component->active += action; } But, these are very verbose, because we can calculate DAI active from stream_active. This patch adds snd_soc_dai_active() which calculate DAI active from DAI stream_active. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/877dxe6n4i.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/sound')
-rw-r--r--include/sound/soc-dai.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index 800d7aa8523e..2c74c41f9447 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -173,6 +173,7 @@ static inline void snd_soc_dai_deactivate(struct snd_soc_dai *dai,
{
snd_soc_dai_action(dai, stream, -1);
}
+int snd_soc_dai_active(struct snd_soc_dai *dai);
int snd_soc_pcm_dai_probe(struct snd_soc_pcm_runtime *rtd, int order);
int snd_soc_pcm_dai_remove(struct snd_soc_pcm_runtime *rtd, int order);