summaryrefslogtreecommitdiff
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2010-05-07 20:24:05 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-05-10 10:36:36 +0100
commit9949788b793826f2d19e929ac0219ad0e0891e2d (patch)
treeed3fa0ff51350bf7da9735020a4d1849376bb56a /sound/soc/soc-core.c
parent50ae8384cde9a67714ff03010493c5052690624e (diff)
ASoC: Refactor DAPM suspend handling
Instead of using stream events to handle power down during suspend integrate the handling with the normal widget path checking by replacing all cases where we report a connected endpoint in a path with a function snd_soc_dapm_suspend_check() which looks at the ALSA power state for the card and reports false if we are in a D3 state. Since the core moves us into D3 prior to initating the suspend all power checks during suspend will cause the widgets to be powered down. In order to ensure that widgets are powered up on resume set the card to D2 at the start of resume handling (ALSA API calls require D0 so we are still protected against userspace access). Tested-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r--sound/soc/soc-core.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 4079223203eb..95739767ec45 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -963,6 +963,9 @@ static void soc_resume_deferred(struct work_struct *work)
dev_dbg(socdev->dev, "starting resume work\n");
+ /* Bring us up into D2 so that DAPM starts enabling things */
+ snd_power_change_state(codec->card, SNDRV_CTL_POWER_D2);
+
if (card->resume_pre)
card->resume_pre(pdev);