提交 c0ff4bcd 编写于 作者: D Daniel Mack 提交者: Mark Brown

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: NDaniel Mack <daniel@caiaq.de>
Acked-by: NLiam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 22313eaf
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册