summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/wm8904.c
diff options
context:
space:
mode:
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>2018-12-19 23:11:16 +0300
committerMark Brown <broonie@kernel.org>2019-01-03 19:34:06 +0300
commit5489e81f981b1fb7c2fdaba332122fff3290e9a4 (patch)
tree3e7a3aa03b0d1b366aa106eb3c684ae8ad2b1446 /sound/soc/codecs/wm8904.c
parentfb82c6ed31902e651cc9324108f507babfabc890 (diff)
downloadlinux-5489e81f981b1fb7c2fdaba332122fff3290e9a4.tar.xz
ASoC: wm8904: enable MCLK in STANDBY
MCLK input is needed when accessing any register after enabling SYSCLK. This also fixes imbalance of clk_enable / clk_disable when transitioning between ON -> STANDBY -> ON bias levels. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/wm8904.c')
-rw-r--r--sound/soc/codecs/wm8904.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c
index 9283a2dc70aa..9e0f96e0f8ec 100644
--- a/sound/soc/codecs/wm8904.c
+++ b/sound/soc/codecs/wm8904.c
@@ -1837,9 +1837,6 @@ static int wm8904_set_bias_level(struct snd_soc_component *component,
switch (level) {
case SND_SOC_BIAS_ON:
- ret = clk_prepare_enable(wm8904->mclk);
- if (ret)
- return ret;
break;
case SND_SOC_BIAS_PREPARE:
@@ -1864,6 +1861,15 @@ static int wm8904_set_bias_level(struct snd_soc_component *component,
return ret;
}
+ ret = clk_prepare_enable(wm8904->mclk);
+ if (ret) {
+ dev_err(component->dev,
+ "Failed to enable MCLK: %d\n", ret);
+ regulator_bulk_disable(ARRAY_SIZE(wm8904->supplies),
+ wm8904->supplies);
+ return ret;
+ }
+
regcache_cache_only(wm8904->regmap, false);
regcache_sync(wm8904->regmap);