diff mbox

[2/2] ASoC: rt5677: Keep the ldo2 power while "Voice Wake Up" used in the suspend mode

Message ID 1424856974-18763-2-git-send-email-oder_chiou@realtek.com (mailing list archive)
State Accepted
Commit cbca4076d156c93cedadabb0e463ba0db16bb166
Headers show

Commit Message

Oder Chiou Feb. 25, 2015, 9:36 a.m. UTC
The patch keeps the ldo2 power while the DSP function of "Voice Wake Up" used
in the suspend mode.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
---
 sound/soc/codecs/rt5677.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Comments

Mark Brown Feb. 26, 2015, 2:09 a.m. UTC | #1
On Wed, Feb 25, 2015 at 05:36:14PM +0800, Oder Chiou wrote:
> The patch keeps the ldo2 power while the DSP function of "Voice Wake Up" used
> in the suspend mode.

Applied, thanks.  Please keep the subject lines of your commits well
under 80 colummns so things like git log work well.
diff mbox

Patch

diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c
index f87c929..c2a6e40 100644
--- a/sound/soc/codecs/rt5677.c
+++ b/sound/soc/codecs/rt5677.c
@@ -4513,10 +4513,10 @@  static int rt5677_suspend(struct snd_soc_codec *codec)
 	if (!rt5677->dsp_vad_en) {
 		regcache_cache_only(rt5677->regmap, true);
 		regcache_mark_dirty(rt5677->regmap);
-	}
 
-	if (gpio_is_valid(rt5677->pow_ldo2))
-		gpio_set_value_cansleep(rt5677->pow_ldo2, 0);
+		if (gpio_is_valid(rt5677->pow_ldo2))
+			gpio_set_value_cansleep(rt5677->pow_ldo2, 0);
+	}
 
 	return 0;
 }
@@ -4525,12 +4525,12 @@  static int rt5677_resume(struct snd_soc_codec *codec)
 {
 	struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
 
-	if (gpio_is_valid(rt5677->pow_ldo2)) {
-		gpio_set_value_cansleep(rt5677->pow_ldo2, 1);
-		msleep(10);
-	}
-
 	if (!rt5677->dsp_vad_en) {
+		if (gpio_is_valid(rt5677->pow_ldo2)) {
+			gpio_set_value_cansleep(rt5677->pow_ldo2, 1);
+			msleep(10);
+		}
+
 		regcache_cache_only(rt5677->regmap, false);
 		regcache_sync(rt5677->regmap);
 	}