aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-06-03 05:20:39 -0400
committerMark Brown <broonie@linaro.org>2013-06-05 14:38:15 -0400
commit2bdc1bb2b4e1f517d8aa5bbbad9cb6ccac8a94fb (patch)
treedca339c5567b178b28725cf840fe96ab2f70ab8e
parentdd4d2d6dfb49e8916064f2cb07f0ad7b32a82fb7 (diff)
ASoC: sgtl5000: Make device cache only when powered off
When the regulators have been disabled mark the device as cache only so that we don't try to interact with the hardware. Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--sound/soc/codecs/sgtl5000.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index b4297416401e..c8f2afb74706 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -907,10 +907,25 @@ static int sgtl5000_set_bias_level(struct snd_soc_codec *codec,
907 if (ret) 907 if (ret)
908 return ret; 908 return ret;
909 udelay(10); 909 udelay(10);
910
911 regcache_cache_only(sgtl5000->regmap, false);
912
913 ret = regcache_sync(sgtl5000->regmap);
914 if (ret != 0) {
915 dev_err(codec->dev,
916 "Failed to restore cache: %d\n", ret);
917
918 regcache_cache_only(sgtl5000->regmap, true);
919 regulator_bulk_disable(ARRAY_SIZE(sgtl5000->supplies),
920 sgtl5000->supplies);
921
922 return ret;
923 }
910 } 924 }
911 925
912 break; 926 break;
913 case SND_SOC_BIAS_OFF: 927 case SND_SOC_BIAS_OFF:
928 regcache_cache_only(sgtl5000->regmap, true);
914 regulator_bulk_disable(ARRAY_SIZE(sgtl5000->supplies), 929 regulator_bulk_disable(ARRAY_SIZE(sgtl5000->supplies),
915 sgtl5000->supplies); 930 sgtl5000->supplies);
916 break; 931 break;