summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2025-09-04 05:21:37 +0000
committerMark Brown <broonie@kernel.org>2025-09-18 22:24:16 +0100
commit4b4fdc8b75a902eeb7441dff1876c2bb31c7715f (patch)
tree94675a6b64d428ec03d53e61d58ac465f28e9377
parent889dd56f8c03586e5489050e7457a405fae6a420 (diff)
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>
-rw-r--r--sound/soc/soc-dapm.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index cbe945f1dc9c..a263696ef8ac 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -2182,21 +2182,16 @@ end:
static bool dapm_get_idle_bias(struct snd_soc_dapm_context *dapm)
{
- struct snd_soc_component *component = snd_soc_dapm_to_component(dapm);
- if (!dapm->idle_bias)
- return false;
+ if (dapm->idle_bias) {
+ struct snd_soc_component *component = snd_soc_dapm_to_component(dapm);
+ unsigned int state = snd_power_get_state(dapm->card->snd_card);
- switch (snd_power_get_state(dapm->card->snd_card)) {
- case SNDRV_CTL_POWER_D3hot:
- case SNDRV_CTL_POWER_D3cold:
- if (component)
+ if ((state == SNDRV_CTL_POWER_D3hot || (state == SNDRV_CTL_POWER_D3cold)) &&
+ component)
return !component->driver->suspend_bias_off;
- fallthrough;
- default:
- break;
}
- return true;
+ return dapm->idle_bias;
}
/*