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