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