diff options
Diffstat (limited to 'sound/soc/codecs/wm9090.c')
-rw-r--r-- | sound/soc/codecs/wm9090.c | 45 |
1 files changed, 26 insertions, 19 deletions
diff --git a/sound/soc/codecs/wm9090.c b/sound/soc/codecs/wm9090.c index a788c4297046..4de12203e611 100644 --- a/sound/soc/codecs/wm9090.c +++ b/sound/soc/codecs/wm9090.c | |||
@@ -144,7 +144,7 @@ struct wm9090_priv { | |||
144 | void *control_data; | 144 | void *control_data; |
145 | }; | 145 | }; |
146 | 146 | ||
147 | static int wm9090_volatile(unsigned int reg) | 147 | static int wm9090_volatile(struct snd_soc_codec *codec, unsigned int reg) |
148 | { | 148 | { |
149 | switch (reg) { | 149 | switch (reg) { |
150 | case WM9090_SOFTWARE_RESET: | 150 | case WM9090_SOFTWARE_RESET: |
@@ -518,7 +518,7 @@ static int wm9090_set_bias_level(struct snd_soc_codec *codec, | |||
518 | for (i = 1; i < codec->driver->reg_cache_size; i++) { | 518 | for (i = 1; i < codec->driver->reg_cache_size; i++) { |
519 | if (reg_cache[i] == wm9090_reg_defaults[i]) | 519 | if (reg_cache[i] == wm9090_reg_defaults[i]) |
520 | continue; | 520 | continue; |
521 | if (wm9090_volatile(i)) | 521 | if (wm9090_volatile(codec, i)) |
522 | continue; | 522 | continue; |
523 | 523 | ||
524 | ret = snd_soc_write(codec, i, reg_cache[i]); | 524 | ret = snd_soc_write(codec, i, reg_cache[i]); |
@@ -551,7 +551,6 @@ static int wm9090_set_bias_level(struct snd_soc_codec *codec, | |||
551 | static int wm9090_probe(struct snd_soc_codec *codec) | 551 | static int wm9090_probe(struct snd_soc_codec *codec) |
552 | { | 552 | { |
553 | struct wm9090_priv *wm9090 = snd_soc_codec_get_drvdata(codec); | 553 | struct wm9090_priv *wm9090 = snd_soc_codec_get_drvdata(codec); |
554 | u16 *reg_cache = codec->reg_cache; | ||
555 | int ret; | 554 | int ret; |
556 | 555 | ||
557 | codec->control_data = wm9090->control_data; | 556 | codec->control_data = wm9090->control_data; |
@@ -576,22 +575,30 @@ static int wm9090_probe(struct snd_soc_codec *codec) | |||
576 | /* Configure some defaults; they will be written out when we | 575 | /* Configure some defaults; they will be written out when we |
577 | * bring the bias up. | 576 | * bring the bias up. |
578 | */ | 577 | */ |
579 | reg_cache[WM9090_IN1_LINE_INPUT_A_VOLUME] |= WM9090_IN1_VU | 578 | snd_soc_update_bits(codec, WM9090_IN1_LINE_INPUT_A_VOLUME, |
580 | | WM9090_IN1A_ZC; | 579 | WM9090_IN1_VU | WM9090_IN1A_ZC, |
581 | reg_cache[WM9090_IN1_LINE_INPUT_B_VOLUME] |= WM9090_IN1_VU | 580 | WM9090_IN1_VU | WM9090_IN1A_ZC); |
582 | | WM9090_IN1B_ZC; | 581 | snd_soc_update_bits(codec, WM9090_IN1_LINE_INPUT_B_VOLUME, |
583 | reg_cache[WM9090_IN2_LINE_INPUT_A_VOLUME] |= WM9090_IN2_VU | 582 | WM9090_IN1_VU | WM9090_IN1B_ZC, |
584 | | WM9090_IN2A_ZC; | 583 | WM9090_IN1_VU | WM9090_IN1B_ZC); |
585 | reg_cache[WM9090_IN2_LINE_INPUT_B_VOLUME] |= WM9090_IN2_VU | 584 | snd_soc_update_bits(codec, WM9090_IN2_LINE_INPUT_A_VOLUME, |
586 | | WM9090_IN2B_ZC; | 585 | WM9090_IN2_VU | WM9090_IN2A_ZC, |
587 | reg_cache[WM9090_SPEAKER_VOLUME_LEFT] |= | 586 | WM9090_IN2_VU | WM9090_IN2A_ZC); |
588 | WM9090_SPKOUT_VU | WM9090_SPKOUTL_ZC; | 587 | snd_soc_update_bits(codec, WM9090_IN2_LINE_INPUT_B_VOLUME, |
589 | reg_cache[WM9090_LEFT_OUTPUT_VOLUME] |= | 588 | WM9090_IN2_VU | WM9090_IN2B_ZC, |
590 | WM9090_HPOUT1_VU | WM9090_HPOUT1L_ZC; | 589 | WM9090_IN2_VU | WM9090_IN2B_ZC); |
591 | reg_cache[WM9090_RIGHT_OUTPUT_VOLUME] |= | 590 | snd_soc_update_bits(codec, WM9090_SPEAKER_VOLUME_LEFT, |
592 | WM9090_HPOUT1_VU | WM9090_HPOUT1R_ZC; | 591 | WM9090_SPKOUT_VU | WM9090_SPKOUTL_ZC, |
593 | 592 | WM9090_SPKOUT_VU | WM9090_SPKOUTL_ZC); | |
594 | reg_cache[WM9090_CLOCKING_1] |= WM9090_TOCLK_ENA; | 593 | snd_soc_update_bits(codec, WM9090_LEFT_OUTPUT_VOLUME, |
594 | WM9090_HPOUT1_VU | WM9090_HPOUT1L_ZC, | ||
595 | WM9090_HPOUT1_VU | WM9090_HPOUT1L_ZC); | ||
596 | snd_soc_update_bits(codec, WM9090_RIGHT_OUTPUT_VOLUME, | ||
597 | WM9090_HPOUT1_VU | WM9090_HPOUT1R_ZC, | ||
598 | WM9090_HPOUT1_VU | WM9090_HPOUT1R_ZC); | ||
599 | |||
600 | snd_soc_update_bits(codec, WM9090_CLOCKING_1, | ||
601 | WM9090_TOCLK_ENA, WM9090_TOCLK_ENA); | ||
595 | 602 | ||
596 | wm9090_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 603 | wm9090_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
597 | 604 | ||