aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Mack <zonque@gmail.com>2013-09-22 10:50:04 -0400
committerVinod Koul <vinod.koul@intel.com>2013-10-06 22:11:39 -0400
commitf97b98d6d02eea5301f86422ace06e5b53979a0c (patch)
treebe49fd7ce74b5b8adad03c6df4890f0265737daa
parentc95905a6a36858122afe1c334eba64499b39d7a2 (diff)
dma: cppi41: add support for suspend and resume
This patch adds support for suspend/resume functionality to the cppi41 DMA driver. The steps necessary to make the system resume properly were figured out by trial-and-error. The code as it stands now is the minimum that has to be done to put the musb host system on an AM33xx system into an operable state after resume. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r--drivers/dma/cppi41.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c
index d6897067e4cd..167c0223ae9e 100644
--- a/drivers/dma/cppi41.c
+++ b/drivers/dma/cppi41.c
@@ -1045,12 +1045,41 @@ static int cppi41_dma_remove(struct platform_device *pdev)
1045 return 0; 1045 return 0;
1046} 1046}
1047 1047
1048#ifdef CONFIG_PM_SLEEP
1049static int cppi41_suspend(struct device *dev)
1050{
1051 struct cppi41_dd *cdd = dev_get_drvdata(dev);
1052
1053 cppi_writel(0, cdd->usbss_mem + USBSS_IRQ_CLEARR);
1054 disable_sched(cdd);
1055
1056 return 0;
1057}
1058
1059static int cppi41_resume(struct device *dev)
1060{
1061 struct cppi41_dd *cdd = dev_get_drvdata(dev);
1062 int i;
1063
1064 for (i = 0; i < DESCS_AREAS; i++)
1065 cppi_writel(cdd->descs_phys, cdd->qmgr_mem + QMGR_MEMBASE(i));
1066
1067 init_sched(cdd);
1068 cppi_writel(USBSS_IRQ_PD_COMP, cdd->usbss_mem + USBSS_IRQ_ENABLER);
1069
1070 return 0;
1071}
1072#endif
1073
1074static SIMPLE_DEV_PM_OPS(cppi41_pm_ops, cppi41_suspend, cppi41_resume);
1075
1048static struct platform_driver cpp41_dma_driver = { 1076static struct platform_driver cpp41_dma_driver = {
1049 .probe = cppi41_dma_probe, 1077 .probe = cppi41_dma_probe,
1050 .remove = cppi41_dma_remove, 1078 .remove = cppi41_dma_remove,
1051 .driver = { 1079 .driver = {
1052 .name = "cppi41-dma-engine", 1080 .name = "cppi41-dma-engine",
1053 .owner = THIS_MODULE, 1081 .owner = THIS_MODULE,
1082 .pm = &cppi41_pm_ops,
1054 .of_match_table = of_match_ptr(cppi41_dma_ids), 1083 .of_match_table = of_match_ptr(cppi41_dma_ids),
1055 }, 1084 },
1056}; 1085};