mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
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 <[email protected]>.
Signed-off-by: Sergei Shtylyov <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
This commit is contained in:
parent
82bf90c628
commit
bf44a4175e
1 changed files with 3 additions and 5 deletions
|
|
@ -600,7 +600,9 @@ static int sh_dmae_runtime_resume(struct device *dev)
|
|||
|
||||
return sh_dmae_rst(shdev);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int sh_dmae_suspend(struct device *dev)
|
||||
{
|
||||
return 0;
|
||||
|
|
@ -632,14 +634,10 @@ static int sh_dmae_resume(struct device *dev)
|
|||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
#define sh_dmae_suspend NULL
|
||||
#define sh_dmae_resume NULL
|
||||
#endif
|
||||
|
||||
static const struct dev_pm_ops sh_dmae_pm = {
|
||||
.suspend = sh_dmae_suspend,
|
||||
.resume = sh_dmae_resume,
|
||||
SET_SYSTEM_SLEEP_PM_OPS(sh_dmae_suspend, sh_dmae_resume)
|
||||
SET_RUNTIME_PM_OPS(sh_dmae_runtime_suspend, sh_dmae_runtime_resume,
|
||||
NULL)
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue