Skip to content

Commit 2e7f0a8

Browse files
morimotobroonie
authored andcommitted
ASoC: soc-dapm: add snd_soc_dapm_get_bias_level()
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>
1 parent 4b4fdc8 commit 2e7f0a8

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

include/sound/soc-dapm.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,8 @@ struct device *snd_soc_dapm_to_dev(struct snd_soc_dapm_context *dapm);
662662
struct snd_soc_card *snd_soc_dapm_to_card(struct snd_soc_dapm_context *dapm);
663663
struct snd_soc_component *snd_soc_dapm_to_component(struct snd_soc_dapm_context *dapm);
664664

665+
bool snd_soc_dapm_get_idle_bias(struct snd_soc_dapm_context *dapm);
666+
665667
/* dapm path setup */
666668
int snd_soc_dapm_new_widgets(struct snd_soc_card *card);
667669
void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm);

sound/soc/soc-dapm.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2180,7 +2180,7 @@ static void dapm_power_one_widget(struct snd_soc_dapm_widget *w,
21802180
dapm_seq_insert(w, down_list, false);
21812181
}
21822182

2183-
static bool dapm_get_idle_bias(struct snd_soc_dapm_context *dapm)
2183+
bool snd_soc_dapm_get_idle_bias(struct snd_soc_dapm_context *dapm)
21842184
{
21852185
if (dapm->idle_bias) {
21862186
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)
21932193

21942194
return dapm->idle_bias;
21952195
}
2196+
EXPORT_SYMBOL_GPL(snd_soc_dapm_get_idle_bias);
21962197

21972198
/*
21982199
* Scan each dapm widget for complete audio path.
@@ -2219,7 +2220,7 @@ static int dapm_power_widgets(struct snd_soc_card *card, int event,
22192220
trace_snd_soc_dapm_start(card, event);
22202221

22212222
for_each_card_dapms(card, d) {
2222-
if (dapm_get_idle_bias(d))
2223+
if (snd_soc_dapm_get_idle_bias(d))
22232224
d->target_bias_level = SND_SOC_BIAS_STANDBY;
22242225
else
22252226
d->target_bias_level = SND_SOC_BIAS_OFF;
@@ -2286,7 +2287,7 @@ static int dapm_power_widgets(struct snd_soc_card *card, int event,
22862287
if (d->target_bias_level > bias)
22872288
bias = d->target_bias_level;
22882289
for_each_card_dapms(card, d)
2289-
if (dapm_get_idle_bias(d))
2290+
if (snd_soc_dapm_get_idle_bias(d))
22902291
d->target_bias_level = bias;
22912292

22922293
trace_snd_soc_dapm_walk_done(card);

0 commit comments

Comments
 (0)