]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - arch/arm/mach-shmobile/suspend.c
Merge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[mirror_ubuntu-artful-kernel.git] / arch / arm / mach-shmobile / suspend.c
CommitLineData
c3dada18
MD
1/*
2 * Suspend-to-RAM support code for SH-Mobile ARM
3 *
4 * Copyright (C) 2011 Magnus Damm
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#include <linux/pm.h>
12#include <linux/suspend.h>
13#include <linux/module.h>
14#include <linux/err.h>
f7b861b7
TG
15#include <linux/cpu.h>
16
c3dada18 17#include <asm/io.h>
9f97da78 18#include <asm/system_misc.h>
c3dada18 19
2e41e5fe
GU
20#include "common.h"
21
c3dada18
MD
22static int shmobile_suspend_default_enter(suspend_state_t suspend_state)
23{
24 cpu_do_idle();
25 return 0;
26}
27
28static int shmobile_suspend_begin(suspend_state_t state)
29{
f7b861b7 30 cpu_idle_poll_ctrl(true);
c3dada18
MD
31 return 0;
32}
33
34static void shmobile_suspend_end(void)
35{
f7b861b7 36 cpu_idle_poll_ctrl(false);
c3dada18
MD
37}
38
39struct platform_suspend_ops shmobile_suspend_ops = {
40 .begin = shmobile_suspend_begin,
41 .end = shmobile_suspend_end,
42 .enter = shmobile_suspend_default_enter,
43 .valid = suspend_valid_only_mem,
44};
45
21cc1b7e 46int __init shmobile_suspend_init(void)
c3dada18
MD
47{
48 suspend_set_ops(&shmobile_suspend_ops);
49 return 0;
50}