From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: alsa-devel@alsa-project.org
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: [PATCH 7/7] ASoC: Make DAPM power sequence lists local variables
Date: Mon, 8 Jun 2009 15:28:53 +0100 [thread overview]
Message-ID: <1244471333-6485-7-git-send-email-broonie@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <20090608142734.GA6137@rakim.wolfsonmicro.main>
They are now only accessed within dapm_power_widgets() so can be local
to that function.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
include/sound/soc.h | 2 --
sound/soc/soc-dapm.c | 19 ++++++++-----------
2 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/include/sound/soc.h b/include/sound/soc.h
index cf6111d..5964dd6 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -369,8 +369,6 @@ struct snd_soc_codec {
enum snd_soc_bias_level bias_level;
enum snd_soc_bias_level suspend_bias_level;
struct delayed_work delayed_work;
- struct list_head up_list;
- struct list_head down_list;
/* codec DAI's */
struct snd_soc_dai *dai;
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 7299ce4..1c30da1 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -927,23 +927,22 @@ static int dapm_power_widgets(struct snd_soc_codec *codec, int event)
{
struct snd_soc_device *socdev = codec->socdev;
struct snd_soc_dapm_widget *w;
+ LIST_HEAD(up_list);
+ LIST_HEAD(down_list);
int ret = 0;
int power;
int sys_power = 0;
- INIT_LIST_HEAD(&codec->up_list);
- INIT_LIST_HEAD(&codec->down_list);
-
/* Check which widgets we need to power and store them in
* lists indicating if they should be powered up or down.
*/
list_for_each_entry(w, &codec->dapm_widgets, list) {
switch (w->id) {
case snd_soc_dapm_pre:
- dapm_seq_insert(w, &codec->down_list, dapm_down_seq);
+ dapm_seq_insert(w, &down_list, dapm_down_seq);
break;
case snd_soc_dapm_post:
- dapm_seq_insert(w, &codec->up_list, dapm_up_seq);
+ dapm_seq_insert(w, &up_list, dapm_up_seq);
break;
default:
@@ -958,11 +957,9 @@ static int dapm_power_widgets(struct snd_soc_codec *codec, int event)
continue;
if (power)
- dapm_seq_insert(w, &codec->up_list,
- dapm_up_seq);
+ dapm_seq_insert(w, &up_list, dapm_up_seq);
else
- dapm_seq_insert(w, &codec->down_list,
- dapm_down_seq);
+ dapm_seq_insert(w, &down_list, dapm_down_seq);
w->power = power;
break;
@@ -979,10 +976,10 @@ static int dapm_power_widgets(struct snd_soc_codec *codec, int event)
}
/* Power down widgets first; try to avoid amplifying pops. */
- dapm_seq_run(codec, &codec->down_list, event, dapm_down_seq);
+ dapm_seq_run(codec, &down_list, event, dapm_down_seq);
/* Now power up. */
- dapm_seq_run(codec, &codec->up_list, event, dapm_up_seq);
+ dapm_seq_run(codec, &up_list, event, dapm_up_seq);
/* If we just powered the last thing off drop to standby bias */
if (codec->bias_level == SND_SOC_BIAS_PREPARE && !sys_power) {
--
1.6.3.1
prev parent reply other threads:[~2009-06-08 14:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-08 14:27 [PATCH 0/7] DAPM power sequencing changes Mark Brown
2009-06-08 14:28 ` [PATCH 1/7] ASoC: Sort DAPM power sequences while building lists Mark Brown
2009-06-08 14:28 ` [PATCH 2/7] ASoC: Factor out DAPM sequence execution Mark Brown
2009-06-08 14:28 ` [PATCH 3/7] ASoC: Coalesce register writes for DAPM sequences Mark Brown
2009-06-08 14:28 ` [PATCH 4/7] ASoC: Sort specialised mixers and muxes together Mark Brown
2009-06-08 14:28 ` [PATCH 5/7] ASoC: Coalesce power updates for DAPM widgets with events Mark Brown
2009-06-08 14:28 ` [PATCH 6/7] ASoC: Coalesce power updates for PGAs Mark Brown
2009-06-08 14:28 ` Mark Brown [this message]
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=1244471333-6485-7-git-send-email-broonie@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
/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 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.