summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/cs4270.c
diff options
context:
space:
mode:
authorDaniel Mack <daniel@caiaq.de>2010-02-09 02:32:59 +0800
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-02-10 10:42:56 +0000
commitc0ff4bcd2e8505b09e0bedc74d08ad2da1e326f8 (patch)
tree0ab7fee70cb9821baf177b63c7eda96a92d5d37f /sound/soc/codecs/cs4270.c
parent22313eafe92aeec1db9839f5afb71675bf2a5c33 (diff)
ASoC: cs4270: enable regulators at probe time
Enable the bulk regulators at probe time so we can safely disable them again when going to suspend without confusing the reference counter. Signed-off-by: Daniel Mack <daniel@caiaq.de> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/cs4270.c')
-rw-r--r--sound/soc/codecs/cs4270.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sound/soc/codecs/cs4270.c b/sound/soc/codecs/cs4270.c
index 593bfc7a698..dfbeb2db61b 100644
--- a/sound/soc/codecs/cs4270.c
+++ b/sound/soc/codecs/cs4270.c
@@ -629,8 +629,17 @@ static int cs4270_probe(struct platform_device *pdev)
if (ret < 0)
goto error_free_pcms;
+ ret = regulator_bulk_enable(ARRAY_SIZE(cs4270->supplies),
+ cs4270->supplies);
+ if (ret < 0)
+ goto error_free_regulators;
+
return 0;
+error_free_regulators:
+ regulator_bulk_free(ARRAY_SIZE(cs4270->supplies),
+ cs4270->supplies);
+
error_free_pcms:
snd_soc_free_pcms(socdev);
@@ -650,6 +659,7 @@ static int cs4270_remove(struct platform_device *pdev)
struct cs4270_private *cs4270 = codec->private_data;
snd_soc_free_pcms(socdev);
+ regulator_bulk_disable(ARRAY_SIZE(cs4270->supplies), cs4270->supplies);
regulator_bulk_free(ARRAY_SIZE(cs4270->supplies), cs4270->supplies);
return 0;