ASoC: soc-dai: rename snd_soc_dai_action() to snd_soc_dai_active_update()

We have snd_soc_dai_action() to update .active. and in the same time,
we have snd_soc_dai_active() to get    .active.
They are confusing name. Let's rename _action() to _active_update().

And in the same time, we have snd_soc_dai_action() and has its wrapper
macro _activate/deactivate(). But callers are using both original/wrapper.
Let's remove wrapper to remove confusion.

It is used only from ASoC framework, let's move it to soc-internal.h

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Alvin Šipraga <alvin.sipraga@analog.com>
Link: https://patch.msgid.link/87cxubjpqu.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Kuninori Morimoto 2026-09-18 01:46:17 +00:00 committed by Mark Brown
parent d47f591c9a
commit 885ce49a70
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
5 changed files with 10 additions and 21 deletions

View File

@ -231,18 +231,7 @@ void snd_soc_dai_suspend(struct snd_soc_dai *dai);
void snd_soc_dai_resume(struct snd_soc_dai *dai);
int snd_soc_dai_compress_new(struct snd_soc_dai *dai, struct snd_soc_pcm_runtime *rtd);
bool snd_soc_dai_stream_valid(const 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_dai_active(const struct snd_soc_dai *dai);
int snd_soc_pcm_dai_probe(struct snd_soc_pcm_runtime *rtd, int order);

View File

@ -707,8 +707,7 @@ bool snd_soc_dai_stream_valid(const struct snd_soc_dai *dai, int dir)
return stream->channels_min;
}
void snd_soc_dai_action(struct snd_soc_dai *dai,
int stream, int action)
void snd_soc_dai_active_update(struct snd_soc_dai *dai, int stream, int action)
{
/* see snd_soc_dai_stream_active() */
dai->stream[stream].active += action;
@ -716,7 +715,6 @@ void snd_soc_dai_action(struct snd_soc_dai *dai,
/* see snd_soc_component_active() */
dai->component->active += action;
}
EXPORT_SYMBOL_GPL(snd_soc_dai_action);
int snd_soc_dai_active(const struct snd_soc_dai *dai)
{
@ -1161,7 +1159,7 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_stream_tdm_mask_set);
unsigned int snd_soc_dai_stream_active(const struct snd_soc_dai *dai, int stream)
{
/* see snd_soc_dai_action() for setup */
/* see snd_soc_dai_active_update() for setup */
return dai->stream[stream].active;
}
EXPORT_SYMBOL_GPL(snd_soc_dai_stream_active);

View File

@ -37,6 +37,7 @@
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/initval.h>
#include "soc-internal.h"
#include <trace/events/asoc.h>
@ -4010,7 +4011,7 @@ static int dapm_dai_link_event_pre_pmu(struct snd_soc_dapm_widget *w,
if (ret < 0)
return ret;
snd_soc_dai_activate(source, substream->stream);
snd_soc_dai_active_update(source, substream->stream, 1);
}
substream->stream = SNDRV_PCM_STREAM_PLAYBACK;
@ -4021,7 +4022,7 @@ static int dapm_dai_link_event_pre_pmu(struct snd_soc_dapm_widget *w,
if (ret < 0)
return ret;
snd_soc_dai_activate(sink, substream->stream);
snd_soc_dai_active_update(sink, substream->stream, 1);
}
substream->hw_opened = 1;
@ -4150,14 +4151,14 @@ static int dapm_dai_link_event(struct snd_soc_dapm_widget *w,
substream->stream = SNDRV_PCM_STREAM_CAPTURE;
snd_soc_dapm_widget_for_each_source_path(w, path) {
source = path->source->priv;
snd_soc_dai_deactivate(source, substream->stream);
snd_soc_dai_active_update(source, substream->stream, -1);
snd_soc_dai_shutdown(source, substream, 0);
}
substream->stream = SNDRV_PCM_STREAM_PLAYBACK;
snd_soc_dapm_widget_for_each_sink_path(w, path) {
sink = path->sink->priv;
snd_soc_dai_deactivate(sink, substream->stream);
snd_soc_dai_active_update(sink, substream->stream, -1);
snd_soc_dai_shutdown(sink, substream, 0);
}
break;

View File

@ -34,5 +34,6 @@ int snd_soc_dai_symmetric_params(struct snd_pcm_substream *substream, struct snd
void snd_soc_dai_symmetric_update(struct snd_pcm_substream *substream);
struct clk *snd_soc_dai_get_bclk(struct snd_soc_dai *dai);
unsigned int snd_soc_dai_get_bclk_ratio(struct snd_soc_dai *dai);
void snd_soc_dai_active_update(struct snd_soc_dai *dai, int stream, int action);
#endif /* __SOC_INTERNAL_H */

View File

@ -368,7 +368,7 @@ void snd_soc_runtime_action(struct snd_soc_pcm_runtime *rtd,
snd_soc_dpcm_mutex_assert_held(rtd);
for_each_rtd_dais(rtd, i, dai)
snd_soc_dai_action(dai, stream, action);
snd_soc_dai_active_update(dai, stream, action);
/* Increments/Decrements the active count for components without DAIs */
for_each_rtd_components(rtd, i, component) {