Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2d4cdd6f authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Liam Girdwood
Browse files

ASoC: tlv320dac33: Avoid powering off while in BIAS_OFF



Avoid calling the dac33_hard_power when the codec was
already in BIAS_OFF state.
This could happen in device suspend and module removal
time.

Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent 7fd1d74b
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -589,6 +589,9 @@ static int dac33_set_bias_level(struct snd_soc_codec *codec,
		}
		}
		break;
		break;
	case SND_SOC_BIAS_OFF:
	case SND_SOC_BIAS_OFF:
		/* Do not power off, when the codec is already off */
		if (codec->bias_level == SND_SOC_BIAS_OFF)
			return 0;
		ret = dac33_hard_power(codec, 0);
		ret = dac33_hard_power(codec, 0);
		if (ret != 0)
		if (ret != 0)
			return ret;
			return ret;