aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2014-10-25 11:42:01 -0400
committerMark Brown <broonie@kernel.org>2014-10-27 20:19:59 -0400
commit8be4da29cf5b8ec65e974c36e7ae4d90b381ac5e (patch)
tree1b2fc6fd4bf6d3190cd23d53fff77ddb019e55d8 /sound
parentc1862c8bae520a8986dd7c47ce33f16eb7c791c2 (diff)
ASoC: dapm: Mark endpoints instead of IO widgets dirty during suspend/resume
The state of endpoint widgets is affected by that card's power state. Endpoint widgets that do no have the ignore_suspend flag set will be considered inactive during suspend. So they have to be re-checked and marked dirty after the card's power state changes. Currently the input and output widgets are marked dirty instead, this works most of the time since typically a path from one endpoint to another will go via a input or output widget. But marking the endpoints dirty is technically more correct and will also work for odd corner cases. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/soc-core.c8
-rw-r--r--sound/soc/soc-dapm.c15
2 files changed, 8 insertions, 15 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 4c8f8a23a0e9..443be0061129 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -629,8 +629,8 @@ int snd_soc_suspend(struct device *dev)
629 SND_SOC_DAPM_STREAM_SUSPEND); 629 SND_SOC_DAPM_STREAM_SUSPEND);
630 } 630 }
631 631
632 /* Recheck all analogue paths too */ 632 /* Recheck all endpoints too, their state is affected by suspend */
633 dapm_mark_io_dirty(&card->dapm); 633 dapm_mark_endpoints_dirty(card);
634 snd_soc_dapm_sync(&card->dapm); 634 snd_soc_dapm_sync(&card->dapm);
635 635
636 /* suspend all CODECs */ 636 /* suspend all CODECs */
@@ -796,8 +796,8 @@ static void soc_resume_deferred(struct work_struct *work)
796 /* userspace can access us now we are back as we were before */ 796 /* userspace can access us now we are back as we were before */
797 snd_power_change_state(card->snd_card, SNDRV_CTL_POWER_D0); 797 snd_power_change_state(card->snd_card, SNDRV_CTL_POWER_D0);
798 798
799 /* Recheck all analogue paths too */ 799 /* Recheck all endpoints too, their state is affected by suspend */
800 dapm_mark_io_dirty(&card->dapm); 800 dapm_mark_endpoints_dirty(card);
801 snd_soc_dapm_sync(&card->dapm); 801 snd_soc_dapm_sync(&card->dapm);
802} 802}
803 803
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index d89be153a9e0..ffcda7ecd832 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -159,27 +159,20 @@ static void dapm_mark_dirty(struct snd_soc_dapm_widget *w, const char *reason)
159 } 159 }
160} 160}
161 161
162void dapm_mark_io_dirty(struct snd_soc_dapm_context *dapm) 162void dapm_mark_endpoints_dirty(struct snd_soc_card *card)
163{ 163{
164 struct snd_soc_card *card = dapm->card;
165 struct snd_soc_dapm_widget *w; 164 struct snd_soc_dapm_widget *w;
166 165
167 mutex_lock(&card->dapm_mutex); 166 mutex_lock(&card->dapm_mutex);
168 167
169 list_for_each_entry(w, &card->widgets, list) { 168 list_for_each_entry(w, &card->widgets, list) {
170 switch (w->id) { 169 if (w->is_sink || w->is_source)
171 case snd_soc_dapm_input: 170 dapm_mark_dirty(w, "Rechecking endpoints");
172 case snd_soc_dapm_output:
173 dapm_mark_dirty(w, "Rechecking inputs and outputs");
174 break;
175 default:
176 break;
177 }
178 } 171 }
179 172
180 mutex_unlock(&card->dapm_mutex); 173 mutex_unlock(&card->dapm_mutex);
181} 174}
182EXPORT_SYMBOL_GPL(dapm_mark_io_dirty); 175EXPORT_SYMBOL_GPL(dapm_mark_endpoints_dirty);
183 176
184/* create a new dapm widget */ 177/* create a new dapm widget */
185static inline struct snd_soc_dapm_widget *dapm_cnew_widget( 178static inline struct snd_soc_dapm_widget *dapm_cnew_widget(