All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] ASoC: 88pm860x-codec: Cleanup manual bias level transitions
@ 2014-09-06 12:29 Lars-Peter Clausen
  2014-09-06 12:29 ` [PATCH 2/5] ASoC: es8328: " Lars-Peter Clausen
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Lars-Peter Clausen @ 2014-09-06 12:29 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: Fabio Estevam, alsa-devel, Lars-Peter Clausen, Tomoya MORINAGA,
	Haojian Zhuang, Sean Cross

Since the ASoC core now takes care of setting the bias level to
SND_SOC_BIAS_OFF when removing the CODEC there is no need to do it manually
anymore either.

The manual transition to SND_SOC_BIAS_STANDBY at the end of CODEC probe()
can also be removed as the core will automatically do this after the CODEC
has been probed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 sound/soc/codecs/88pm860x-codec.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/sound/soc/codecs/88pm860x-codec.c b/sound/soc/codecs/88pm860x-codec.c
index 922006d..4c3b0af 100644
--- a/sound/soc/codecs/88pm860x-codec.c
+++ b/sound/soc/codecs/88pm860x-codec.c
@@ -1337,8 +1337,6 @@ static int pm860x_probe(struct snd_soc_codec *codec)
 		}
 	}
 
-	pm860x_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-
 	return 0;
 
 out:
@@ -1354,7 +1352,6 @@ static int pm860x_remove(struct snd_soc_codec *codec)
 
 	for (i = 3; i >= 0; i--)
 		free_irq(pm860x->irq[i], pm860x);
-	pm860x_set_bias_level(codec, SND_SOC_BIAS_OFF);
 	return 0;
 }
 
-- 
1.8.0

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

* [PATCH 2/5] ASoC: es8328: Cleanup manual bias level transitions
  2014-09-06 12:29 [PATCH 1/5] ASoC: 88pm860x-codec: Cleanup manual bias level transitions Lars-Peter Clausen
@ 2014-09-06 12:29 ` Lars-Peter Clausen
  2014-09-06 12:29 ` [PATCH 3/5] ASoC: jz4740: " Lars-Peter Clausen
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Lars-Peter Clausen @ 2014-09-06 12:29 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: Fabio Estevam, alsa-devel, Lars-Peter Clausen, Tomoya MORINAGA,
	Haojian Zhuang, Sean Cross

Set the CODEC driver's suspend_bias_off flag rather than manually going to
SND_SOC_BIAS_OFF in suspend and SND_SOC_BIAS_STANDBY in resume. This makes
the code a bit shorter and cleaner.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 sound/soc/codecs/es8328.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/es8328.c b/sound/soc/codecs/es8328.c
index 3ff7870..f273251 100644
--- a/sound/soc/codecs/es8328.c
+++ b/sound/soc/codecs/es8328.c
@@ -602,8 +602,6 @@ static int es8328_suspend(struct snd_soc_codec *codec)
 
 	es8328 = snd_soc_codec_get_drvdata(codec);
 
-	es8328_set_bias_level(codec, SND_SOC_BIAS_OFF);
-
 	clk_disable_unprepare(es8328->clk);
 
 	ret = regulator_bulk_disable(ARRAY_SIZE(es8328->supplies),
@@ -643,7 +641,6 @@ static int es8328_resume(struct snd_soc_codec *codec)
 		return ret;
 	}
 
-	es8328_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
 	return 0;
 }
 
@@ -712,6 +709,8 @@ static struct snd_soc_codec_driver es8328_codec_driver = {
 	.resume		  = es8328_resume,
 	.remove		  = es8328_remove,
 	.set_bias_level	  = es8328_set_bias_level,
+	.suspend_bias_off = true,
+
 	.controls	  = es8328_snd_controls,
 	.num_controls	  = ARRAY_SIZE(es8328_snd_controls),
 	.dapm_widgets	  = es8328_dapm_widgets,
-- 
1.8.0

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

* [PATCH 3/5] ASoC: jz4740: Cleanup manual bias level transitions
  2014-09-06 12:29 [PATCH 1/5] ASoC: 88pm860x-codec: Cleanup manual bias level transitions Lars-Peter Clausen
  2014-09-06 12:29 ` [PATCH 2/5] ASoC: es8328: " Lars-Peter Clausen
@ 2014-09-06 12:29 ` Lars-Peter Clausen
  2014-09-06 12:29 ` [PATCH 4/5] ASoC: ml26124: " Lars-Peter Clausen
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Lars-Peter Clausen @ 2014-09-06 12:29 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: Fabio Estevam, alsa-devel, Lars-Peter Clausen, Tomoya MORINAGA,
	Haojian Zhuang, Sean Cross

Set the CODEC driver's suspend_bias_off flag rather than manually going to
SND_SOC_BIAS_OFF in suspend and SND_SOC_BIAS_STANDBY in resume. This makes
the code a bit shorter and cleaner.

Since the ASoC core now takes care of setting the bias level to
SND_SOC_BIAS_OFF when removing the CODEC there is no need to do it manually
anymore either.

The manual transition to SND_SOC_BIAS_STANDBY at the end of CODEC probe()
can also be removed as the core will automatically do this after the CODEC
has been probed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 sound/soc/codecs/jz4740.c | 30 +-----------------------------
 1 file changed, 1 insertion(+), 29 deletions(-)

diff --git a/sound/soc/codecs/jz4740.c b/sound/soc/codecs/jz4740.c
index bcebd1a..df7c01c 100644
--- a/sound/soc/codecs/jz4740.c
+++ b/sound/soc/codecs/jz4740.c
@@ -293,41 +293,13 @@ static int jz4740_codec_dev_probe(struct snd_soc_codec *codec)
 	regmap_update_bits(jz4740_codec->regmap, JZ4740_REG_CODEC_1,
 			JZ4740_CODEC_1_SW2_ENABLE, JZ4740_CODEC_1_SW2_ENABLE);
 
-	jz4740_codec_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-
 	return 0;
 }
 
-static int jz4740_codec_dev_remove(struct snd_soc_codec *codec)
-{
-	jz4740_codec_set_bias_level(codec, SND_SOC_BIAS_OFF);
-
-	return 0;
-}
-
-#ifdef CONFIG_PM_SLEEP
-
-static int jz4740_codec_suspend(struct snd_soc_codec *codec)
-{
-	return jz4740_codec_set_bias_level(codec, SND_SOC_BIAS_OFF);
-}
-
-static int jz4740_codec_resume(struct snd_soc_codec *codec)
-{
-	return jz4740_codec_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-}
-
-#else
-#define jz4740_codec_suspend NULL
-#define jz4740_codec_resume NULL
-#endif
-
 static struct snd_soc_codec_driver soc_codec_dev_jz4740_codec = {
 	.probe = jz4740_codec_dev_probe,
-	.remove = jz4740_codec_dev_remove,
-	.suspend = jz4740_codec_suspend,
-	.resume = jz4740_codec_resume,
 	.set_bias_level = jz4740_codec_set_bias_level,
+	.suspend_bias_off = true,
 
 	.controls = jz4740_codec_controls,
 	.num_controls = ARRAY_SIZE(jz4740_codec_controls),
-- 
1.8.0

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

* [PATCH 4/5] ASoC: ml26124: Cleanup manual bias level transitions
  2014-09-06 12:29 [PATCH 1/5] ASoC: 88pm860x-codec: Cleanup manual bias level transitions Lars-Peter Clausen
  2014-09-06 12:29 ` [PATCH 2/5] ASoC: es8328: " Lars-Peter Clausen
  2014-09-06 12:29 ` [PATCH 3/5] ASoC: jz4740: " Lars-Peter Clausen
@ 2014-09-06 12:29 ` Lars-Peter Clausen
  2014-09-06 12:29 ` [PATCH 5/5] ASoC: sgtl5000: Cleanup " Lars-Peter Clausen
  2014-09-06 12:39 ` [PATCH 1/5] ASoC: 88pm860x-codec: Cleanup manual " Mark Brown
  4 siblings, 0 replies; 7+ messages in thread
From: Lars-Peter Clausen @ 2014-09-06 12:29 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: Fabio Estevam, alsa-devel, Lars-Peter Clausen, Tomoya MORINAGA,
	Haojian Zhuang, Sean Cross

Set the CODEC driver's suspend_bias_off flag rather than manually going to
SND_SOC_BIAS_OFF in suspend and SND_SOC_BIAS_STANDBY in resume. This makes
the code a bit shorter and cleaner.

The manual transition to SND_SOC_BIAS_STANDBY at the end of CODEC probe()
can also be removed as the core will automatically do this after the CODEC
has been probed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 sound/soc/codecs/ml26124.c | 24 +-----------------------
 1 file changed, 1 insertion(+), 23 deletions(-)

diff --git a/sound/soc/codecs/ml26124.c b/sound/soc/codecs/ml26124.c
index e661e84..711f550 100644
--- a/sound/soc/codecs/ml26124.c
+++ b/sound/soc/codecs/ml26124.c
@@ -565,41 +565,19 @@ static struct snd_soc_dai_driver ml26124_dai = {
 	.symmetric_rates = 1,
 };
 
-#ifdef CONFIG_PM
-static int ml26124_suspend(struct snd_soc_codec *codec)
-{
-	ml26124_set_bias_level(codec, SND_SOC_BIAS_OFF);
-
-	return 0;
-}
-
-static int ml26124_resume(struct snd_soc_codec *codec)
-{
-	ml26124_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-
-	return 0;
-}
-#else
-#define ml26124_suspend NULL
-#define ml26124_resume NULL
-#endif
-
 static int ml26124_probe(struct snd_soc_codec *codec)
 {
 	/* Software Reset */
 	snd_soc_update_bits(codec, ML26124_SW_RST, 0x01, 1);
 	snd_soc_update_bits(codec, ML26124_SW_RST, 0x01, 0);
 
-	ml26124_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-
 	return 0;
 }
 
 static struct snd_soc_codec_driver soc_codec_dev_ml26124 = {
 	.probe =	ml26124_probe,
-	.suspend =	ml26124_suspend,
-	.resume =	ml26124_resume,
 	.set_bias_level = ml26124_set_bias_level,
+	.suspend_bias_off = true,
 	.dapm_widgets = ml26124_dapm_widgets,
 	.num_dapm_widgets = ARRAY_SIZE(ml26124_dapm_widgets),
 	.dapm_routes = ml26124_intercon,
-- 
1.8.0

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

* [PATCH 5/5] ASoC: sgtl5000: Cleanup bias level transitions
  2014-09-06 12:29 [PATCH 1/5] ASoC: 88pm860x-codec: Cleanup manual bias level transitions Lars-Peter Clausen
                   ` (2 preceding siblings ...)
  2014-09-06 12:29 ` [PATCH 4/5] ASoC: ml26124: " Lars-Peter Clausen
@ 2014-09-06 12:29 ` Lars-Peter Clausen
  2014-09-09 20:11   ` Fabio Estevam
  2014-09-06 12:39 ` [PATCH 1/5] ASoC: 88pm860x-codec: Cleanup manual " Mark Brown
  4 siblings, 1 reply; 7+ messages in thread
From: Lars-Peter Clausen @ 2014-09-06 12:29 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: Fabio Estevam, alsa-devel, Lars-Peter Clausen, Tomoya MORINAGA,
	Haojian Zhuang, Sean Cross

Set the CODEC driver's suspend_bias_off flag rather than manually going to
SND_SOC_BIAS_OFF in suspend and SND_SOC_BIAS_STANDBY in resume. This makes
the code a bit shorter and cleaner.

Since the ASoC core now takes care of setting the bias level to
SND_SOC_BIAS_OFF when removing the CODEC there is no need to do it manually
anymore either.

The manual transition to SND_SOC_BIAS_STANDBY at the end of CODEC probe()
can also be removed as the core will automatically do this after the CODEC
has been probed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 sound/soc/codecs/sgtl5000.c | 30 +-----------------------------
 1 file changed, 1 insertion(+), 29 deletions(-)

diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index e997d27..a604a22 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -1073,26 +1073,6 @@ static bool sgtl5000_readable(struct device *dev, unsigned int reg)
 	}
 }
 
-#ifdef CONFIG_SUSPEND
-static int sgtl5000_suspend(struct snd_soc_codec *codec)
-{
-	sgtl5000_set_bias_level(codec, SND_SOC_BIAS_OFF);
-
-	return 0;
-}
-
-static int sgtl5000_resume(struct snd_soc_codec *codec)
-{
-	/* Bring the codec back up to standby to enable regulators */
-	sgtl5000_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-
-	return 0;
-}
-#else
-#define sgtl5000_suspend NULL
-#define sgtl5000_resume  NULL
-#endif	/* CONFIG_SUSPEND */
-
 /*
  * sgtl5000 has 3 internal power supplies:
  * 1. VAG, normally set to vdda/2
@@ -1352,11 +1332,6 @@ static int sgtl5000_probe(struct snd_soc_codec *codec)
 	 */
 	snd_soc_write(codec, SGTL5000_DAP_CTRL, 0);
 
-	/* leading to standby state */
-	ret = sgtl5000_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-	if (ret)
-		goto err;
-
 	return 0;
 
 err:
@@ -1373,8 +1348,6 @@ static int sgtl5000_remove(struct snd_soc_codec *codec)
 {
 	struct sgtl5000_priv *sgtl5000 = snd_soc_codec_get_drvdata(codec);
 
-	sgtl5000_set_bias_level(codec, SND_SOC_BIAS_OFF);
-
 	regulator_bulk_disable(ARRAY_SIZE(sgtl5000->supplies),
 						sgtl5000->supplies);
 	regulator_bulk_free(ARRAY_SIZE(sgtl5000->supplies),
@@ -1387,9 +1360,8 @@ static int sgtl5000_remove(struct snd_soc_codec *codec)
 static struct snd_soc_codec_driver sgtl5000_driver = {
 	.probe = sgtl5000_probe,
 	.remove = sgtl5000_remove,
-	.suspend = sgtl5000_suspend,
-	.resume = sgtl5000_resume,
 	.set_bias_level = sgtl5000_set_bias_level,
+	.suspend_bias_off = true,
 	.controls = sgtl5000_snd_controls,
 	.num_controls = ARRAY_SIZE(sgtl5000_snd_controls),
 	.dapm_widgets = sgtl5000_dapm_widgets,
-- 
1.8.0

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

* Re: [PATCH 1/5] ASoC: 88pm860x-codec: Cleanup manual bias level transitions
  2014-09-06 12:29 [PATCH 1/5] ASoC: 88pm860x-codec: Cleanup manual bias level transitions Lars-Peter Clausen
                   ` (3 preceding siblings ...)
  2014-09-06 12:29 ` [PATCH 5/5] ASoC: sgtl5000: Cleanup " Lars-Peter Clausen
@ 2014-09-06 12:39 ` Mark Brown
  4 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2014-09-06 12:39 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Fabio Estevam, alsa-devel, Tomoya MORINAGA, Liam Girdwood,
	Haojian Zhuang, Sean Cross


[-- Attachment #1.1: Type: text/plain, Size: 252 bytes --]

On Sat, Sep 06, 2014 at 02:29:31PM +0200, Lars-Peter Clausen wrote:
> Since the ASoC core now takes care of setting the bias level to
> SND_SOC_BIAS_OFF when removing the CODEC there is no need to do it manually
> anymore either.

Applied all, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* Re: [PATCH 5/5] ASoC: sgtl5000: Cleanup bias level transitions
  2014-09-06 12:29 ` [PATCH 5/5] ASoC: sgtl5000: Cleanup " Lars-Peter Clausen
@ 2014-09-09 20:11   ` Fabio Estevam
  0 siblings, 0 replies; 7+ messages in thread
From: Fabio Estevam @ 2014-09-09 20:11 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Fabio Estevam, alsa-devel, Tomoya MORINAGA, Liam Girdwood,
	Haojian Zhuang, Mark Brown, Sean Cross

On Sat, Sep 6, 2014 at 9:29 AM, Lars-Peter Clausen <lars@metafoo.de> wrote:
> Set the CODEC driver's suspend_bias_off flag rather than manually going to
> SND_SOC_BIAS_OFF in suspend and SND_SOC_BIAS_STANDBY in resume. This makes
> the code a bit shorter and cleaner.
>
> Since the ASoC core now takes care of setting the bias level to
> SND_SOC_BIAS_OFF when removing the CODEC there is no need to do it manually
> anymore either.
>
> The manual transition to SND_SOC_BIAS_STANDBY at the end of CODEC probe()
> can also be removed as the core will automatically do this after the CODEC
> has been probed.
>
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>

Tested-by: Fabio Estevam <fabio.estevam@freescale.com>

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

end of thread, other threads:[~2014-09-09 20:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-06 12:29 [PATCH 1/5] ASoC: 88pm860x-codec: Cleanup manual bias level transitions Lars-Peter Clausen
2014-09-06 12:29 ` [PATCH 2/5] ASoC: es8328: " Lars-Peter Clausen
2014-09-06 12:29 ` [PATCH 3/5] ASoC: jz4740: " Lars-Peter Clausen
2014-09-06 12:29 ` [PATCH 4/5] ASoC: ml26124: " Lars-Peter Clausen
2014-09-06 12:29 ` [PATCH 5/5] ASoC: sgtl5000: Cleanup " Lars-Peter Clausen
2014-09-09 20:11   ` Fabio Estevam
2014-09-06 12:39 ` [PATCH 1/5] ASoC: 88pm860x-codec: Cleanup manual " Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.