]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - sound/soc/codecs/wm8994.c
Merge branch 'for-2.6.36' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
[net-next-2.6.git] / sound / soc / codecs / wm8994.c
index 7823f92413f3902d855dce07a3c258c2a6af1f28..76a066e908ed6311780b2a246c9200c149247317 100644 (file)
@@ -94,6 +94,7 @@ struct wm8994_priv {
 
        struct wm8994_micdet micdet[2];
 
+       int revision;
        struct wm8994_pdata *pdata;
 };
 
@@ -3073,6 +3074,8 @@ static int wm8994_set_dai_sysclk(struct snd_soc_dai *dai,
 static int wm8994_set_bias_level(struct snd_soc_codec *codec,
                                 enum snd_soc_bias_level level)
 {
+       struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
+
        switch (level) {
        case SND_SOC_BIAS_ON:
                break;
@@ -3085,11 +3088,16 @@ static int wm8994_set_bias_level(struct snd_soc_codec *codec,
 
        case SND_SOC_BIAS_STANDBY:
                if (codec->bias_level == SND_SOC_BIAS_OFF) {
-                       /* Tweak DC servo configuration for improved
-                        * performance. */
-                       snd_soc_write(codec, 0x102, 0x3);
-                       snd_soc_write(codec, 0x56, 0x3);
-                       snd_soc_write(codec, 0x102, 0);
+                       /* Tweak DC servo and DSP configuration for
+                        * improved performance. */
+                       if (wm8994->revision < 4) {
+                               /* Tweak DC servo and DSP configuration for
+                                * improved performance. */
+                               snd_soc_write(codec, 0x102, 0x3);
+                               snd_soc_write(codec, 0x56, 0x3);
+                               snd_soc_write(codec, 0x817, 0);
+                               snd_soc_write(codec, 0x102, 0);
+                       }
 
                        /* Discharge LINEOUT1 & 2 */
                        snd_soc_update_bits(codec, WM8994_ANTIPOP_1,
@@ -3859,7 +3867,7 @@ static irqreturn_t wm8994_mic_irq(int irq, void *data)
 static int wm8994_codec_probe(struct snd_soc_codec *codec)
 {
        struct wm8994_priv *wm8994;
-       int ret, i, rev;
+       int ret, i;
 
        codec->control_data = dev_get_drvdata(codec->dev->parent);
 
@@ -3889,8 +3897,8 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec)
                        wm8994->reg_cache[i] = 0;
 
        /* Set revision-specific configuration */
-       rev = snd_soc_read(codec, WM8994_CHIP_REVISION);
-       switch (rev) {
+       wm8994->revision = snd_soc_read(codec, WM8994_CHIP_REVISION);
+       switch (wm8994->revision) {
        case 2:
        case 3:
                wm8994->hubs.dcs_codes = -5;