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

ASoC: soc-dai: add snd_soc_dai_action()

snd_soc_runtime_action() updates DAI's xxx_active.
We should update these in the same time, and
it can be implemented at soc-dai.c.
This patch adds snd_soc_dai_action() for it.
This is prepare for xxx_active cleanup.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87a72a6n4s.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent d9051d86
...@@ -161,6 +161,18 @@ void snd_soc_dai_resume(struct snd_soc_dai *dai); ...@@ -161,6 +161,18 @@ void snd_soc_dai_resume(struct snd_soc_dai *dai);
int snd_soc_dai_compress_new(struct snd_soc_dai *dai, int snd_soc_dai_compress_new(struct snd_soc_dai *dai,
struct snd_soc_pcm_runtime *rtd, int num); struct snd_soc_pcm_runtime *rtd, int num);
bool snd_soc_dai_stream_valid(struct snd_soc_dai *dai, int stream); bool snd_soc_dai_stream_valid(struct snd_soc_dai *dai, int stream);
void snd_soc_dai_action(struct snd_soc_dai *dai,
int stream, int action);
static inline void snd_soc_dai_activate(struct snd_soc_dai *dai,
int stream)
{
snd_soc_dai_action(dai, stream, 1);
}
static inline void snd_soc_dai_deactivate(struct snd_soc_dai *dai,
int stream)
{
snd_soc_dai_action(dai, stream, -1);
}
int snd_soc_pcm_dai_probe(struct snd_soc_pcm_runtime *rtd, int order); 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); int snd_soc_pcm_dai_remove(struct snd_soc_pcm_runtime *rtd, int order);
......
...@@ -388,6 +388,15 @@ bool snd_soc_dai_stream_valid(struct snd_soc_dai *dai, int dir) ...@@ -388,6 +388,15 @@ bool snd_soc_dai_stream_valid(struct snd_soc_dai *dai, int dir)
return stream->channels_min; return stream->channels_min;
} }
void snd_soc_dai_action(struct snd_soc_dai *dai,
int stream, int action)
{
dai->stream_active[stream] += action;
dai->active += action;
dai->component->active += action;
}
EXPORT_SYMBOL_GPL(snd_soc_dai_action);
int snd_soc_pcm_dai_probe(struct snd_soc_pcm_runtime *rtd, int order) int snd_soc_pcm_dai_probe(struct snd_soc_pcm_runtime *rtd, int order)
{ {
struct snd_soc_dai *dai; struct snd_soc_dai *dai;
......
...@@ -276,11 +276,8 @@ void snd_soc_runtime_action(struct snd_soc_pcm_runtime *rtd, ...@@ -276,11 +276,8 @@ void snd_soc_runtime_action(struct snd_soc_pcm_runtime *rtd,
lockdep_assert_held(&rtd->card->pcm_mutex); lockdep_assert_held(&rtd->card->pcm_mutex);
for_each_rtd_dais(rtd, i, dai) { for_each_rtd_dais(rtd, i, dai)
dai->stream_active[stream] += action; snd_soc_dai_action(dai, stream, action);
dai->active += action;
dai->component->active += action;
}
} }
EXPORT_SYMBOL_GPL(snd_soc_runtime_action); EXPORT_SYMBOL_GPL(snd_soc_runtime_action);
......
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