diff options
| -rw-r--r-- | sound/soc/codecs/wm8994.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 2dc9daa95bed..522249d5c2b4 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c | |||
| @@ -95,6 +95,7 @@ struct wm8994_priv { | |||
| 95 | 95 | ||
| 96 | struct wm8994_micdet micdet[2]; | 96 | struct wm8994_micdet micdet[2]; |
| 97 | 97 | ||
| 98 | int revision; | ||
| 98 | struct wm8994_pdata *pdata; | 99 | struct wm8994_pdata *pdata; |
| 99 | }; | 100 | }; |
| 100 | 101 | ||
| @@ -3070,6 +3071,8 @@ static int wm8994_set_dai_sysclk(struct snd_soc_dai *dai, | |||
| 3070 | static int wm8994_set_bias_level(struct snd_soc_codec *codec, | 3071 | static int wm8994_set_bias_level(struct snd_soc_codec *codec, |
| 3071 | enum snd_soc_bias_level level) | 3072 | enum snd_soc_bias_level level) |
| 3072 | { | 3073 | { |
| 3074 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | ||
| 3075 | |||
| 3073 | switch (level) { | 3076 | switch (level) { |
| 3074 | case SND_SOC_BIAS_ON: | 3077 | case SND_SOC_BIAS_ON: |
| 3075 | break; | 3078 | break; |
| @@ -3084,10 +3087,14 @@ static int wm8994_set_bias_level(struct snd_soc_codec *codec, | |||
| 3084 | if (codec->bias_level == SND_SOC_BIAS_OFF) { | 3087 | if (codec->bias_level == SND_SOC_BIAS_OFF) { |
| 3085 | /* Tweak DC servo and DSP configuration for | 3088 | /* Tweak DC servo and DSP configuration for |
| 3086 | * improved performance. */ | 3089 | * improved performance. */ |
| 3087 | snd_soc_write(codec, 0x102, 0x3); | 3090 | if (wm8994->revision < 4) { |
| 3088 | snd_soc_write(codec, 0x56, 0x3); | 3091 | /* Tweak DC servo and DSP configuration for |
| 3089 | snd_soc_write(codec, 0x817, 0); | 3092 | * improved performance. */ |
| 3090 | snd_soc_write(codec, 0x102, 0); | 3093 | snd_soc_write(codec, 0x102, 0x3); |
| 3094 | snd_soc_write(codec, 0x56, 0x3); | ||
| 3095 | snd_soc_write(codec, 0x817, 0); | ||
| 3096 | snd_soc_write(codec, 0x102, 0); | ||
| 3097 | } | ||
| 3091 | 3098 | ||
| 3092 | /* Discharge LINEOUT1 & 2 */ | 3099 | /* Discharge LINEOUT1 & 2 */ |
| 3093 | snd_soc_update_bits(codec, WM8994_ANTIPOP_1, | 3100 | snd_soc_update_bits(codec, WM8994_ANTIPOP_1, |
| @@ -3920,7 +3927,6 @@ static int wm8994_codec_probe(struct platform_device *pdev) | |||
| 3920 | struct wm8994_priv *wm8994; | 3927 | struct wm8994_priv *wm8994; |
| 3921 | struct snd_soc_codec *codec; | 3928 | struct snd_soc_codec *codec; |
| 3922 | int i; | 3929 | int i; |
| 3923 | u16 rev; | ||
| 3924 | 3930 | ||
| 3925 | if (wm8994_codec) { | 3931 | if (wm8994_codec) { |
| 3926 | dev_err(&pdev->dev, "Another WM8994 is registered\n"); | 3932 | dev_err(&pdev->dev, "Another WM8994 is registered\n"); |
| @@ -3974,8 +3980,8 @@ static int wm8994_codec_probe(struct platform_device *pdev) | |||
| 3974 | wm8994->reg_cache[i] = 0; | 3980 | wm8994->reg_cache[i] = 0; |
| 3975 | 3981 | ||
| 3976 | /* Set revision-specific configuration */ | 3982 | /* Set revision-specific configuration */ |
| 3977 | rev = snd_soc_read(codec, WM8994_CHIP_REVISION); | 3983 | wm8994->revision = snd_soc_read(codec, WM8994_CHIP_REVISION); |
| 3978 | switch (rev) { | 3984 | switch (wm8994->revision) { |
| 3979 | case 2: | 3985 | case 2: |
| 3980 | case 3: | 3986 | case 3: |
| 3981 | wm8994->hubs.dcs_codes = -5; | 3987 | wm8994->hubs.dcs_codes = -5; |
