diff options
Diffstat (limited to 'sound')
-rw-r--r-- | 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 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( | |||
169 | return NULL; | 169 | return NULL; |
170 | } | 170 | } |
171 | 171 | ||
172 | static void dapm_reset(struct snd_soc_card *card) | ||
173 | { | ||
174 | struct snd_soc_dapm_widget *w; | ||
175 | |||
176 | memset(&card->dapm_stats, 0, sizeof(card->dapm_stats)); | ||
177 | |||
178 | list_for_each_entry(w, &card->widgets, list) { | ||
179 | w->power_checked = false; | ||
180 | w->inputs = -1; | ||
181 | w->outputs = -1; | ||
182 | } | ||
183 | } | ||
184 | |||
172 | static int soc_widget_read(struct snd_soc_dapm_widget *w, int reg) | 185 | static int soc_widget_read(struct snd_soc_dapm_widget *w, int reg) |
173 | { | 186 | { |
174 | if (w->codec) | 187 | if (w->codec) |
@@ -1402,13 +1415,7 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event) | |||
1402 | } | 1415 | } |
1403 | } | 1416 | } |
1404 | 1417 | ||
1405 | memset(&card->dapm_stats, 0, sizeof(card->dapm_stats)); | 1418 | dapm_reset(card); |
1406 | |||
1407 | list_for_each_entry(w, &card->widgets, list) { | ||
1408 | w->power_checked = false; | ||
1409 | w->inputs = -1; | ||
1410 | w->outputs = -1; | ||
1411 | } | ||
1412 | 1419 | ||
1413 | /* Check which widgets we need to power and store them in | 1420 | /* Check which widgets we need to power and store them in |
1414 | * lists indicating if they should be powered up or down. We | 1421 | * lists indicating if they should be powered up or down. We |