summaryrefslogtreecommitdiff
path: root/drivers/dma
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2014-04-23 21:52:04 +0200
committerVinod Koul <vinod.koul@intel.com>2014-05-07 11:50:27 +0530
commitc906a3ec458742c95850c0c1cde9e8b68df25c01 (patch)
tree94a116287bf87c8dbd1bbfd94f91862ff5c70c1c /drivers/dma
parent123e4ca172707267eef5fbe9f0c58bd4c412685c (diff)
dma: ste_dma40: Fixup system suspend/resume
Make sure to handle register context save/restore when needed from system PM callbacks. Previously we solely trusted the device to reside in in-active state while the system suspend callback were invoked, which is just too optimistic. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/ste_dma40.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 0b29af321873..b539fc9b469a 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -2945,7 +2945,11 @@ static int dma40_suspend(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct d40_base *base = platform_get_drvdata(pdev);
- int ret = 0;
+ int ret;
+
+ ret = pm_runtime_force_suspend(dev);
+ if (ret)
+ return ret;
if (base->lcpa_regulator)
ret = regulator_disable(base->lcpa_regulator);
@@ -2958,10 +2962,13 @@ static int dma40_resume(struct device *dev)
struct d40_base *base = platform_get_drvdata(pdev);
int ret = 0;
- if (base->lcpa_regulator)
+ if (base->lcpa_regulator) {
ret = regulator_enable(base->lcpa_regulator);
+ if (ret)
+ return ret;
+ }
- return ret;
+ return pm_runtime_force_resume(dev);
}
#endif