MLK-21480: ASoC: wm8962: add constrain for configure bclk
authorShengjiu Wang <shengjiu.wang@nxp.com>
Thu, 9 May 2019 10:37:52 +0000 (18:37 +0800)
committerShengjiu Wang <shengjiu.wang@nxp.com>
Fri, 10 May 2019 02:36:33 +0000 (10:36 +0800)
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 <shengjiu.wang@nxp.com>
sound/soc/codecs/wm8962.c

index ddc549d..57311d2 100644 (file)
@@ -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: