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>
This commit is contained in:
parent
0c2487f6b4
commit
88c377dd98
@ -44,9 +44,36 @@ struct omap3_idle_statedata {
|
|||||||
u32 core_state;
|
u32 core_state;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define OMAP3_NUM_STATES 7
|
struct omap3_idle_statedata omap3_idle_data[] = {
|
||||||
|
{
|
||||||
struct omap3_idle_statedata omap3_idle_data[OMAP3_NUM_STATES];
|
.mpu_state = PWRDM_POWER_ON,
|
||||||
|
.core_state = PWRDM_POWER_ON,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.mpu_state = PWRDM_POWER_ON,
|
||||||
|
.core_state = PWRDM_POWER_ON,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.mpu_state = PWRDM_POWER_RET,
|
||||||
|
.core_state = PWRDM_POWER_ON,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.mpu_state = PWRDM_POWER_OFF,
|
||||||
|
.core_state = PWRDM_POWER_ON,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.mpu_state = PWRDM_POWER_RET,
|
||||||
|
.core_state = PWRDM_POWER_RET,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.mpu_state = PWRDM_POWER_OFF,
|
||||||
|
.core_state = PWRDM_POWER_RET,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.mpu_state = PWRDM_POWER_OFF,
|
||||||
|
.core_state = PWRDM_POWER_OFF,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
struct powerdomain *mpu_pd, *core_pd, *per_pd, *cam_pd;
|
struct powerdomain *mpu_pd, *core_pd, *per_pd, *cam_pd;
|
||||||
|
|
||||||
@ -172,7 +199,7 @@ static int next_valid_state(struct cpuidle_device *dev,
|
|||||||
(cx->core_state >= core_deepest_state)) {
|
(cx->core_state >= core_deepest_state)) {
|
||||||
return index;
|
return index;
|
||||||
} else {
|
} else {
|
||||||
int idx = OMAP3_NUM_STATES - 1;
|
int idx = ARRAY_SIZE(omap3_idle_data) - 1;
|
||||||
|
|
||||||
/* Reach the current state starting at highest C-state */
|
/* Reach the current state starting at highest C-state */
|
||||||
for (; idx >= 0; idx--) {
|
for (; idx >= 0; idx--) {
|
||||||
@ -334,7 +361,7 @@ struct cpuidle_driver omap3_idle_driver = {
|
|||||||
.desc = "MPU OFF + CORE OFF",
|
.desc = "MPU OFF + CORE OFF",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
.state_count = OMAP3_NUM_STATES,
|
.state_count = ARRAY_SIZE(omap3_idle_data),
|
||||||
.safe_state_index = 0,
|
.safe_state_index = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user