2011-04-29 00:36:07 +07:00
|
|
|
/*
|
|
|
|
* CPUIdle 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/cpuidle.h>
|
|
|
|
#include <linux/suspend.h>
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/err.h>
|
2012-03-21 03:22:48 +07:00
|
|
|
#include <asm/cpuidle.h>
|
2011-04-29 00:36:07 +07:00
|
|
|
#include <asm/io.h>
|
|
|
|
|
2012-08-16 01:58:19 +07:00
|
|
|
static struct cpuidle_driver shmobile_cpuidle_default_driver = {
|
2012-03-21 03:22:48 +07:00
|
|
|
.name = "shmobile_cpuidle",
|
|
|
|
.owner = THIS_MODULE,
|
|
|
|
.states[0] = ARM_CPUIDLE_WFI_STATE,
|
|
|
|
.safe_state_index = 0, /* C1 */
|
|
|
|
.state_count = 1,
|
2011-04-29 00:36:07 +07:00
|
|
|
};
|
|
|
|
|
2012-08-16 01:58:19 +07:00
|
|
|
static struct cpuidle_driver *cpuidle_drv = &shmobile_cpuidle_default_driver;
|
|
|
|
|
2013-04-03 19:15:15 +07:00
|
|
|
void __init shmobile_cpuidle_set_driver(struct cpuidle_driver *drv)
|
2012-08-16 01:58:19 +07:00
|
|
|
{
|
|
|
|
cpuidle_drv = drv;
|
|
|
|
}
|
2011-04-29 00:36:07 +07:00
|
|
|
|
2013-04-03 19:15:15 +07:00
|
|
|
int __init shmobile_cpuidle_init(void)
|
2011-04-29 00:36:07 +07:00
|
|
|
{
|
2013-04-23 15:54:38 +07:00
|
|
|
return cpuidle_register(cpuidle_drv, NULL);
|
2011-04-29 00:36:07 +07:00
|
|
|
}
|