All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
To: patches@opensource.cirrus.com, alsa-devel@alsa-project.org
Cc: Takashi Iwai <tiwai@suse.com>, Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>
Subject: [PATCH 4/4] ASoC: wm8904: enable MCLK in STANDBY
Date: Wed, 19 Dec 2018 21:11:16 +0100	[thread overview]
Message-ID: <af3940da408c4489678afcc82760356339e0dc0c.1545249666.git.mirq-linux@rere.qmqm.pl> (raw)
In-Reply-To: <cover.1545249666.git.mirq-linux@rere.qmqm.pl>

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>
---
 sound/soc/codecs/wm8904.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c
index 2813b7f6a58e..9f0167a39e51 100644
--- a/sound/soc/codecs/wm8904.c
+++ b/sound/soc/codecs/wm8904.c
@@ -1852,9 +1852,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:
@@ -1879,6 +1876,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);
 
-- 
2.19.2

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  parent reply	other threads:[~2018-12-19 20:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-19 20:11 [PATCH 0/4] ASoC: wm8904: prepare for use from audio-graph-card Michał Mirosław
2018-12-19 20:11 ` [PATCH 1/4] ASoC: wm8904: make the driver visible in Kconfig Michał Mirosław
2018-12-21 11:16   ` Charles Keepax
2018-12-19 20:11 ` [PATCH 2/4] ASoC: wm8904: Automatically enable FLL when selected Michał Mirosław
2018-12-21 11:52   ` Charles Keepax
2018-12-21 11:58     ` Mark Brown
2019-01-13 12:37       ` Michał Mirosław
2018-12-19 20:11 ` Michał Mirosław [this message]
2018-12-21 11:30   ` [PATCH 4/4] ASoC: wm8904: enable MCLK in STANDBY Charles Keepax
2018-12-19 20:11 ` [PATCH 3/4] ASoC: wm8904: save model id directly in of_device_id.data Michał Mirosław
2018-12-21 11:27   ` Charles Keepax

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=af3940da408c4489678afcc82760356339e0dc0c.1545249666.git.mirq-linux@rere.qmqm.pl \
    --to=mirq-linux@rere.qmqm.pl \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=patches@opensource.cirrus.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.