diff mbox series

[v2,06/21] ASoC: soc-dai: add snd_soc_dai_stream_active()

Message ID 8736829afh.wl-kuninori.morimoto.gx@renesas.com
State New
Headers show
Series ASoC: cleanup DAI/Component activity | expand

Commit Message

Kuninori Morimoto May 14, 2020, 8:40 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v1 -> v2
	- new patch
	- not update dai->active via macro

 include/sound/soc-dai.h | 1 +
 sound/soc/soc-dai.c     | 1 +
 2 files changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index e651c62636ab..d55dd0474096 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -166,6 +166,7 @@  void snd_soc_dai_action(struct snd_soc_dai *dai,
 #define snd_soc_dai_activate(dai, stream)   snd_soc_dai_action(dai, stream,  1)
 #define snd_soc_dai_deactivate(dai, stream) snd_soc_dai_action(dai, stream, -1)
 int snd_soc_dai_active(struct snd_soc_dai *dai);
+#define snd_soc_dai_stream_active(dai, stream) ((dai)->stream_active[stream])
 
 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);
diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c
index bb771302fd6f..8172ff42d796 100644
--- a/sound/soc/soc-dai.c
+++ b/sound/soc/soc-dai.c
@@ -391,6 +391,7 @@  bool snd_soc_dai_stream_valid(struct snd_soc_dai *dai, int dir)
 void snd_soc_dai_action(struct snd_soc_dai *dai,
 			int stream, int action)
 {
+	/* see snd_soc_dai_stream_active() */
 	dai->stream_active[stream]	+= action;
 	dai->active			+= action;
 	/* see snd_soc_component_active() */