blob: 610eabbc78bf27bbba9dfb830e7c1e0118d3ede7 [file] [log] [blame]
Thomas Gleixnerc942fdd2019-05-27 08:55:06 +02001// SPDX-License-Identifier: GPL-2.0-or-later
Shawn Guo376e9c52011-01-24 17:05:25 +08002/*
3 * Copyright (C) 2010 Freescale Semiconductor, Inc.
Shawn Guo376e9c52011-01-24 17:05:25 +08004 */
5
6#include <linux/kernel.h>
7#include <linux/suspend.h>
8#include <linux/io.h>
Fabio Estevam75433602013-07-16 10:32:39 -03009#include "pm.h"
Shawn Guo376e9c52011-01-24 17:05:25 +080010
11static int mxs_suspend_enter(suspend_state_t state)
12{
13 switch (state) {
14 case PM_SUSPEND_MEM:
Nicolas Pitreae940912011-12-19 03:03:58 -050015 cpu_do_idle();
Shawn Guo376e9c52011-01-24 17:05:25 +080016 break;
17
18 default:
19 return -EINVAL;
20 }
21 return 0;
22}
23
Arvind Yadav5cd6bc62017-08-30 22:17:51 +053024static const struct platform_suspend_ops mxs_suspend_ops = {
Shawn Guo376e9c52011-01-24 17:05:25 +080025 .enter = mxs_suspend_enter,
26 .valid = suspend_valid_only_mem,
27};
28
Shawn Guo45680992013-03-29 14:41:27 +080029void __init mxs_pm_init(void)
Shawn Guo376e9c52011-01-24 17:05:25 +080030{
31 suspend_set_ops(&mxs_suspend_ops);
Shawn Guo376e9c52011-01-24 17:05:25 +080032}