summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authorMark Brown2011-09-28 18:02:31 +0200
committerMark Brown2011-10-04 17:50:17 +0200
commit05623c4314cba3971f8476151aff73126127925f (patch)
treec74ab55a9124a088f7fe233105431a1119973536 /sound/soc/soc-dapm.c
parentregulator: Fix return code from regulator_disable_deferred() (diff)
downloadkernel-qcow2-linux-05623c4314cba3971f8476151aff73126127925f.tar.gz
kernel-qcow2-linux-05623c4314cba3971f8476151aff73126127925f.tar.xz
kernel-qcow2-linux-05623c4314cba3971f8476151aff73126127925f.zip
ASoC: Factor write of widget power out into a separate function
Split the decision about what the new power should be out from the implementation of that decision. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index c277228ec967..dcbd4687b42f 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -1197,6 +1197,23 @@ static void dapm_post_sequence_async(void *data, async_cookie_t cookie)
}
}
+static void dapm_widget_set_power(struct snd_soc_dapm_widget *w, bool power,
+ struct list_head *up_list,
+ struct list_head *down_list)
+{
+ if (w->power == power)
+ return;
+
+ trace_snd_soc_dapm_widget_power(w, power);
+
+ if (power)
+ dapm_seq_insert(w, up_list, true);
+ else
+ dapm_seq_insert(w, down_list, false);
+
+ w->power = power;
+}
+
static void dapm_power_one_widget(struct snd_soc_dapm_widget *w,
struct list_head *up_list,
struct list_head *down_list)
@@ -1241,17 +1258,7 @@ static void dapm_power_one_widget(struct snd_soc_dapm_widget *w,
}
}
- if (w->power == power)
- break;
-
- trace_snd_soc_dapm_widget_power(w, power);
-
- if (power)
- dapm_seq_insert(w, up_list, true);
- else
- dapm_seq_insert(w, down_list, false);
-
- w->power = power;
+ dapm_widget_set_power(w, power, up_list, down_list);
break;
}
}