diff options
Diffstat (limited to 'arch/powerpc/sysdev/fsl_pmc.c')
-rw-r--r-- | arch/powerpc/sysdev/fsl_pmc.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/arch/powerpc/sysdev/fsl_pmc.c b/arch/powerpc/sysdev/fsl_pmc.c index 61dba33..e56edfa 100644 --- a/arch/powerpc/sysdev/fsl_pmc.c +++ b/arch/powerpc/sysdev/fsl_pmc.c @@ -21,6 +21,7 @@ #include <linux/device.h> #include <linux/of_platform.h> #include <linux/pm.h> +#include <asm/fsl_pm.h> #include <asm/switch_to.h> #include <asm/cacheflush.h> @@ -163,16 +164,25 @@ static int pmc_suspend_enter(suspend_state_t state) static int pmc_suspend_valid(suspend_state_t state) { + set_pm_suspend_state(state); + if (((pmc_flag & PMC_SLEEP) && (state == PM_SUSPEND_STANDBY)) || ((pmc_flag & PMC_DEEP_SLEEP) && (state == PM_SUSPEND_MEM))) return 1; - else - return 0; + + set_pm_suspend_state(PM_SUSPEND_ON); + return 0; +} + +static void pmc_suspend_end(void) +{ + set_pm_suspend_state(PM_SUSPEND_ON); } static const struct platform_suspend_ops pmc_suspend_ops = { .valid = pmc_suspend_valid, .enter = pmc_suspend_enter, + .end = pmc_suspend_end, }; static int pmc_probe(struct platform_device *pdev) @@ -191,6 +201,7 @@ static int pmc_probe(struct platform_device *pdev) pmc_flag |= PMC_DEEP_SLEEP | PMC_LOSSLESS; suspend_set_ops(&pmc_suspend_ops); + set_pm_suspend_state(PM_SUSPEND_ON); pr_info("Freescale PMC driver\n"); return 0; |