diff options
Diffstat (limited to 'sound/soc/codecs/wm8962.c')
-rw-r--r-- | sound/soc/codecs/wm8962.c | 38 |
1 files changed, 8 insertions, 30 deletions
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c index 60d740ebeb5b..d2c315fa1b9b 100644 --- a/sound/soc/codecs/wm8962.c +++ b/sound/soc/codecs/wm8962.c | |||
@@ -2221,6 +2221,8 @@ static int sysclk_event(struct snd_soc_dapm_widget *w, | |||
2221 | switch (event) { | 2221 | switch (event) { |
2222 | case SND_SOC_DAPM_PRE_PMU: | 2222 | case SND_SOC_DAPM_PRE_PMU: |
2223 | if (fll) { | 2223 | if (fll) { |
2224 | try_wait_for_completion(&wm8962->fll_lock); | ||
2225 | |||
2224 | snd_soc_update_bits(codec, WM8962_FLL_CONTROL_1, | 2226 | snd_soc_update_bits(codec, WM8962_FLL_CONTROL_1, |
2225 | WM8962_FLL_ENA, WM8962_FLL_ENA); | 2227 | WM8962_FLL_ENA, WM8962_FLL_ENA); |
2226 | if (wm8962->irq) { | 2228 | if (wm8962->irq) { |
@@ -2927,10 +2929,6 @@ static int wm8962_set_bias_level(struct snd_soc_codec *codec, | |||
2927 | WM8962_BIAS_ENA | 0x180); | 2929 | WM8962_BIAS_ENA | 0x180); |
2928 | 2930 | ||
2929 | msleep(5); | 2931 | msleep(5); |
2930 | |||
2931 | snd_soc_update_bits(codec, WM8962_CLOCKING2, | ||
2932 | WM8962_CLKREG_OVD, | ||
2933 | WM8962_CLKREG_OVD); | ||
2934 | } | 2932 | } |
2935 | 2933 | ||
2936 | /* VMID 2*250k */ | 2934 | /* VMID 2*250k */ |
@@ -3288,6 +3286,8 @@ static int wm8962_set_fll(struct snd_soc_codec *codec, int fll_id, int source, | |||
3288 | snd_soc_write(codec, WM8962_FLL_CONTROL_7, fll_div.lambda); | 3286 | snd_soc_write(codec, WM8962_FLL_CONTROL_7, fll_div.lambda); |
3289 | snd_soc_write(codec, WM8962_FLL_CONTROL_8, fll_div.n); | 3287 | snd_soc_write(codec, WM8962_FLL_CONTROL_8, fll_div.n); |
3290 | 3288 | ||
3289 | try_wait_for_completion(&wm8962->fll_lock); | ||
3290 | |||
3291 | snd_soc_update_bits(codec, WM8962_FLL_CONTROL_1, | 3291 | snd_soc_update_bits(codec, WM8962_FLL_CONTROL_1, |
3292 | WM8962_FLL_FRAC | WM8962_FLL_REFCLK_SRC_MASK | | 3292 | WM8962_FLL_FRAC | WM8962_FLL_REFCLK_SRC_MASK | |
3293 | WM8962_FLL_ENA, fll1); | 3293 | WM8962_FLL_ENA, fll1); |
@@ -3479,31 +3479,6 @@ int wm8962_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack) | |||
3479 | } | 3479 | } |
3480 | EXPORT_SYMBOL_GPL(wm8962_mic_detect); | 3480 | EXPORT_SYMBOL_GPL(wm8962_mic_detect); |
3481 | 3481 | ||
3482 | #ifdef CONFIG_PM | ||
3483 | static int wm8962_resume(struct snd_soc_codec *codec) | ||
3484 | { | ||
3485 | u16 *reg_cache = codec->reg_cache; | ||
3486 | int i; | ||
3487 | |||
3488 | /* Restore the registers */ | ||
3489 | for (i = 1; i < codec->driver->reg_cache_size; i++) { | ||
3490 | switch (i) { | ||
3491 | case WM8962_SOFTWARE_RESET: | ||
3492 | continue; | ||
3493 | default: | ||
3494 | break; | ||
3495 | } | ||
3496 | |||
3497 | if (reg_cache[i] != wm8962_reg[i]) | ||
3498 | snd_soc_write(codec, i, reg_cache[i]); | ||
3499 | } | ||
3500 | |||
3501 | return 0; | ||
3502 | } | ||
3503 | #else | ||
3504 | #define wm8962_resume NULL | ||
3505 | #endif | ||
3506 | |||
3507 | #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE) | 3482 | #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE) |
3508 | static int beep_rates[] = { | 3483 | static int beep_rates[] = { |
3509 | 500, 1000, 2000, 4000, | 3484 | 500, 1000, 2000, 4000, |
@@ -3868,6 +3843,10 @@ static int wm8962_probe(struct snd_soc_codec *codec) | |||
3868 | */ | 3843 | */ |
3869 | snd_soc_update_bits(codec, WM8962_CLOCKING2, WM8962_SYSCLK_ENA, 0); | 3844 | snd_soc_update_bits(codec, WM8962_CLOCKING2, WM8962_SYSCLK_ENA, 0); |
3870 | 3845 | ||
3846 | /* Ensure we have soft control over all registers */ | ||
3847 | snd_soc_update_bits(codec, WM8962_CLOCKING2, | ||
3848 | WM8962_CLKREG_OVD, WM8962_CLKREG_OVD); | ||
3849 | |||
3871 | regulator_bulk_disable(ARRAY_SIZE(wm8962->supplies), wm8962->supplies); | 3850 | regulator_bulk_disable(ARRAY_SIZE(wm8962->supplies), wm8962->supplies); |
3872 | 3851 | ||
3873 | if (pdata) { | 3852 | if (pdata) { |
@@ -4011,7 +3990,6 @@ static int wm8962_remove(struct snd_soc_codec *codec) | |||
4011 | static struct snd_soc_codec_driver soc_codec_dev_wm8962 = { | 3990 | static struct snd_soc_codec_driver soc_codec_dev_wm8962 = { |
4012 | .probe = wm8962_probe, | 3991 | .probe = wm8962_probe, |
4013 | .remove = wm8962_remove, | 3992 | .remove = wm8962_remove, |
4014 | .resume = wm8962_resume, | ||
4015 | .set_bias_level = wm8962_set_bias_level, | 3993 | .set_bias_level = wm8962_set_bias_level, |
4016 | .reg_cache_size = WM8962_MAX_REGISTER + 1, | 3994 | .reg_cache_size = WM8962_MAX_REGISTER + 1, |
4017 | .reg_word_size = sizeof(u16), | 3995 | .reg_word_size = sizeof(u16), |