Unverified Commit 4b4fdc8b authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown
Browse files

ASoC: soc-dapm: tidyup idle_bias handling - step2



Current dapm_get_idle_bias() is unnecessarily complicated/confusable.
Tidyup it.

Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/873492x066.wl-kuninori.morimoto.gx@renesas.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 889dd56f
Loading
Loading
Loading
Loading
+6 −11
Original line number Diff line number Diff line
@@ -2182,21 +2182,16 @@ static void dapm_power_one_widget(struct snd_soc_dapm_widget *w,

static bool 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);
	if (!dapm->idle_bias)
		return false;
		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;
}

/*