Skip to content

Commit 4b4fdc8

Browse files
morimotobroonie
authored andcommitted
ASoC: soc-dapm: tidyup idle_bias handling - step2
Current dapm_get_idle_bias() is unnecessarily complicated/confusable. Tidyup it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/873492x066.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 889dd56 commit 4b4fdc8

1 file changed

Lines changed: 6 additions & 11 deletions

File tree

sound/soc/soc-dapm.c

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2182,21 +2182,16 @@ static void dapm_power_one_widget(struct snd_soc_dapm_widget *w,
21822182

21832183
static bool dapm_get_idle_bias(struct snd_soc_dapm_context *dapm)
21842184
{
2185-
struct snd_soc_component *component = snd_soc_dapm_to_component(dapm);
2186-
if (!dapm->idle_bias)
2187-
return false;
2185+
if (dapm->idle_bias) {
2186+
struct snd_soc_component *component = snd_soc_dapm_to_component(dapm);
2187+
unsigned int state = snd_power_get_state(dapm->card->snd_card);
21882188

2189-
switch (snd_power_get_state(dapm->card->snd_card)) {
2190-
case SNDRV_CTL_POWER_D3hot:
2191-
case SNDRV_CTL_POWER_D3cold:
2192-
if (component)
2189+
if ((state == SNDRV_CTL_POWER_D3hot || (state == SNDRV_CTL_POWER_D3cold)) &&
2190+
component)
21932191
return !component->driver->suspend_bias_off;
2194-
fallthrough;
2195-
default:
2196-
break;
21972192
}
21982193

2199-
return true;
2194+
return dapm->idle_bias;
22002195
}
22012196

22022197
/*

0 commit comments

Comments
 (0)