All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: dapm - Make DAPM reset code a separate function.
@ 2012-02-15 15:15 Liam Girdwood
  2012-02-15 15:15 ` [PATCH] ASoC: DAPM - Notify stream event to all card components Liam Girdwood
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Liam Girdwood @ 2012-02-15 15:15 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, Liam Girdwood

It's useful to export the DAPM reset as a static function for future use
by other DAPM functions. e.g. The dynamic PCM query widgets resets the DAPM
graph before working out active paths.

Signed-off-by: Liam Girdwood <lrg@ti.com>
---
 sound/soc/soc-dapm.c |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 0c94027..227887e 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -169,6 +169,19 @@ static inline struct snd_soc_card *dapm_get_soc_card(
 	return NULL;
 }
 
+static void dapm_reset(struct snd_soc_card *card)
+{
+	struct snd_soc_dapm_widget *w;
+
+	memset(&card->dapm_stats, 0, sizeof(card->dapm_stats));
+
+	list_for_each_entry(w, &card->widgets, list) {
+		w->power_checked = false;
+		w->inputs = -1;
+		w->outputs = -1;
+	}
+}
+
 static int soc_widget_read(struct snd_soc_dapm_widget *w, int reg)
 {
 	if (w->codec)
@@ -1402,13 +1415,7 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event)
 		}
 	}
 
-	memset(&card->dapm_stats, 0, sizeof(card->dapm_stats));
-
-	list_for_each_entry(w, &card->widgets, list) {
-		w->power_checked = false;
-		w->inputs = -1;
-		w->outputs = -1;
-	}
+	dapm_reset(card);
 
 	/* Check which widgets we need to power and store them in
 	 * lists indicating if they should be powered up or down.  We
-- 
1.7.5.4

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

end of thread, other threads:[~2012-02-15 15:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-15 15:15 [PATCH] ASoC: dapm - Make DAPM reset code a separate function Liam Girdwood
2012-02-15 15:15 ` [PATCH] ASoC: DAPM - Notify stream event to all card components Liam Girdwood
2012-02-15 15:58   ` Mark Brown
2012-02-15 15:15 ` [PATCH] ASoC: core - add platform DAPM debugfs support Liam Girdwood
2012-02-15 15:23   ` Liam Girdwood
2012-02-15 15:15 ` [PATCH] ASoC: core - Codec debugfs init to use dev_warn() Liam Girdwood
2012-02-15 15:59   ` Mark Brown
2012-02-15 15:57 ` [PATCH] ASoC: dapm - Make DAPM reset code a separate function 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.