Commit 05623c43 authored by Mark Brown's avatar Mark Brown

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: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent aa59802d
...@@ -1197,6 +1197,23 @@ static void dapm_post_sequence_async(void *data, async_cookie_t cookie) ...@@ -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, static void dapm_power_one_widget(struct snd_soc_dapm_widget *w,
struct list_head *up_list, struct list_head *up_list,
struct list_head *down_list) struct list_head *down_list)
...@@ -1241,17 +1258,7 @@ static void dapm_power_one_widget(struct snd_soc_dapm_widget *w, ...@@ -1241,17 +1258,7 @@ static void dapm_power_one_widget(struct snd_soc_dapm_widget *w,
} }
} }
if (w->power == power) dapm_widget_set_power(w, power, up_list, down_list);
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;
break; break;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment