]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ARM: OMAP4: cpuidle - Initialize omap4_idle_data at compile time
authorDaniel Lezcano <daniel.lezcano@linaro.org>
Tue, 24 Apr 2012 14:05:26 +0000 (16:05 +0200)
committerKevin Hilman <khilman@ti.com>
Thu, 3 May 2012 18:00:50 +0000 (11:00 -0700)
We initialize the omap4_idle_data variable at compile time allowing us
to remove in the next patch the initialization done 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>
arch/arm/mach-omap2/cpuidle44xx.c

index 38ecd270a4a8f6be890c503cbf17f09c123093c0..9e3effa59b9afeb0129dd716e2a96bd2eb8b127d 100644 (file)
@@ -31,9 +31,24 @@ struct omap4_idle_statedata {
        u32 mpu_state;
 };
 
-#define OMAP4_NUM_STATES 3
+static struct omap4_idle_statedata omap4_idle_data[] = {
+       {
+               .cpu_state = PWRDM_POWER_ON,
+               .mpu_state = PWRDM_POWER_ON,
+               .mpu_logic_state = PWRDM_POWER_RET,
+       },
+       {
+               .cpu_state = PWRDM_POWER_OFF,
+               .mpu_state = PWRDM_POWER_RET,
+               .mpu_logic_state = PWRDM_POWER_RET,
+       },
+       {
+               .cpu_state = PWRDM_POWER_OFF,
+               .mpu_state = PWRDM_POWER_RET,
+               .mpu_logic_state = PWRDM_POWER_OFF,
+       },
+};
 
-static struct omap4_idle_statedata omap4_idle_data[OMAP4_NUM_STATES];
 static struct powerdomain *mpu_pd, *cpu0_pd, *cpu1_pd;
 
 /**
@@ -152,7 +167,7 @@ struct cpuidle_driver omap4_idle_driver = {
                        .desc = "MPUSS OSWR",
                },
        },
-       .state_count = OMAP4_NUM_STATES,
+       .state_count = ARRAY_SIZE(omap4_idle_data),
        .safe_state_index = 0,
 };