2019-05-27 14:55:06 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2011-01-24 17:05:25 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2010 Freescale Semiconductor, Inc.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/suspend.h>
|
|
|
|
#include <linux/io.h>
|
2013-07-16 21:32:39 +08:00
|
|
|
#include "pm.h"
|
2011-01-24 17:05:25 +08:00
|
|
|
|
|
|
|
static int mxs_suspend_enter(suspend_state_t state)
|
|
|
|
{
|
|
|
|
switch (state) {
|
|
|
|
case PM_SUSPEND_MEM:
|
2011-12-19 16:03:58 +08:00
|
|
|
cpu_do_idle();
|
2011-01-24 17:05:25 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2017-08-31 00:47:51 +08:00
|
|
|
static const struct platform_suspend_ops mxs_suspend_ops = {
|
2011-01-24 17:05:25 +08:00
|
|
|
.enter = mxs_suspend_enter,
|
|
|
|
.valid = suspend_valid_only_mem,
|
|
|
|
};
|
|
|
|
|
2013-03-29 14:41:27 +08:00
|
|
|
void __init mxs_pm_init(void)
|
2011-01-24 17:05:25 +08:00
|
|
|
{
|
|
|
|
suspend_set_ops(&mxs_suspend_ops);
|
|
|
|
}
|