Merge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[deliverable/linux.git] / sound / soc / codecs / tlv320dac33.c
index ad1795a83acbe4cb9d2496fcc42fc1aa2c1e8571..65adc77eada1039e562af90d298793712b358ae6 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/interrupt.h>
 #include <linux/gpio.h>
 #include <linux/regulator/consumer.h>
+#include <linux/slab.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
@@ -589,6 +590,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;
This page took 0.024096 seconds and 5 git commands to generate.