Skip to content

Commit f40ecc2

Browse files
morimotobroonie
authored andcommitted
ASoC: soc-dapm: set bias_level if snd_soc_dapm_set_bias_level() was successed
ASoC has 2 functions to set bias level. (A) snd_soc_dapm_force_bias_level() (B) snd_soc_dapm_set_bias_level() snd_soc_dapm_force_bias_level() (A) will set dapm->bias_level (a) if successed. (A) int snd_soc_dapm_force_bias_level(...) { ... if (ret == 0) (a) dapm->bias_level = level; ... } snd_soc_dapm_set_bias_level() (B) is also a function that sets bias_level. It will call snd_soc_dapm_force_bias_level() (A) inside, but doesn't set dapm->bias_level by itself. One note is that (A) might not be called. (B) static int snd_soc_dapm_set_bias_level(...) { ... ret = snd_soc_card_set_bias_level(...); ... if (dapm != &card->dapm) (A) ret = snd_soc_dapm_force_bias_level(...); ... ret = snd_soc_card_set_bias_level_post(...); ... } dapm->bias_level will be set if (A) was called, but might not be set if (B) was called, even though it calles set_bias_level() function. We should set dapm->bias_level if we calls snd_soc_dapm_set_bias_level() (B), too. Signed-off-by: Kuninori Morimoto <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent ad46556 commit f40ecc2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sound/soc/soc-dapm.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,6 +1030,10 @@ static int snd_soc_dapm_set_bias_level(struct snd_soc_dapm_context *dapm,
10301030
out:
10311031
trace_snd_soc_bias_level_done(dapm, level);
10321032

1033+
/* success */
1034+
if (ret == 0)
1035+
snd_soc_dapm_init_bias_level(dapm, level);
1036+
10331037
return ret;
10341038
}
10351039

0 commit comments

Comments
 (0)