From ecacf0a022f3c6f9c99e8434c24cc473a6b76af8 Mon Sep 17 00:00:00 2001 From: Shengjiu Wang Date: Thu, 9 May 2019 18:37:52 +0800 Subject: [PATCH] MLK-21480: ASoC: wm8962: add constrain for configure bclk There is error log when suspend & resume wm8962 3-001a: Failed to read DSPCLK: -1 when suspend the pm_runtime_suspend is called before the set_bias_level. so in the wm8962_configure_bclk there is failure when trying to read a volatile register for we have enabled regcache_cache_only. To avoid such issue, we can avoid to call set_bias_level when the level change from SND_SOC_BIAS_ON to SND_SOC_BIAS_PREPARE, for this flow is for disabling the codec. Signed-off-by: Shengjiu Wang --- sound/soc/codecs/wm8962.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c index ddc549dda01b..57311d225a72 100644 --- a/sound/soc/codecs/wm8962.c +++ b/sound/soc/codecs/wm8962.c @@ -2521,7 +2521,9 @@ static int wm8962_set_bias_level(struct snd_soc_component *component, snd_soc_component_update_bits(component, WM8962_PWR_MGMT_1, WM8962_VMID_SEL_MASK, 0x80); - wm8962_configure_bclk(component); + if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_STANDBY) + wm8962_configure_bclk(component); + break; case SND_SOC_BIAS_STANDBY: -- 2.17.1