summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authorLiam Girdwood <lrg@ti.com>2012-02-15 16:15:34 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-02-15 16:56:49 +0100
commit6c120e19fa587710d80757a6e364961a017fb6c3 (patch)
treedb49eec403cf1a1f4ac9bafe462ff736faef5fc2 /sound/soc/soc-dapm.c
parentASoC: wm8994: Use slow start for VMID (diff)
downloadlinux-6c120e19fa587710d80757a6e364961a017fb6c3.tar.xz
linux-6c120e19fa587710d80757a6e364961a017fb6c3.zip
ASoC: dapm - Make DAPM reset code a separate function.
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> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 0c94027c4e3b..227887e05b70 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