aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm9081.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/wm9081.c')
-rw-r--r--sound/soc/codecs/wm9081.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sound/soc/codecs/wm9081.c b/sound/soc/codecs/wm9081.c
index a486670966bd..43825b2102a5 100644
--- a/sound/soc/codecs/wm9081.c
+++ b/sound/soc/codecs/wm9081.c
@@ -23,7 +23,6 @@
23#include <sound/pcm.h> 23#include <sound/pcm.h>
24#include <sound/pcm_params.h> 24#include <sound/pcm_params.h>
25#include <sound/soc.h> 25#include <sound/soc.h>
26#include <sound/soc-dapm.h>
27#include <sound/initval.h> 26#include <sound/initval.h>
28#include <sound/tlv.h> 27#include <sound/tlv.h>
29 28
@@ -158,7 +157,6 @@ static struct {
158struct wm9081_priv { 157struct wm9081_priv {
159 enum snd_soc_control_type control_type; 158 enum snd_soc_control_type control_type;
160 void *control_data; 159 void *control_data;
161 u16 reg_cache[WM9081_MAX_REGISTER + 1];
162 int sysclk_source; 160 int sysclk_source;
163 int mclk_rate; 161 int mclk_rate;
164 int sysclk_rate; 162 int sysclk_rate;
@@ -591,6 +589,10 @@ static int wm9081_set_fll(struct snd_soc_codec *codec, int fll_id,
591 reg5 |= fll_div.fll_clk_ref_div << WM9081_FLL_CLK_REF_DIV_SHIFT; 589 reg5 |= fll_div.fll_clk_ref_div << WM9081_FLL_CLK_REF_DIV_SHIFT;
592 snd_soc_write(codec, WM9081_FLL_CONTROL_5, reg5); 590 snd_soc_write(codec, WM9081_FLL_CONTROL_5, reg5);
593 591
592 /* Set gain to the recommended value */
593 snd_soc_update_bits(codec, WM9081_FLL_CONTROL_4,
594 WM9081_FLL_GAIN_MASK, 0);
595
594 /* Enable the FLL */ 596 /* Enable the FLL */
595 snd_soc_write(codec, WM9081_FLL_CONTROL_1, reg1 | WM9081_FLL_ENA); 597 snd_soc_write(codec, WM9081_FLL_CONTROL_1, reg1 | WM9081_FLL_ENA);
596 598
@@ -805,7 +807,7 @@ static int wm9081_set_bias_level(struct snd_soc_codec *codec,
805 807
806 case SND_SOC_BIAS_STANDBY: 808 case SND_SOC_BIAS_STANDBY:
807 /* Initial cold start */ 809 /* Initial cold start */
808 if (codec->bias_level == SND_SOC_BIAS_OFF) { 810 if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) {
809 /* Disable LINEOUT discharge */ 811 /* Disable LINEOUT discharge */
810 reg = snd_soc_read(codec, WM9081_ANTI_POP_CONTROL); 812 reg = snd_soc_read(codec, WM9081_ANTI_POP_CONTROL);
811 reg &= ~WM9081_LINEOUT_DISCH; 813 reg &= ~WM9081_LINEOUT_DISCH;
@@ -865,7 +867,7 @@ static int wm9081_set_bias_level(struct snd_soc_codec *codec,
865 break; 867 break;
866 } 868 }
867 869
868 codec->bias_level = level; 870 codec->dapm.bias_level = level;
869 871
870 return 0; 872 return 0;
871} 873}
@@ -1228,6 +1230,7 @@ static struct snd_soc_dai_driver wm9081_dai = {
1228static int wm9081_probe(struct snd_soc_codec *codec) 1230static int wm9081_probe(struct snd_soc_codec *codec)
1229{ 1231{
1230 struct wm9081_priv *wm9081 = snd_soc_codec_get_drvdata(codec); 1232 struct wm9081_priv *wm9081 = snd_soc_codec_get_drvdata(codec);
1233 struct snd_soc_dapm_context *dapm = &codec->dapm;
1231 int ret; 1234 int ret;
1232 u16 reg; 1235 u16 reg;
1233 1236
@@ -1269,9 +1272,9 @@ static int wm9081_probe(struct snd_soc_codec *codec)
1269 ARRAY_SIZE(wm9081_eq_controls)); 1272 ARRAY_SIZE(wm9081_eq_controls));
1270 } 1273 }
1271 1274
1272 snd_soc_dapm_new_controls(codec, wm9081_dapm_widgets, 1275 snd_soc_dapm_new_controls(dapm, wm9081_dapm_widgets,
1273 ARRAY_SIZE(wm9081_dapm_widgets)); 1276 ARRAY_SIZE(wm9081_dapm_widgets));
1274 snd_soc_dapm_add_routes(codec, audio_paths, ARRAY_SIZE(audio_paths)); 1277 snd_soc_dapm_add_routes(dapm, audio_paths, ARRAY_SIZE(audio_paths));
1275 1278
1276 return ret; 1279 return ret;
1277} 1280}