Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[sfrench/cifs-2.6.git] / arch / arm / mach-tango / pm.c
1 // SPDX-License-Identifier: GPL-2.0
2 #include <linux/init.h>
3 #include <linux/suspend.h>
4 #include <asm/suspend.h>
5 #include "smc.h"
6
7 static int tango_pm_powerdown(unsigned long arg)
8 {
9         tango_suspend(__pa_symbol(cpu_resume));
10
11         return -EIO; /* tango_suspend has failed */
12 }
13
14 static int tango_pm_enter(suspend_state_t state)
15 {
16         if (state == PM_SUSPEND_MEM)
17                 return cpu_suspend(0, tango_pm_powerdown);
18
19         return -EINVAL;
20 }
21
22 static const struct platform_suspend_ops tango_pm_ops = {
23         .enter = tango_pm_enter,
24         .valid = suspend_valid_only_mem,
25 };
26
27 static int __init tango_pm_init(void)
28 {
29         suspend_set_ops(&tango_pm_ops);
30         return 0;
31 }
32
33 late_initcall(tango_pm_init);