Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * Copyright 2016 NXP Semiconductors
0004  */
0005 
0006 #include <linux/kernel.h>
0007 #include <linux/suspend.h>
0008 #include <linux/io.h>
0009 
0010 static int imx25_suspend_enter(suspend_state_t state)
0011 {
0012     if (!IS_ENABLED(CONFIG_PM))
0013         return 0;
0014 
0015     switch (state) {
0016     case PM_SUSPEND_MEM:
0017         cpu_do_idle();
0018         break;
0019     default:
0020         return -EINVAL;
0021     }
0022 
0023     return 0;
0024 }
0025 
0026 static const struct platform_suspend_ops imx25_suspend_ops = {
0027     .enter = imx25_suspend_enter,
0028     .valid = suspend_valid_only_mem,
0029 };
0030 
0031 void __init imx25_pm_init(void)
0032 {
0033     suspend_set_ops(&imx25_suspend_ops);
0034 }