From: Daniel Mack <daniel@caiaq.de>
To: alsa-devel@alsa-project.org
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>,
Timur Tabi <timur@freescale.com>,
Liam Girdwood <lrg@slimlogic.co.uk>
Subject: [PATCH] ALSA: ASoC: cs4270: enable regulators at probe time
Date: Thu, 28 Jan 2010 18:59:31 +0800 [thread overview]
Message-ID: <1264676371-29977-1-git-send-email-daniel@caiaq.de> (raw)
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>
Cc: Timur Tabi <timur@freescale.com>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
sound/soc/codecs/cs4270.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/sound/soc/codecs/cs4270.c b/sound/soc/codecs/cs4270.c
index 8b54575..70c5edb 100644
--- a/sound/soc/codecs/cs4270.c
+++ b/sound/soc/codecs/cs4270.c
@@ -617,8 +617,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);
@@ -638,6 +647,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;
--
1.6.3.3
next reply other threads:[~2010-01-29 7:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-28 10:59 Daniel Mack [this message]
2010-01-29 13:55 ` [PATCH] ALSA: ASoC: cs4270: enable regulators at probe time Timur Tabi
2010-02-08 18:32 ` Daniel Mack
2010-02-09 10:39 ` Liam Girdwood
2010-02-09 15:55 ` Timur Tabi
2010-02-09 19:48 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1264676371-29977-1-git-send-email-daniel@caiaq.de \
--to=daniel@caiaq.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=lrg@slimlogic.co.uk \
--cc=timur@freescale.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).