mirror of
https://github.com/torvalds/linux.git
synced 2024-11-18 10:01:43 +00:00
f7b861b7a6
Use the generic idle loop and replace enable/disable_hlt with the respective core functions. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Paul McKenney <paulmck@linux.vnet.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Reviewed-by: Cc: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Cc: Magnus Damm <magnus.damm@gmail.com> Cc: Russell King <linux@arm.linux.org.uk> Tested-by: Kevin Hilman <khilman@linaro.org> # OMAP Link: http://lkml.kernel.org/r/20130321215233.826238797@linutronix.de
49 lines
1016 B
C
49 lines
1016 B
C
/*
|
|
* Suspend-to-RAM support code for SH-Mobile ARM
|
|
*
|
|
* Copyright (C) 2011 Magnus Damm
|
|
*
|
|
* This file is subject to the terms and conditions of the GNU General Public
|
|
* License. See the file "COPYING" in the main directory of this archive
|
|
* for more details.
|
|
*/
|
|
|
|
#include <linux/pm.h>
|
|
#include <linux/suspend.h>
|
|
#include <linux/module.h>
|
|
#include <linux/err.h>
|
|
#include <linux/cpu.h>
|
|
|
|
#include <asm/io.h>
|
|
#include <asm/system_misc.h>
|
|
|
|
static int shmobile_suspend_default_enter(suspend_state_t suspend_state)
|
|
{
|
|
cpu_do_idle();
|
|
return 0;
|
|
}
|
|
|
|
static int shmobile_suspend_begin(suspend_state_t state)
|
|
{
|
|
cpu_idle_poll_ctrl(true);
|
|
return 0;
|
|
}
|
|
|
|
static void shmobile_suspend_end(void)
|
|
{
|
|
cpu_idle_poll_ctrl(false);
|
|
}
|
|
|
|
struct platform_suspend_ops shmobile_suspend_ops = {
|
|
.begin = shmobile_suspend_begin,
|
|
.end = shmobile_suspend_end,
|
|
.enter = shmobile_suspend_default_enter,
|
|
.valid = suspend_valid_only_mem,
|
|
};
|
|
|
|
int __init shmobile_suspend_init(void)
|
|
{
|
|
suspend_set_ops(&shmobile_suspend_ops);
|
|
return 0;
|
|
}
|