]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/soc/soc-core.c
ASoC: Don't defer resume work for AC97 codecs
[linux-2.6-omap-h63xx.git] / sound / soc / soc-core.c
index 6e710f705a749d5c3162c87cd47793ac68db006f..6c62d4a54cdf9f6c6d1781061adf140059e8347d 100644 (file)
@@ -767,11 +767,21 @@ static int soc_resume(struct platform_device *pdev)
 {
        struct snd_soc_device *socdev = platform_get_drvdata(pdev);
        struct snd_soc_card *card = socdev->card;
+       struct snd_soc_dai *cpu_dai = card->dai_link[0].cpu_dai;
 
-       dev_dbg(socdev->dev, "scheduling resume work\n");
-
-       if (!schedule_work(&card->deferred_resume_work))
-               dev_err(socdev->dev, "resume work item may be lost\n");
+       /* AC97 devices might have other drivers hanging off them so
+        * need to resume immediately.  Other drivers don't have that
+        * problem and may take a substantial amount of time to resume
+        * due to I/O costs and anti-pop so handle them out of line.
+        */
+       if (cpu_dai->ac97_control) {
+               dev_dbg(socdev->dev, "Resuming AC97 immediately\n");
+               soc_resume_deferred(&card->deferred_resume_work);
+       } else {
+               dev_dbg(socdev->dev, "Scheduling resume work\n");
+               if (!schedule_work(&card->deferred_resume_work))
+                       dev_err(socdev->dev, "resume work item may be lost\n");
+       }
 
        return 0;
 }