diff options
author | Mark Brown <broonie@linaro.org> | 2013-10-16 12:26:22 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-10-19 16:24:30 -0400 |
commit | e58f301ec969430cdafd7fa872660458f4939507 (patch) | |
tree | 056800085bab225c831441dd9a2d17dc11e4e68f | |
parent | 32fcb97b9f699f63742bcaadca6e0beede86e8e8 (diff) |
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: Mark Brown <broonie@linaro.org>
Tested-by: Stephen Warren <swarren@nvidia.com>
-rw-r--r-- | sound/soc/codecs/rt5640.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c index 641eeeb00c5c..b0cde92be7eb 100644 --- a/sound/soc/codecs/rt5640.c +++ b/sound/soc/codecs/rt5640.c | |||
@@ -1979,12 +1979,20 @@ static int rt5640_suspend(struct snd_soc_codec *codec) | |||
1979 | rt5640_reset(codec); | 1979 | rt5640_reset(codec); |
1980 | regcache_cache_only(rt5640->regmap, true); | 1980 | regcache_cache_only(rt5640->regmap, true); |
1981 | regcache_mark_dirty(rt5640->regmap); | 1981 | regcache_mark_dirty(rt5640->regmap); |
1982 | if (gpio_is_valid(rt5640->pdata.ldo1_en)) | ||
1983 | gpio_set_value_cansleep(rt5640->pdata.ldo1_en, 0); | ||
1982 | 1984 | ||
1983 | return 0; | 1985 | return 0; |
1984 | } | 1986 | } |
1985 | 1987 | ||
1986 | static int rt5640_resume(struct snd_soc_codec *codec) | 1988 | static int rt5640_resume(struct snd_soc_codec *codec) |
1987 | { | 1989 | { |
1990 | struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec); | ||
1991 | |||
1992 | if (gpio_is_valid(rt5640->pdata.ldo1_en)) { | ||
1993 | gpio_set_value_cansleep(rt5640->pdata.ldo1_en, 1); | ||
1994 | msleep(400); | ||
1995 | } | ||
1988 | rt5640_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 1996 | rt5640_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
1989 | 1997 | ||
1990 | return 0; | 1998 | return 0; |