summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tango/pm.c
blob: 08d813234b2daeaa37142bae2141101bd7bbaab0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <linux/init.h>
#include <linux/suspend.h>
#include <asm/suspend.h>
#include "smc.h"
#include "pm.h"

static int tango_pm_powerdown(unsigned long arg)
{
	tango_suspend(virt_to_phys(cpu_resume));

	return -EIO; /* tango_suspend has failed */
}

static int tango_pm_enter(suspend_state_t state)
{
	if (state == PM_SUSPEND_MEM)
		return cpu_suspend(0, tango_pm_powerdown);

	return -EINVAL;
}

static const struct platform_suspend_ops tango_pm_ops = {
	.enter = tango_pm_enter,
	.valid = suspend_valid_only_mem,
};

void __init tango_pm_init(void)
{
	suspend_set_ops(&tango_pm_ops);
}