diff options
author | Robert Lee <rob.lee@linaro.org> | 2012-03-19 20:15:51 -0500 |
---|---|---|
committer | Robert Lee <b18647@b18647-12.(none)> | 2012-03-19 20:42:46 -0500 |
commit | 1dfe2d069e719d7714389454cab4599aafe41dbc (patch) | |
tree | e16d5be281d5ca1ef934328a4c0209185ef2eb75 /arch/arm/mach-imx/cpuidle-imx5.c | |
parent | d030a8b5e4c9d696bf5410300504f278773e01b0 (diff) |
ARM: imx: Add imx5 cpuidle driver
Add imx5 cpuidle driver.
Signed-off-by: Robert Lee <rob.lee@linaro.org>
Diffstat (limited to 'arch/arm/mach-imx/cpuidle-imx5.c')
-rw-r--r-- | arch/arm/mach-imx/cpuidle-imx5.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/cpuidle-imx5.c b/arch/arm/mach-imx/cpuidle-imx5.c new file mode 100644 index 00000000000..4553fdc94ea --- /dev/null +++ b/arch/arm/mach-imx/cpuidle-imx5.c @@ -0,0 +1,49 @@ +/* + * Copyright 2012 Freescale Semiconductor, Inc. + * Copyright 2012 Linaro Ltd. + * + * The code contained herein is licensed under the GNU General Public + * License. You may obtain a copy of the GNU General Public License + * Version 2 or later at the following locations: + * + * http://www.opensource.org/licenses/gpl-license.html + * http://www.gnu.org/copyleft/gpl.html + */ + +#include <linux/kernel.h> +#include <linux/init.h> +#include <linux/export.h> +#include <linux/cpuidle.h> +#include <mach/common.h> +#include <mach/cpuidle.h> +#include <mach/hardware.h> + +static int imx5_cpuidle_enter(struct cpuidle_device *dev, + struct cpuidle_driver *drv, int idx) +{ + imx5_idle(); + + return idx; +} + +static struct cpuidle_driver imx5_cpuidle_driver = { + .name = "imx5_cpuidle", + .owner = THIS_MODULE, + .en_core_tk_irqen = 1, + .states[0] = { + .enter = imx5_cpuidle_enter, + .exit_latency = 20, /* max latency at 160MHz */ + .target_residency = 1, + .flags = CPUIDLE_FLAG_TIME_VALID, + .name = "IMX5 SRPG", + .desc = "CPU state retained,powered off", + }, + .state_count = 1, +}; + +int __init imx5_cpuidle_init(void) +{ + imx_cpuidle_set_driver(&imx5_cpuidle_driver); + + return 0; +} |