From fcdbe09cf8526a9df8c5020c0e605726bd1c10de Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Fri, 13 Aug 2010 12:58:20 +0100 Subject: [PATCH] --- yaml --- r: 209463 b: refs/heads/master c: b6b056911af54b40a996fdb751d441158d8078b6 h: refs/heads/master i: 209461: ab867ce29d25f2578c646cf06d94a26c76b03ef7 209459: 5ddf4470287e5fe9f20aeda0680e8b60f31d8252 209455: 5ad9592f1a66e18646af3360bd4d54148b5bc8f1 v: v3 --- [refs] | 2 +- trunk/sound/soc/codecs/wm8994.c | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index ae55ba6fd52d..14afaffdd099 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0c17b393942e4363061b61ca58f4d35a01b41ab3 +refs/heads/master: b6b056911af54b40a996fdb751d441158d8078b6 diff --git a/trunk/sound/soc/codecs/wm8994.c b/trunk/sound/soc/codecs/wm8994.c index 2dc9daa95bed..522249d5c2b4 100644 --- a/trunk/sound/soc/codecs/wm8994.c +++ b/trunk/sound/soc/codecs/wm8994.c @@ -95,6 +95,7 @@ struct wm8994_priv { struct wm8994_micdet micdet[2]; + int revision; struct wm8994_pdata *pdata; }; @@ -3070,6 +3071,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; @@ -3084,10 +3087,14 @@ static int wm8994_set_bias_level(struct snd_soc_codec *codec, if (codec->bias_level == SND_SOC_BIAS_OFF) { /* 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); + 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, @@ -3920,7 +3927,6 @@ static int wm8994_codec_probe(struct platform_device *pdev) struct wm8994_priv *wm8994; struct snd_soc_codec *codec; int i; - u16 rev; if (wm8994_codec) { dev_err(&pdev->dev, "Another WM8994 is registered\n"); @@ -3974,8 +3980,8 @@ static int wm8994_codec_probe(struct platform_device *pdev) 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;