ASoC: tlv320dac33: Avoid powering off while in BIAS_OFF
authorPeter Ujfalusi <peter.ujfalusi@nokia.com>
Mon, 17 May 2010 11:21:46 +0000 (14:21 +0300)
committerLiam Girdwood <lrg@slimlogic.co.uk>
Mon, 17 May 2010 19:34:15 +0000 (20:34 +0100)
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: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
sound/soc/codecs/tlv320dac33.c

index ad1795a83acbe4cb9d2496fcc42fc1aa2c1e8571..bcf6d934499abfb905ba61f1cced00a36b1947a4 100644 (file)
@@ -589,6 +589,9 @@ static int dac33_set_bias_level(struct snd_soc_codec *codec,
                }
                break;
        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);
                if (ret != 0)
                        return ret;