blob: 0c574e8607fd9ee7e00b12f350e954db38be936b [file] [log] [blame]
Thomas Gleixnerd2912cb2019-06-04 10:11:33 +02001// SPDX-License-Identifier: GPL-2.0-only
Fabio Estevam8c4300c2016-02-02 19:45:38 -02002/*
3 * Copyright 2016 NXP Semiconductors
Fabio Estevam8c4300c2016-02-02 19:45:38 -02004 */
5
6#include <linux/kernel.h>
7#include <linux/suspend.h>
8#include <linux/io.h>
Arnd Bergmann56925202023-05-16 17:31:00 +02009#include "common.h"
Fabio Estevam8c4300c2016-02-02 19:45:38 -020010
11static int imx25_suspend_enter(suspend_state_t state)
12{
13 if (!IS_ENABLED(CONFIG_PM))
14 return 0;
15
16 switch (state) {
17 case PM_SUSPEND_MEM:
18 cpu_do_idle();
19 break;
20 default:
21 return -EINVAL;
22 }
23
24 return 0;
25}
26
27static const struct platform_suspend_ops imx25_suspend_ops = {
28 .enter = imx25_suspend_enter,
29 .valid = suspend_valid_only_mem,
30};
31
32void __init imx25_pm_init(void)
33{
34 suspend_set_ops(&imx25_suspend_ops);
35}