aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8523.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/wm8523.c')
-rw-r--r--sound/soc/codecs/wm8523.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm8523.c b/sound/soc/codecs/wm8523.c
index 9a433a5396cb..deca79ea2b4b 100644
--- a/sound/soc/codecs/wm8523.c
+++ b/sound/soc/codecs/wm8523.c
@@ -41,7 +41,6 @@ static const char *wm8523_supply_names[WM8523_NUM_SUPPLIES] = {
41/* codec private data */ 41/* codec private data */
42struct wm8523_priv { 42struct wm8523_priv {
43 enum snd_soc_control_type control_type; 43 enum snd_soc_control_type control_type;
44 u16 reg_cache[WM8523_REGISTER_COUNT];
45 struct regulator_bulk_data supplies[WM8523_NUM_SUPPLIES]; 44 struct regulator_bulk_data supplies[WM8523_NUM_SUPPLIES];
46 unsigned int sysclk; 45 unsigned int sysclk;
47 unsigned int rate_constraint_list[WM8523_NUM_RATES]; 46 unsigned int rate_constraint_list[WM8523_NUM_RATES];
@@ -314,6 +313,7 @@ static int wm8523_set_bias_level(struct snd_soc_codec *codec,
314 enum snd_soc_bias_level level) 313 enum snd_soc_bias_level level)
315{ 314{
316 struct wm8523_priv *wm8523 = snd_soc_codec_get_drvdata(codec); 315 struct wm8523_priv *wm8523 = snd_soc_codec_get_drvdata(codec);
316 u16 *reg_cache = codec->reg_cache;
317 int ret, i; 317 int ret, i;
318 318
319 switch (level) { 319 switch (level) {
@@ -344,7 +344,7 @@ static int wm8523_set_bias_level(struct snd_soc_codec *codec,
344 /* Sync back default/cached values */ 344 /* Sync back default/cached values */
345 for (i = WM8523_AIF_CTRL1; 345 for (i = WM8523_AIF_CTRL1;
346 i < WM8523_MAX_REGISTER; i++) 346 i < WM8523_MAX_REGISTER; i++)
347 snd_soc_write(codec, i, wm8523->reg_cache[i]); 347 snd_soc_write(codec, i, reg_cache[i]);
348 348
349 349
350 msleep(100); 350 msleep(100);
@@ -414,6 +414,7 @@ static int wm8523_resume(struct snd_soc_codec *codec)
414static int wm8523_probe(struct snd_soc_codec *codec) 414static int wm8523_probe(struct snd_soc_codec *codec)
415{ 415{
416 struct wm8523_priv *wm8523 = snd_soc_codec_get_drvdata(codec); 416 struct wm8523_priv *wm8523 = snd_soc_codec_get_drvdata(codec);
417 u16 *reg_cache = codec->reg_cache;
417 int ret, i; 418 int ret, i;
418 419
419 codec->hw_write = (hw_write_t)i2c_master_send; 420 codec->hw_write = (hw_write_t)i2c_master_send;
@@ -470,8 +471,8 @@ static int wm8523_probe(struct snd_soc_codec *codec)
470 } 471 }
471 472
472 /* Change some default settings - latch VU and enable ZC */ 473 /* Change some default settings - latch VU and enable ZC */
473 wm8523->reg_cache[WM8523_DAC_GAINR] |= WM8523_DACR_VU; 474 reg_cache[WM8523_DAC_GAINR] |= WM8523_DACR_VU;
474 wm8523->reg_cache[WM8523_DAC_CTRL3] |= WM8523_ZC; 475 reg_cache[WM8523_DAC_CTRL3] |= WM8523_ZC;
475 476
476 wm8523_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 477 wm8523_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
477 478