diff options
author | Daniel Lezcano <daniel.lezcano@linaro.org> | 2013-04-23 04:54:45 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-04-23 07:45:23 -0400 |
commit | 54a4644b7a31b017375018d8266a22d3eabfcf0e (patch) | |
tree | 0b7452cb2f8fa25abacfd16e42e30f6bfc8c2513 /arch/arm/mach-imx/cpuidle-imx5.c | |
parent | 3aec034590d98cb268b3a1f434a602b3d53b0ad2 (diff) |
ARM: imx: cpuidle: use init/exit common routine
The code intializes the cpuidle driver at different places.
The cpuidle driver for :
* imx5 : is in the pm-imx5.c, the init function is in cpuidle.c
* imx6 : is in cpuidle-imx6q.c, the init function is in cpuidle.c
and cpuidle-imx6q.c
Instead of having the cpuidle code spread across different files,
let's create a driver for each SoC and use the common register function.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'arch/arm/mach-imx/cpuidle-imx5.c')
-rw-r--r-- | arch/arm/mach-imx/cpuidle-imx5.c | 37 |
1 files changed, 37 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 000000000000..5a47e3c6172f --- /dev/null +++ b/arch/arm/mach-imx/cpuidle-imx5.c | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
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 | |||
13 | static 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 | |||
20 | static 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, | ||
27 | .flags = CPUIDLE_FLAG_TIME_VALID, | ||
28 | .name = "IMX5 SRPG", | ||
29 | .desc = "CPU state retained,powered off", | ||
30 | }, | ||
31 | .state_count = 1, | ||
32 | }; | ||
33 | |||
34 | int __init imx5_cpuidle_init(void) | ||
35 | { | ||
36 | return cpuidle_register(&imx5_cpuidle_driver, NULL); | ||
37 | } | ||