Merge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[deliverable/linux.git] / sound / soc / codecs / tlv320dac33.c
index 68b7ccbf2e7c40998d9109612b4bed81d0b128b3..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>
@@ -303,21 +304,10 @@ static void dac33_init_chip(struct snd_soc_codec *codec)
        /* C : (defaults) */
        dac33_write(codec, DAC33_DAC_CTRL_C, 0x00);
 
-       /* 64-65 : L&R DAC power control
-        Line In -> OUT 1V/V Gain, DAC -> OUT 4V/V Gain*/
-       dac33_write(codec, DAC33_LDAC_PWR_CTRL, DAC33_LROUT_GAIN(2));
-       dac33_write(codec, DAC33_RDAC_PWR_CTRL, DAC33_LROUT_GAIN(2));
-
        /* 73 : volume soft stepping control,
         clock source = internal osc (?) */
        dac33_write(codec, DAC33_ANA_VOL_SOFT_STEP_CTRL, DAC33_VOLCLKEN);
 
-       /* 66 : LOP/LOM Modes */
-       dac33_write(codec, DAC33_OUT_AMP_CM_CTRL, 0xff);
-
-       /* 68 : LOM inverted from LOP */
-       dac33_write(codec, DAC33_OUT_AMP_CTRL, (3<<2));
-
        dac33_write(codec, DAC33_PWR_CTRL, DAC33_PDNALLB);
 
        /* Restore only selected registers (gains mostly) */
@@ -363,7 +353,7 @@ static int dac33_hard_power(struct snd_soc_codec *codec, int power)
 
        /* Safety check */
        if (unlikely(power == dac33->chip_power)) {
-               dev_warn(codec->dev, "Trying to set the same power state: %s\n",
+               dev_dbg(codec->dev, "Trying to set the same power state: %s\n",
                        power ? "ON" : "OFF");
                goto exit;
        }
@@ -600,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;
@@ -1397,9 +1390,6 @@ static int dac33_soc_resume(struct platform_device *pdev)
        struct snd_soc_codec *codec = socdev->card->codec;
 
        dac33_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-       if (codec->suspend_bias_level == SND_SOC_BIAS_ON)
-               dac33_set_bias_level(codec, SND_SOC_BIAS_PREPARE);
-       dac33_set_bias_level(codec, codec->suspend_bias_level);
 
        return 0;
 }
This page took 0.07034 seconds and 5 git commands to generate.