aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2009-06-22 08:16:51 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-06-23 18:48:53 -0400
commit517374704da44c1ba77c1600714fe214524af286 (patch)
tree878a914bb5bd383e5f883bffc2e5cbf884366a6e /sound/soc/soc-core.c
parent30808ca751c3b8d81e948efb8fed7451a8321010 (diff)
ASoC: Add a shutdown callback
Ensure that the audio subsystem is powered down cleanly when the system shuts down by providing a shutdown operation. This ensures that all the components have been returned to an off state cleanly which should avoid audio issues from partially charged capacitors or noise on digital inputs if the system is restarted quickly. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Tested-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r--sound/soc/soc-core.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 44141178ff4a..55d45c43ba16 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1020,6 +1020,21 @@ static int soc_remove(struct platform_device *pdev)
1020 return 0; 1020 return 0;
1021} 1021}
1022 1022
1023static void soc_shutdown(struct platform_device *pdev)
1024{
1025 struct snd_soc_device *socdev = platform_get_drvdata(pdev);
1026 struct snd_soc_card *card = socdev->card;
1027
1028 if (!card->instantiated)
1029 return;
1030
1031 /* Flush out pmdown_time work - we actually do want to run it
1032 * now, we're shutting down so no imminent restart. */
1033 run_delayed_work(&card->delayed_work);
1034
1035 snd_soc_dapm_shutdown(socdev);
1036}
1037
1023/* ASoC platform driver */ 1038/* ASoC platform driver */
1024static struct platform_driver soc_driver = { 1039static struct platform_driver soc_driver = {
1025 .driver = { 1040 .driver = {
@@ -1030,6 +1045,7 @@ static struct platform_driver soc_driver = {
1030 .remove = soc_remove, 1045 .remove = soc_remove,
1031 .suspend = soc_suspend, 1046 .suspend = soc_suspend,
1032 .resume = soc_resume, 1047 .resume = soc_resume,
1048 .shutdown = soc_shutdown,
1033}; 1049};
1034 1050
1035/* create a new pcm */ 1051/* create a new pcm */