]> www.infradead.org Git - users/hch/misc.git/commitdiff
ASoC: soc-dapm: add snd_soc_dapm_get_bias_level()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Thu, 4 Sep 2025 05:21:41 +0000 (05:21 +0000)
committerMark Brown <broonie@kernel.org>
Thu, 18 Sep 2025 21:24:17 +0000 (22:24 +0100)
Because struct snd_soc_dapm_context is soc-dapm framework specific, user
driver don't need to access its member directly, we would like to hide
them. struct snd_soc_dapm_context will be removed from header in the
future.

Many drivers are directly using dapm->idle_bias, but it should get it
via get_idle_bias() function. Makes it as global function.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/871pomx062.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/soc-dapm.h
sound/soc/soc-dapm.c

index 9618a54a53485a7288bda1b18f79ad5fda103e81..e978be4010b8415f74491c9f6b4f6284c7ada69e 100644 (file)
@@ -662,6 +662,8 @@ struct device *snd_soc_dapm_to_dev(struct snd_soc_dapm_context *dapm);
 struct snd_soc_card *snd_soc_dapm_to_card(struct snd_soc_dapm_context *dapm);
 struct snd_soc_component *snd_soc_dapm_to_component(struct snd_soc_dapm_context *dapm);
 
+bool snd_soc_dapm_get_idle_bias(struct snd_soc_dapm_context *dapm);
+
 /* dapm path setup */
 int snd_soc_dapm_new_widgets(struct snd_soc_card *card);
 void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm);
index a263696ef8acc6e3a048efdb20b9fc6f05ac0c53..209da43bc023b92dd5316a79dedcf064476daa7d 100644 (file)
@@ -2180,7 +2180,7 @@ end:
                dapm_seq_insert(w, down_list, false);
 }
 
-static bool dapm_get_idle_bias(struct snd_soc_dapm_context *dapm)
+bool snd_soc_dapm_get_idle_bias(struct snd_soc_dapm_context *dapm)
 {
        if (dapm->idle_bias) {
                struct snd_soc_component *component = snd_soc_dapm_to_component(dapm);
@@ -2193,6 +2193,7 @@ static bool dapm_get_idle_bias(struct snd_soc_dapm_context *dapm)
 
        return dapm->idle_bias;
 }
+EXPORT_SYMBOL_GPL(snd_soc_dapm_get_idle_bias);
 
 /*
  * Scan each dapm widget for complete audio path.
@@ -2219,7 +2220,7 @@ static int dapm_power_widgets(struct snd_soc_card *card, int event,
        trace_snd_soc_dapm_start(card, event);
 
        for_each_card_dapms(card, d) {
-               if (dapm_get_idle_bias(d))
+               if (snd_soc_dapm_get_idle_bias(d))
                        d->target_bias_level = SND_SOC_BIAS_STANDBY;
                else
                        d->target_bias_level = SND_SOC_BIAS_OFF;
@@ -2286,7 +2287,7 @@ static int dapm_power_widgets(struct snd_soc_card *card, int event,
                if (d->target_bias_level > bias)
                        bias = d->target_bias_level;
        for_each_card_dapms(card, d)
-               if (dapm_get_idle_bias(d))
+               if (snd_soc_dapm_get_idle_bias(d))
                        d->target_bias_level = bias;
 
        trace_snd_soc_dapm_walk_done(card);