Commit cbca4076 authored by Oder Chiou's avatar Oder Chiou Committed by Mark Brown

ASoC: rt5677: Keep the LDO2 powered while used in the suspend mode

The patch keeps the ldo2 power while the DSP function of "Voice Wake Up" used
in the suspend mode.
Signed-off-by: default avatarOder Chiou <oder_chiou@realtek.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent ab1f7095
...@@ -4513,10 +4513,10 @@ static int rt5677_suspend(struct snd_soc_codec *codec) ...@@ -4513,10 +4513,10 @@ static int rt5677_suspend(struct snd_soc_codec *codec)
if (!rt5677->dsp_vad_en) { if (!rt5677->dsp_vad_en) {
regcache_cache_only(rt5677->regmap, true); regcache_cache_only(rt5677->regmap, true);
regcache_mark_dirty(rt5677->regmap); regcache_mark_dirty(rt5677->regmap);
}
if (gpio_is_valid(rt5677->pow_ldo2)) if (gpio_is_valid(rt5677->pow_ldo2))
gpio_set_value_cansleep(rt5677->pow_ldo2, 0); gpio_set_value_cansleep(rt5677->pow_ldo2, 0);
}
return 0; return 0;
} }
...@@ -4525,12 +4525,12 @@ static int rt5677_resume(struct snd_soc_codec *codec) ...@@ -4525,12 +4525,12 @@ static int rt5677_resume(struct snd_soc_codec *codec)
{ {
struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(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 (!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_cache_only(rt5677->regmap, false);
regcache_sync(rt5677->regmap); regcache_sync(rt5677->regmap);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment