aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/cpuidle34xx.c
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2012-04-24 10:05:34 -0400
committerKevin Hilman <khilman@ti.com>2012-05-03 16:19:30 -0400
commit88c377dd9835495a19043d3ec848eac6ef8658cf (patch)
tree0fd0721de7707ecf6ed57181bdb18d5a8fa426fd /arch/arm/mach-omap2/cpuidle34xx.c
parent0c2487f6b44a33c5a5876d5f8c59f5e17fd2ef68 (diff)
ARM: OMAP3: define statically the omap3_idle_data
Initialize the omap3_idle_data array at compile time, that will allow to remove the initialization at boot time. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Reviewed-by: Jean Pihet <j-pihet@ti.com> Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Tested-by: Kevin Hilman <khilman@ti.com> Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/cpuidle34xx.c')
-rw-r--r--arch/arm/mach-omap2/cpuidle34xx.c37
1 files changed, 32 insertions, 5 deletions
diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c
index a82a8873840e..93e2450ee885 100644
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -44,9 +44,36 @@ struct omap3_idle_statedata {
44 u32 core_state; 44 u32 core_state;
45}; 45};
46 46
47#define OMAP3_NUM_STATES 7 47struct omap3_idle_statedata omap3_idle_data[] = {
48 48 {
49struct omap3_idle_statedata omap3_idle_data[OMAP3_NUM_STATES]; 49 .mpu_state = PWRDM_POWER_ON,
50 .core_state = PWRDM_POWER_ON,
51 },
52 {
53 .mpu_state = PWRDM_POWER_ON,
54 .core_state = PWRDM_POWER_ON,
55 },
56 {
57 .mpu_state = PWRDM_POWER_RET,
58 .core_state = PWRDM_POWER_ON,
59 },
60 {
61 .mpu_state = PWRDM_POWER_OFF,
62 .core_state = PWRDM_POWER_ON,
63 },
64 {
65 .mpu_state = PWRDM_POWER_RET,
66 .core_state = PWRDM_POWER_RET,
67 },
68 {
69 .mpu_state = PWRDM_POWER_OFF,
70 .core_state = PWRDM_POWER_RET,
71 },
72 {
73 .mpu_state = PWRDM_POWER_OFF,
74 .core_state = PWRDM_POWER_OFF,
75 },
76};
50 77
51struct powerdomain *mpu_pd, *core_pd, *per_pd, *cam_pd; 78struct powerdomain *mpu_pd, *core_pd, *per_pd, *cam_pd;
52 79
@@ -172,7 +199,7 @@ static int next_valid_state(struct cpuidle_device *dev,
172 (cx->core_state >= core_deepest_state)) { 199 (cx->core_state >= core_deepest_state)) {
173 return index; 200 return index;
174 } else { 201 } else {
175 int idx = OMAP3_NUM_STATES - 1; 202 int idx = ARRAY_SIZE(omap3_idle_data) - 1;
176 203
177 /* Reach the current state starting at highest C-state */ 204 /* Reach the current state starting at highest C-state */
178 for (; idx >= 0; idx--) { 205 for (; idx >= 0; idx--) {
@@ -334,7 +361,7 @@ struct cpuidle_driver omap3_idle_driver = {
334 .desc = "MPU OFF + CORE OFF", 361 .desc = "MPU OFF + CORE OFF",
335 }, 362 },
336 }, 363 },
337 .state_count = OMAP3_NUM_STATES, 364 .state_count = ARRAY_SIZE(omap3_idle_data),
338 .safe_state_index = 0, 365 .safe_state_index = 0,
339}; 366};
340 367