All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/6] ASoC: cs42l52: Cleanup manual bias level transitions
@ 2014-09-09 18:42 Lars-Peter Clausen
  2014-09-09 18:42 ` [PATCH 2/6] ASoC: cs42l56: " Lars-Peter Clausen
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Lars-Peter Clausen @ 2014-09-09 18:42 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: Brian Austin, alsa-devel, Support Opensource, Paul Handrigan,
	Lars-Peter Clausen

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/cs42l52.c | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)

diff --git a/sound/soc/codecs/cs42l52.c b/sound/soc/codecs/cs42l52.c
index da4f758..35fbef7 100644
--- a/sound/soc/codecs/cs42l52.c
+++ b/sound/soc/codecs/cs42l52.c
@@ -946,20 +946,6 @@ static struct snd_soc_dai_driver cs42l52_dai = {
 		.ops = &cs42l52_ops,
 };
 
-static int cs42l52_suspend(struct snd_soc_codec *codec)
-{
-	cs42l52_set_bias_level(codec, SND_SOC_BIAS_OFF);
-
-	return 0;
-}
-
-static int cs42l52_resume(struct snd_soc_codec *codec)
-{
-	cs42l52_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-
-	return 0;
-}
-
 static int beep_rates[] = {
 	261, 522, 585, 667, 706, 774, 889, 1000,
 	1043, 1200, 1333, 1412, 1600, 1714, 2000, 2182
@@ -1104,8 +1090,6 @@ static int cs42l52_probe(struct snd_soc_codec *codec)
 
 	cs42l52_init_beep(codec);
 
-	cs42l52_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-
 	cs42l52->sysclk = CS42L52_DEFAULT_CLK;
 	cs42l52->config.format = CS42L52_DEFAULT_FORMAT;
 
@@ -1115,7 +1099,6 @@ static int cs42l52_probe(struct snd_soc_codec *codec)
 static int cs42l52_remove(struct snd_soc_codec *codec)
 {
 	cs42l52_free_beep(codec);
-	cs42l52_set_bias_level(codec, SND_SOC_BIAS_OFF);
 
 	return 0;
 }
@@ -1123,9 +1106,8 @@ static int cs42l52_remove(struct snd_soc_codec *codec)
 static struct snd_soc_codec_driver soc_codec_dev_cs42l52 = {
 	.probe = cs42l52_probe,
 	.remove = cs42l52_remove,
-	.suspend = cs42l52_suspend,
-	.resume = cs42l52_resume,
 	.set_bias_level = cs42l52_set_bias_level,
+	.suspend_bias_off = true,
 
 	.dapm_widgets = cs42l52_dapm_widgets,
 	.num_dapm_widgets = ARRAY_SIZE(cs42l52_dapm_widgets),
-- 
1.8.0

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

* [PATCH 2/6] ASoC: cs42l56: Cleanup manual bias level transitions
  2014-09-09 18:42 [PATCH 1/6] ASoC: cs42l52: Cleanup manual bias level transitions Lars-Peter Clausen
@ 2014-09-09 18:42 ` Lars-Peter Clausen
  2014-09-09 18:42 ` [PATCH 3/6] ASoC: cs42l73: " Lars-Peter Clausen
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Lars-Peter Clausen @ 2014-09-09 18:42 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: Brian Austin, alsa-devel, Support Opensource, Paul Handrigan,
	Lars-Peter Clausen

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/cs42l56.c | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)

diff --git a/sound/soc/codecs/cs42l56.c b/sound/soc/codecs/cs42l56.c
index bb74dd1..2ddc7ac 100644
--- a/sound/soc/codecs/cs42l56.c
+++ b/sound/soc/codecs/cs42l56.c
@@ -1016,20 +1016,6 @@ static struct snd_soc_dai_driver cs42l56_dai = {
 		.ops = &cs42l56_ops,
 };
 
-static int cs42l56_suspend(struct snd_soc_codec *codec)
-{
-	cs42l56_set_bias_level(codec, SND_SOC_BIAS_OFF);
-
-	return 0;
-}
-
-static int cs42l56_resume(struct snd_soc_codec *codec)
-{
-	cs42l56_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-
-	return 0;
-}
-
 static int beep_freq[] = {
 	261, 522, 585, 667, 706, 774, 889, 1000,
 	1043, 1200, 1333, 1412, 1600, 1714, 2000, 2182
@@ -1168,15 +1154,12 @@ static int cs42l56_probe(struct snd_soc_codec *codec)
 {
 	cs42l56_init_beep(codec);
 
-	cs42l56_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-
 	return 0;
 }
 
 static int cs42l56_remove(struct snd_soc_codec *codec)
 {
 	cs42l56_free_beep(codec);
-	cs42l56_set_bias_level(codec, SND_SOC_BIAS_OFF);
 
 	return 0;
 }
@@ -1184,9 +1167,8 @@ static int cs42l56_remove(struct snd_soc_codec *codec)
 static struct snd_soc_codec_driver soc_codec_dev_cs42l56 = {
 	.probe = cs42l56_probe,
 	.remove = cs42l56_remove,
-	.suspend = cs42l56_suspend,
-	.resume = cs42l56_resume,
 	.set_bias_level = cs42l56_set_bias_level,
+	.suspend_bias_off = true,
 
 	.dapm_widgets = cs42l56_dapm_widgets,
 	.num_dapm_widgets = ARRAY_SIZE(cs42l56_dapm_widgets),
-- 
1.8.0

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

* [PATCH 3/6] ASoC: cs42l73: Cleanup manual bias level transitions
  2014-09-09 18:42 [PATCH 1/6] ASoC: cs42l52: Cleanup manual bias level transitions Lars-Peter Clausen
  2014-09-09 18:42 ` [PATCH 2/6] ASoC: cs42l56: " Lars-Peter Clausen
@ 2014-09-09 18:42 ` Lars-Peter Clausen
  2014-09-09 18:42 ` [PATCH 4/6] ASoC: da732x: Remove unnecessary idle_bias_off initialization Lars-Peter Clausen
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Lars-Peter Clausen @ 2014-09-09 18:42 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: Brian Austin, alsa-devel, Support Opensource, Paul Handrigan,
	Lars-Peter Clausen

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/cs42l73.c | 25 +------------------------
 1 file changed, 1 insertion(+), 24 deletions(-)

diff --git a/sound/soc/codecs/cs42l73.c b/sound/soc/codecs/cs42l73.c
index 0e7b9eb..2f8b946 100644
--- a/sound/soc/codecs/cs42l73.c
+++ b/sound/soc/codecs/cs42l73.c
@@ -1330,25 +1330,10 @@ static struct snd_soc_dai_driver cs42l73_dai[] = {
 	 }
 };
 
-static int cs42l73_suspend(struct snd_soc_codec *codec)
-{
-	cs42l73_set_bias_level(codec, SND_SOC_BIAS_OFF);
-
-	return 0;
-}
-
-static int cs42l73_resume(struct snd_soc_codec *codec)
-{
-	cs42l73_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-	return 0;
-}
-
 static int cs42l73_probe(struct snd_soc_codec *codec)
 {
 	struct cs42l73_private *cs42l73 = snd_soc_codec_get_drvdata(codec);
 
-	cs42l73_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-
 	/* Set Charge Pump Frequency */
 	if (cs42l73->pdata.chgfreq)
 		snd_soc_update_bits(codec, CS42L73_CPFCHC,
@@ -1362,18 +1347,10 @@ static int cs42l73_probe(struct snd_soc_codec *codec)
 	return 0;
 }
 
-static int cs42l73_remove(struct snd_soc_codec *codec)
-{
-	cs42l73_set_bias_level(codec, SND_SOC_BIAS_OFF);
-	return 0;
-}
-
 static struct snd_soc_codec_driver soc_codec_dev_cs42l73 = {
 	.probe = cs42l73_probe,
-	.remove = cs42l73_remove,
-	.suspend = cs42l73_suspend,
-	.resume = cs42l73_resume,
 	.set_bias_level = cs42l73_set_bias_level,
+	.suspend_bias_off = true,
 
 	.dapm_widgets = cs42l73_dapm_widgets,
 	.num_dapm_widgets = ARRAY_SIZE(cs42l73_dapm_widgets),
-- 
1.8.0

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

* [PATCH 4/6] ASoC: da732x: Remove unnecessary idle_bias_off initialization
  2014-09-09 18:42 [PATCH 1/6] ASoC: cs42l52: Cleanup manual bias level transitions Lars-Peter Clausen
  2014-09-09 18:42 ` [PATCH 2/6] ASoC: cs42l56: " Lars-Peter Clausen
  2014-09-09 18:42 ` [PATCH 3/6] ASoC: cs42l73: " Lars-Peter Clausen
@ 2014-09-09 18:42 ` Lars-Peter Clausen
  2014-09-09 18:42 ` [PATCH 5/6] ASoC: da732x: Remove unused codec field form da732x_priv struct Lars-Peter Clausen
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Lars-Peter Clausen @ 2014-09-09 18:42 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: Brian Austin, alsa-devel, Support Opensource, Paul Handrigan,
	Lars-Peter Clausen

idle_bias_off is false by default, no need to set it explicitly.

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

diff --git a/sound/soc/codecs/da732x.c b/sound/soc/codecs/da732x.c
index 2fae31c..edcbfea 100644
--- a/sound/soc/codecs/da732x.c
+++ b/sound/soc/codecs/da732x.c
@@ -1511,12 +1511,9 @@ static int da732x_set_bias_level(struct snd_soc_codec *codec,
 static int da732x_probe(struct snd_soc_codec *codec)
 {
 	struct da732x_priv *da732x = snd_soc_codec_get_drvdata(codec);
-	struct snd_soc_dapm_context *dapm = &codec->dapm;
 
 	da732x->codec = codec;
 
-	dapm->idle_bias_off = false;
-
 	da732x_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
 
 	return 0;
-- 
1.8.0

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

* [PATCH 5/6] ASoC: da732x: Remove unused codec field form da732x_priv struct
  2014-09-09 18:42 [PATCH 1/6] ASoC: cs42l52: Cleanup manual bias level transitions Lars-Peter Clausen
                   ` (2 preceding siblings ...)
  2014-09-09 18:42 ` [PATCH 4/6] ASoC: da732x: Remove unnecessary idle_bias_off initialization Lars-Peter Clausen
@ 2014-09-09 18:42 ` Lars-Peter Clausen
  2014-09-09 18:42 ` [PATCH 6/6] ASoC: da732x: Cleanup manual bias level transitions Lars-Peter Clausen
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Lars-Peter Clausen @ 2014-09-09 18:42 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: Brian Austin, alsa-devel, Support Opensource, Paul Handrigan,
	Lars-Peter Clausen

The field is initialized in the probe callback, but never used again. So it
can be removed.

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

diff --git a/sound/soc/codecs/da732x.c b/sound/soc/codecs/da732x.c
index edcbfea..c28cf33 100644
--- a/sound/soc/codecs/da732x.c
+++ b/sound/soc/codecs/da732x.c
@@ -35,7 +35,6 @@
 
 struct da732x_priv {
 	struct regmap *regmap;
-	struct snd_soc_codec *codec;
 
 	unsigned int sysclk;
 	bool pll_en;
@@ -1512,8 +1511,6 @@ static int da732x_probe(struct snd_soc_codec *codec)
 {
 	struct da732x_priv *da732x = snd_soc_codec_get_drvdata(codec);
 
-	da732x->codec = codec;
-
 	da732x_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
 
 	return 0;
-- 
1.8.0

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

* [PATCH 6/6] ASoC: da732x: Cleanup manual bias level transitions
  2014-09-09 18:42 [PATCH 1/6] ASoC: cs42l52: Cleanup manual bias level transitions Lars-Peter Clausen
                   ` (3 preceding siblings ...)
  2014-09-09 18:42 ` [PATCH 5/6] ASoC: da732x: Remove unused codec field form da732x_priv struct Lars-Peter Clausen
@ 2014-09-09 18:42 ` Lars-Peter Clausen
  2014-09-09 18:47 ` [PATCH 1/6] ASoC: cs42l52: " Brian Austin
  2014-09-09 20:09 ` Mark Brown
  6 siblings, 0 replies; 8+ messages in thread
From: Lars-Peter Clausen @ 2014-09-09 18:42 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: Brian Austin, alsa-devel, Support Opensource, Paul Handrigan,
	Lars-Peter Clausen

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/da732x.c | 19 -------------------
 1 file changed, 19 deletions(-)

diff --git a/sound/soc/codecs/da732x.c b/sound/soc/codecs/da732x.c
index c28cf33..f35e83e 100644
--- a/sound/soc/codecs/da732x.c
+++ b/sound/soc/codecs/da732x.c
@@ -1507,26 +1507,7 @@ static int da732x_set_bias_level(struct snd_soc_codec *codec,
 	return 0;
 }
 
-static int da732x_probe(struct snd_soc_codec *codec)
-{
-	struct da732x_priv *da732x = snd_soc_codec_get_drvdata(codec);
-
-	da732x_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-
-	return 0;
-}
-
-static int da732x_remove(struct snd_soc_codec *codec)
-{
-
-	da732x_set_bias_level(codec, SND_SOC_BIAS_OFF);
-
-	return 0;
-}
-
 static struct snd_soc_codec_driver soc_codec_dev_da732x = {
-	.probe			= da732x_probe,
-	.remove			= da732x_remove,
 	.set_bias_level		= da732x_set_bias_level,
 	.controls		= da732x_snd_controls,
 	.num_controls		= ARRAY_SIZE(da732x_snd_controls),
-- 
1.8.0

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

* Re: [PATCH 1/6] ASoC: cs42l52: Cleanup manual bias level transitions
  2014-09-09 18:42 [PATCH 1/6] ASoC: cs42l52: Cleanup manual bias level transitions Lars-Peter Clausen
                   ` (4 preceding siblings ...)
  2014-09-09 18:42 ` [PATCH 6/6] ASoC: da732x: Cleanup manual bias level transitions Lars-Peter Clausen
@ 2014-09-09 18:47 ` Brian Austin
  2014-09-09 20:09 ` Mark Brown
  6 siblings, 0 replies; 8+ messages in thread
From: Brian Austin @ 2014-09-09 18:47 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: alsa-devel, Support Opensource, Brian Austin, Paul Handrigan,
	Liam Girdwood, Mark Brown


On Tue, 9 Sep 2014, Lars-Peter Clausen 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>
for the Cirrus ones.
Thanks

Acked-by: Brian Austin <brian.austin@cirrus.com>

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

* Re: [PATCH 1/6] ASoC: cs42l52: Cleanup manual bias level transitions
  2014-09-09 18:42 [PATCH 1/6] ASoC: cs42l52: Cleanup manual bias level transitions Lars-Peter Clausen
                   ` (5 preceding siblings ...)
  2014-09-09 18:47 ` [PATCH 1/6] ASoC: cs42l52: " Brian Austin
@ 2014-09-09 20:09 ` Mark Brown
  6 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2014-09-09 20:09 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Brian Austin, alsa-devel, Liam Girdwood, Paul Handrigan,
	Support Opensource


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

On Tue, Sep 09, 2014 at 08:42:40PM +0200, Lars-Peter Clausen 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.

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] 8+ messages in thread

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

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-09 18:42 [PATCH 1/6] ASoC: cs42l52: Cleanup manual bias level transitions Lars-Peter Clausen
2014-09-09 18:42 ` [PATCH 2/6] ASoC: cs42l56: " Lars-Peter Clausen
2014-09-09 18:42 ` [PATCH 3/6] ASoC: cs42l73: " Lars-Peter Clausen
2014-09-09 18:42 ` [PATCH 4/6] ASoC: da732x: Remove unnecessary idle_bias_off initialization Lars-Peter Clausen
2014-09-09 18:42 ` [PATCH 5/6] ASoC: da732x: Remove unused codec field form da732x_priv struct Lars-Peter Clausen
2014-09-09 18:42 ` [PATCH 6/6] ASoC: da732x: Cleanup manual bias level transitions Lars-Peter Clausen
2014-09-09 18:47 ` [PATCH 1/6] ASoC: cs42l52: " Brian Austin
2014-09-09 20:09 ` 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.