diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2013-07-29 11:14:03 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-07-29 13:41:00 -0400 |
commit | 39eb5fd13dff8d3d04489fe3f59e0d22bf89041e (patch) | |
tree | ef11f2aaf8b84fcea1a8564912a71b768f3a1e23 /sound/soc/soc-dapm.c | |
parent | 2553628e1973709bf378320ecffd3e4fb34458db (diff) |
ASoC: dapm: Delay w->power update until the changes are written
Wait with updating the widgets power field until the changes are actually
written to the hardware in dapm_seq_run_coalesced(). This will allow us to query
the current hardware state between calling dapm_power_one_widget() and actually
writing the new power state to hardware.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r-- | sound/soc/soc-dapm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index b811a27bf21a..9abb3b21f1fd 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -293,6 +293,7 @@ static void dapm_reset(struct snd_soc_card *card) | |||
293 | memset(&card->dapm_stats, 0, sizeof(card->dapm_stats)); | 293 | memset(&card->dapm_stats, 0, sizeof(card->dapm_stats)); |
294 | 294 | ||
295 | list_for_each_entry(w, &card->widgets, list) { | 295 | list_for_each_entry(w, &card->widgets, list) { |
296 | w->new_power = w->power; | ||
296 | w->power_checked = false; | 297 | w->power_checked = false; |
297 | w->inputs = -1; | 298 | w->inputs = -1; |
298 | w->outputs = -1; | 299 | w->outputs = -1; |
@@ -1340,7 +1341,7 @@ static void dapm_seq_check_event(struct snd_soc_card *card, | |||
1340 | return; | 1341 | return; |
1341 | } | 1342 | } |
1342 | 1343 | ||
1343 | if (w->power != power) | 1344 | if (w->new_power != power) |
1344 | return; | 1345 | return; |
1345 | 1346 | ||
1346 | if (w->event && (w->event_flags & event)) { | 1347 | if (w->event && (w->event_flags & event)) { |
@@ -1369,6 +1370,7 @@ static void dapm_seq_run_coalesced(struct snd_soc_card *card, | |||
1369 | 1370 | ||
1370 | list_for_each_entry(w, pending, power_list) { | 1371 | list_for_each_entry(w, pending, power_list) { |
1371 | BUG_ON(reg != w->reg); | 1372 | BUG_ON(reg != w->reg); |
1373 | w->power = w->new_power; | ||
1372 | 1374 | ||
1373 | mask |= w->mask << w->shift; | 1375 | mask |= w->mask << w->shift; |
1374 | if (w->power) | 1376 | if (w->power) |
@@ -1676,8 +1678,6 @@ static void dapm_widget_set_power(struct snd_soc_dapm_widget *w, bool power, | |||
1676 | dapm_seq_insert(w, up_list, true); | 1678 | dapm_seq_insert(w, up_list, true); |
1677 | else | 1679 | else |
1678 | dapm_seq_insert(w, down_list, false); | 1680 | dapm_seq_insert(w, down_list, false); |
1679 | |||
1680 | w->power = power; | ||
1681 | } | 1681 | } |
1682 | 1682 | ||
1683 | static void dapm_power_one_widget(struct snd_soc_dapm_widget *w, | 1683 | static void dapm_power_one_widget(struct snd_soc_dapm_widget *w, |
@@ -1752,7 +1752,7 @@ static int dapm_power_widgets(struct snd_soc_card *card, int event) | |||
1752 | break; | 1752 | break; |
1753 | } | 1753 | } |
1754 | 1754 | ||
1755 | if (w->power) { | 1755 | if (w->new_power) { |
1756 | d = w->dapm; | 1756 | d = w->dapm; |
1757 | 1757 | ||
1758 | /* Supplies and micbiases only bring the | 1758 | /* Supplies and micbiases only bring the |