aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-08-31 20:38:32 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-09-05 20:22:19 -0400
commite2d32ff6ce4ee9958f3973a086f3fa5d009e6306 (patch)
treebff37a778887f74c180649f9b86466314306dbf7
parente5ec69da24803c68f5c035662a68d367359a4132 (diff)
ASoC: dapm: Ensure bypass paths are suspended and resumed
Since bypass paths aren't part of DAPM streams and we may not have any DAPM streams there may not be anything that triggers a DAPM sync for them. Mark all input and output widgets as dirty and then sync to do so at the end of suspend and resume. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
-rw-r--r--include/sound/soc-dapm.h1
-rw-r--r--sound/soc/soc-core.c8
-rw-r--r--sound/soc/soc-dapm.c22
3 files changed, 31 insertions, 0 deletions
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index 0a1553748d65..07e2510619a1 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -412,6 +412,7 @@ void snd_soc_dapm_auto_nc_codec_pins(struct snd_soc_codec *codec);
412 412
413/* Mostly internal - should not normally be used */ 413/* Mostly internal - should not normally be used */
414void dapm_mark_dirty(struct snd_soc_dapm_widget *w, const char *reason); 414void dapm_mark_dirty(struct snd_soc_dapm_widget *w, const char *reason);
415void dapm_mark_io_dirty(struct snd_soc_dapm_context *dapm);
415 416
416/* dapm path query */ 417/* dapm path query */
417int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream, 418int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream,
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index b95d1fb388a1..ad65459da28e 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -609,6 +609,10 @@ int snd_soc_suspend(struct device *dev)
609 SND_SOC_DAPM_STREAM_SUSPEND); 609 SND_SOC_DAPM_STREAM_SUSPEND);
610 } 610 }
611 611
612 /* Recheck all analogue paths too */
613 dapm_mark_io_dirty(&card->dapm);
614 snd_soc_dapm_sync(&card->dapm);
615
612 /* suspend all CODECs */ 616 /* suspend all CODECs */
613 list_for_each_entry(codec, &card->codec_dev_list, card_list) { 617 list_for_each_entry(codec, &card->codec_dev_list, card_list) {
614 /* If there are paths active then the CODEC will be held with 618 /* If there are paths active then the CODEC will be held with
@@ -756,6 +760,10 @@ static void soc_resume_deferred(struct work_struct *work)
756 760
757 /* userspace can access us now we are back as we were before */ 761 /* userspace can access us now we are back as we were before */
758 snd_power_change_state(card->snd_card, SNDRV_CTL_POWER_D0); 762 snd_power_change_state(card->snd_card, SNDRV_CTL_POWER_D0);
763
764 /* Recheck all analogue paths too */
765 dapm_mark_io_dirty(&card->dapm);
766 snd_soc_dapm_sync(&card->dapm);
759} 767}
760 768
761/* powers up audio subsystem after a suspend */ 769/* powers up audio subsystem after a suspend */
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index dd7c49fafd75..f7999e949acb 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -141,6 +141,28 @@ void dapm_mark_dirty(struct snd_soc_dapm_widget *w, const char *reason)
141} 141}
142EXPORT_SYMBOL_GPL(dapm_mark_dirty); 142EXPORT_SYMBOL_GPL(dapm_mark_dirty);
143 143
144void dapm_mark_io_dirty(struct snd_soc_dapm_context *dapm)
145{
146 struct snd_soc_card *card = dapm->card;
147 struct snd_soc_dapm_widget *w;
148
149 mutex_lock(&card->dapm_mutex);
150
151 list_for_each_entry(w, &card->widgets, list) {
152 switch (w->id) {
153 case snd_soc_dapm_input:
154 case snd_soc_dapm_output:
155 dapm_mark_dirty(w, "Rechecking inputs and outputs");
156 break;
157 default:
158 break;
159 }
160 }
161
162 mutex_unlock(&card->dapm_mutex);
163}
164EXPORT_SYMBOL_GPL(dapm_mark_io_dirty);
165
144/* create a new dapm widget */ 166/* create a new dapm widget */
145static inline struct snd_soc_dapm_widget *dapm_cnew_widget( 167static inline struct snd_soc_dapm_widget *dapm_cnew_widget(
146 const struct snd_soc_dapm_widget *_widget) 168 const struct snd_soc_dapm_widget *_widget)