diff options
author | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> | 2015-01-20 16:13:21 -0500 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2015-02-12 02:22:18 -0500 |
commit | bf44a4175e566c72ae2d01929f76a04a9e861e0d (patch) | |
tree | 6938a44a9251186e4096ba02f96b49f7058f2a02 /drivers/dma | |
parent | 82bf90c62834842249c4f94535079f5cbec9014c (diff) |
dmaengine: shdmac: extend PM methods
In order to make it possible to restore from hibernation not only in Linux but
also in e.g. U-Boot, we have to use sh_dmae_{suspend|resume}() for the {freeze|
thaw|restore}() PM methods. It's handy to achieve this with SIMPLE_DEV_PM_OPS()
macro; since that macro doesn't do anything when CONFIG_PM_SLEEP is undefined,
we don't need to #define sh_dmae_{suspend|resume} NULL anymore but we'll have to
enclose sh_dmae_{suspend|resume}() into the new #ifdef...
Based on original patch by Mikhail Ulyanov <mikhail.ulyanov@cogentembedded.com>.
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/sh/shdmac.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/dma/sh/shdmac.c b/drivers/dma/sh/shdmac.c index 023344f7f78e..b2431aa30033 100644 --- a/drivers/dma/sh/shdmac.c +++ b/drivers/dma/sh/shdmac.c | |||
@@ -600,7 +600,9 @@ static int sh_dmae_runtime_resume(struct device *dev) | |||
600 | 600 | ||
601 | return sh_dmae_rst(shdev); | 601 | return sh_dmae_rst(shdev); |
602 | } | 602 | } |
603 | #endif | ||
603 | 604 | ||
605 | #ifdef CONFIG_PM_SLEEP | ||
604 | static int sh_dmae_suspend(struct device *dev) | 606 | static int sh_dmae_suspend(struct device *dev) |
605 | { | 607 | { |
606 | return 0; | 608 | return 0; |
@@ -632,14 +634,10 @@ static int sh_dmae_resume(struct device *dev) | |||
632 | 634 | ||
633 | return 0; | 635 | return 0; |
634 | } | 636 | } |
635 | #else | ||
636 | #define sh_dmae_suspend NULL | ||
637 | #define sh_dmae_resume NULL | ||
638 | #endif | 637 | #endif |
639 | 638 | ||
640 | static const struct dev_pm_ops sh_dmae_pm = { | 639 | static const struct dev_pm_ops sh_dmae_pm = { |
641 | .suspend = sh_dmae_suspend, | 640 | SET_SYSTEM_SLEEP_PM_OPS(sh_dmae_suspend, sh_dmae_resume) |
642 | .resume = sh_dmae_resume, | ||
643 | SET_RUNTIME_PM_OPS(sh_dmae_runtime_suspend, sh_dmae_runtime_resume, | 641 | SET_RUNTIME_PM_OPS(sh_dmae_runtime_suspend, sh_dmae_runtime_resume, |
644 | NULL) | 642 | NULL) |
645 | }; | 643 | }; |