diff options
-rw-r--r-- | sound/soc/soc-core.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 6e710f705a74..6c62d4a54cdf 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -767,11 +767,21 @@ static int soc_resume(struct platform_device *pdev) | |||
767 | { | 767 | { |
768 | struct snd_soc_device *socdev = platform_get_drvdata(pdev); | 768 | struct snd_soc_device *socdev = platform_get_drvdata(pdev); |
769 | struct snd_soc_card *card = socdev->card; | 769 | struct snd_soc_card *card = socdev->card; |
770 | struct snd_soc_dai *cpu_dai = card->dai_link[0].cpu_dai; | ||
770 | 771 | ||
771 | dev_dbg(socdev->dev, "scheduling resume work\n"); | 772 | /* AC97 devices might have other drivers hanging off them so |
772 | 773 | * need to resume immediately. Other drivers don't have that | |
773 | if (!schedule_work(&card->deferred_resume_work)) | 774 | * problem and may take a substantial amount of time to resume |
774 | dev_err(socdev->dev, "resume work item may be lost\n"); | 775 | * due to I/O costs and anti-pop so handle them out of line. |
776 | */ | ||
777 | if (cpu_dai->ac97_control) { | ||
778 | dev_dbg(socdev->dev, "Resuming AC97 immediately\n"); | ||
779 | soc_resume_deferred(&card->deferred_resume_work); | ||
780 | } else { | ||
781 | dev_dbg(socdev->dev, "Scheduling resume work\n"); | ||
782 | if (!schedule_work(&card->deferred_resume_work)) | ||
783 | dev_err(socdev->dev, "resume work item may be lost\n"); | ||
784 | } | ||
775 | 785 | ||
776 | return 0; | 786 | return 0; |
777 | } | 787 | } |