提交 e58f301e 编写于 作者: M Mark Brown

ASoC: rt5640: Power down LDO while suspended

If we have control over the LDO then disable it during suspend; the device
is already being put into reset so will be non-functional over suspend
anyway and this will save a small amount of power.
Signed-off-by: NMark Brown <broonie@linaro.org>
Tested-by: NStephen Warren <swarren@nvidia.com>
上级 32fcb97b
...@@ -1979,12 +1979,20 @@ static int rt5640_suspend(struct snd_soc_codec *codec) ...@@ -1979,12 +1979,20 @@ static int rt5640_suspend(struct snd_soc_codec *codec)
rt5640_reset(codec); rt5640_reset(codec);
regcache_cache_only(rt5640->regmap, true); regcache_cache_only(rt5640->regmap, true);
regcache_mark_dirty(rt5640->regmap); regcache_mark_dirty(rt5640->regmap);
if (gpio_is_valid(rt5640->pdata.ldo1_en))
gpio_set_value_cansleep(rt5640->pdata.ldo1_en, 0);
return 0; return 0;
} }
static int rt5640_resume(struct snd_soc_codec *codec) static int rt5640_resume(struct snd_soc_codec *codec)
{ {
struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec);
if (gpio_is_valid(rt5640->pdata.ldo1_en)) {
gpio_set_value_cansleep(rt5640->pdata.ldo1_en, 1);
msleep(400);
}
rt5640_set_bias_level(codec, SND_SOC_BIAS_STANDBY); rt5640_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册