diff options
author | Fabio Estevam <fabio.estevam@nxp.com> | 2016-02-02 22:45:38 +0100 |
---|---|---|
committer | Shawn Guo <shawnguo@kernel.org> | 2016-02-14 04:24:18 +0100 |
commit | 8c4300c227ffffc4db26b6bb3e0271de7ddbd289 (patch) | |
tree | 8a1a081e908cfa580287125d7d9c06e7a61ab624 /arch/arm/mach-imx/pm-imx25.c | |
parent | ARM: imx: Add msl code support for imx6qp (diff) | |
download | linux-8c4300c227ffffc4db26b6bb3e0271de7ddbd289.tar.xz linux-8c4300c227ffffc4db26b6bb3e0271de7ddbd289.zip |
ARM: mx25: Add basic suspend/resume support
Tested basic suspend/resume on a mx25pdk:
$ echo enabled > /sys/class/tty/ttymxc0/power/wakeup
$ echo mem > /sys/power/state
Then press any key in the serial console and the system wakes up.
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Diffstat (limited to 'arch/arm/mach-imx/pm-imx25.c')
-rw-r--r-- | arch/arm/mach-imx/pm-imx25.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/pm-imx25.c b/arch/arm/mach-imx/pm-imx25.c new file mode 100644 index 000000000000..8bba9fcd96f6 --- /dev/null +++ b/arch/arm/mach-imx/pm-imx25.c @@ -0,0 +1,37 @@ +/* + * Copyright 2016 NXP Semiconductors + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include <linux/kernel.h> +#include <linux/suspend.h> +#include <linux/io.h> + +static int imx25_suspend_enter(suspend_state_t state) +{ + if (!IS_ENABLED(CONFIG_PM)) + return 0; + + switch (state) { + case PM_SUSPEND_MEM: + cpu_do_idle(); + break; + default: + return -EINVAL; + } + + return 0; +} + +static const struct platform_suspend_ops imx25_suspend_ops = { + .enter = imx25_suspend_enter, + .valid = suspend_valid_only_mem, +}; + +void __init imx25_pm_init(void) +{ + suspend_set_ops(&imx25_suspend_ops); +} |