alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ALSA: ASoC: cs4270: enable regulators at probe time
@ 2010-01-28 10:59 Daniel Mack
  2010-01-29 13:55 ` Timur Tabi
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Mack @ 2010-01-28 10:59 UTC (permalink / raw)
  To: alsa-devel; +Cc: Mark Brown, Timur Tabi, Liam Girdwood

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] ALSA: ASoC: cs4270: enable regulators at probe time
  2010-01-28 10:59 [PATCH] ALSA: ASoC: cs4270: enable regulators at probe time Daniel Mack
@ 2010-01-29 13:55 ` Timur Tabi
  2010-02-08 18:32   ` Daniel Mack
  0 siblings, 1 reply; 6+ messages in thread
From: Timur Tabi @ 2010-01-29 13:55 UTC (permalink / raw)
  To: Daniel Mack; +Cc: alsa-devel, Mark Brown, Liam Girdwood

Daniel Mack wrote:

> +error_free_regulators:
> +		regulator_bulk_free(ARRAY_SIZE(cs4270->supplies),
> +				    cs4270->supplies);

I think this is indented too much.

-- 
Timur Tabi
Linux kernel developer at Freescale

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] ALSA: ASoC: cs4270: enable regulators at probe time
  2010-01-29 13:55 ` Timur Tabi
@ 2010-02-08 18:32   ` Daniel Mack
  2010-02-09 10:39     ` Liam Girdwood
                       ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Daniel Mack @ 2010-02-08 18:32 UTC (permalink / raw)
  To: alsa-devel; +Cc: Mark Brown, Timur Tabi, Liam Girdwood

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..63cb669 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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] ALSA: ASoC: cs4270: enable regulators at probe time
  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
  2 siblings, 0 replies; 6+ messages in thread
From: Liam Girdwood @ 2010-02-09 10:39 UTC (permalink / raw)
  To: Daniel Mack; +Cc: alsa-devel, Mark Brown, Timur Tabi

On Tue, 2010-02-09 at 02:32 +0800, Daniel Mack wrote:
> 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(-)
> 
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ALSA: ASoC: cs4270: enable regulators at probe time
  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
  2 siblings, 0 replies; 6+ messages in thread
From: Timur Tabi @ 2010-02-09 15:55 UTC (permalink / raw)
  To: Daniel Mack; +Cc: alsa-devel, Mark Brown, Liam Girdwood

Daniel Mack wrote:
> 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>

I don't have any way to test this, but it looks okay.  Mark, feel free to apply if you're okay with it.

-- 
Timur Tabi
Linux kernel developer at Freescale

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ALSA: ASoC: cs4270: enable regulators at probe time
  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
  2 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2010-02-09 19:48 UTC (permalink / raw)
  To: Daniel Mack; +Cc: alsa-devel, Timur Tabi, Liam Girdwood

On Tue, Feb 09, 2010 at 02:32:59AM +0800, Daniel Mack wrote:
> 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>

Applied, thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-02-09 19:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-28 10:59 [PATCH] ALSA: ASoC: cs4270: enable regulators at probe time Daniel Mack
2010-01-29 13:55 ` 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

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).