alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: max98090: sync regcache on entering STANDBY
@ 2014-02-12 18:24 Dylan Reid
  2014-02-12 19:56 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Dylan Reid @ 2014-02-12 18:24 UTC (permalink / raw)
  To: alsa-devel; +Cc: sachin.kamat, Dylan Reid, broonie, jerry.wong

Sync regcache when entering STANDBY from OFF.  ON isn't entered with
OFF as the current state, so the registers were not being re-synced
after suspend/resume.

The 98088 and 98095 already call regcache_sync from STANDBY.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
---
 sound/soc/codecs/max98090.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index 51f9b3d..149b57f 100644
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -1769,16 +1769,6 @@ static int max98090_set_bias_level(struct snd_soc_codec *codec,
 
 	switch (level) {
 	case SND_SOC_BIAS_ON:
-		if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) {
-			ret = regcache_sync(max98090->regmap);
-
-			if (ret != 0) {
-				dev_err(codec->dev,
-					"Failed to sync cache: %d\n", ret);
-				return ret;
-			}
-		}
-
 		if (max98090->jack_state == M98090_JACK_STATE_HEADSET) {
 			/*
 			 * Set to normal bias level.
@@ -1792,6 +1782,16 @@ static int max98090_set_bias_level(struct snd_soc_codec *codec,
 		break;
 
 	case SND_SOC_BIAS_STANDBY:
+		if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) {
+			ret = regcache_sync(max98090->regmap);
+			if (ret != 0) {
+				dev_err(codec->dev,
+					"Failed to sync cache: %d\n", ret);
+				return ret;
+			}
+		}
+		break;
+
 	case SND_SOC_BIAS_OFF:
 		/* Set internal pull-up to lowest power mode */
 		snd_soc_update_bits(codec, M98090_REG_JACK_DETECT,
-- 
1.8.1.3.605.g02339dd

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ASoC: max98090: sync regcache on entering STANDBY
  2014-02-12 18:24 [PATCH] ASoC: max98090: sync regcache on entering STANDBY Dylan Reid
@ 2014-02-12 19:56 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2014-02-12 19:56 UTC (permalink / raw)
  To: Dylan Reid; +Cc: sachin.kamat, alsa-devel, jerry.wong


[-- Attachment #1.1: Type: text/plain, Size: 243 bytes --]

On Wed, Feb 12, 2014 at 10:24:54AM -0800, Dylan Reid wrote:
> Sync regcache when entering STANDBY from OFF.  ON isn't entered with
> OFF as the current state, so the registers were not being re-synced
> after suspend/resume.

Applied, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-02-12 19:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-12 18:24 [PATCH] ASoC: max98090: sync regcache on entering STANDBY Dylan Reid
2014-02-12 19:56 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).