summaryrefslogtreecommitdiff
path: root/drivers/dma
diff options
context:
space:
mode:
authorPrashant Gaikwad <pgaikwad@nvidia.com>2013-10-15 17:38:36 +0530
committerBharat Nihalani <bnihalani@nvidia.com>2013-10-17 05:18:37 -0700
commit8c2db9fb100cacccf3e2fa06fef691783d5904cd (patch)
tree5f80b6fd5d57fc180e8c1f6276508c5dbf7ee7c4 /drivers/dma
parent23b7df412b6896ebee18377de8047ac22bb8ce72 (diff)
apbdma: tegra: save and restore apbdma context
Save apbdma context before entering LP0 from cpuidle and restore on exit. Bug 1254633 Change-Id: Idb21d6b8807064ea9b522f4ca99031b9c18e9f5e Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com> Reviewed-on: http://git-master/r/299482 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/tegra20-apb-dma.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
index 1e82d16fd7e3..23f8e02d478d 100644
--- a/drivers/dma/tegra20-apb-dma.c
+++ b/drivers/dma/tegra20-apb-dma.c
@@ -1345,6 +1345,8 @@ static struct platform_device_id tegra_dma_devtype[] = {
},
};
+static struct device *dma_device;
+
static int tegra_dma_probe(struct platform_device *pdev)
{
struct resource *res;
@@ -1396,6 +1398,8 @@ static int tegra_dma_probe(struct platform_device *pdev)
spin_lock_init(&tdma->global_lock);
+ dma_device = &pdev->dev;
+
tegra_pd_add_device(&pdev->dev);
pm_runtime_enable(&pdev->dev);
if (!pm_runtime_enabled(&pdev->dev)) {
@@ -1613,6 +1617,16 @@ static int tegra_dma_pm_resume(struct device *dev)
}
#endif
+int tegra_dma_save(void)
+{
+ return tegra_dma_pm_suspend(dma_device);
+}
+
+int tegra_dma_restore(void)
+{
+ return tegra_dma_pm_resume(dma_device);
+}
+
static const struct dev_pm_ops tegra_dma_dev_pm_ops = {
#ifdef CONFIG_PM_RUNTIME
.runtime_suspend = tegra_dma_runtime_suspend,