blob: 3feca526d16b8f1171b445563956be84ce830deb [file] [log] [blame]
Daniel Lezcano54a46442013-04-23 08:54:45 +00001/*
2 * Copyright (C) 2012 Freescale Semiconductor, Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#include <linux/cpuidle.h>
10#include <linux/module.h>
11#include <asm/system_misc.h>
12
13static int imx5_cpuidle_enter(struct cpuidle_device *dev,
14 struct cpuidle_driver *drv, int index)
15{
16 arm_pm_idle();
17 return index;
18}
19
20static struct cpuidle_driver imx5_cpuidle_driver = {
21 .name = "imx5_cpuidle",
22 .owner = THIS_MODULE,
23 .states[0] = {
24 .enter = imx5_cpuidle_enter,
25 .exit_latency = 2,
26 .target_residency = 1,
Daniel Lezcano54a46442013-04-23 08:54:45 +000027 .name = "IMX5 SRPG",
28 .desc = "CPU state retained,powered off",
29 },
30 .state_count = 1,
31};
32
33int __init imx5_cpuidle_init(void)
34{
35 return cpuidle_register(&imx5_cpuidle_driver, NULL);
36}