提交 f79b5d8a 编写于 作者: D Daniel Lezcano 提交者: Kevin Hilman

ARM: OMAP3: cpuidle - remove the 'valid' field

With the previous changes all the states are valid, except the last
state which is now handled at runtime by next_valid_state() based on
the errata flags.
Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: NJean Pihet <j-pihet@ti.com>
Reviewed-by: NSantosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: NSantosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: NKevin Hilman <khilman@ti.com>
[khilman@ti.com: minor changelog rework]
Signed-off-by: NKevin Hilman <khilman@ti.com>
上级 92b18d97
...@@ -67,7 +67,6 @@ static struct cpuidle_params cpuidle_params_table[] = { ...@@ -67,7 +67,6 @@ static struct cpuidle_params cpuidle_params_table[] = {
struct omap3_idle_statedata { struct omap3_idle_statedata {
u32 mpu_state; u32 mpu_state;
u32 core_state; u32 core_state;
u8 valid;
}; };
struct omap3_idle_statedata omap3_idle_data[OMAP3_NUM_STATES]; struct omap3_idle_statedata omap3_idle_data[OMAP3_NUM_STATES];
...@@ -191,8 +190,7 @@ static int next_valid_state(struct cpuidle_device *dev, ...@@ -191,8 +190,7 @@ static int next_valid_state(struct cpuidle_device *dev,
} }
/* Check if current state is valid */ /* Check if current state is valid */
if ((cx->valid) && if ((cx->mpu_state >= mpu_deepest_state) &&
(cx->mpu_state >= mpu_deepest_state) &&
(cx->core_state >= core_deepest_state)) { (cx->core_state >= core_deepest_state)) {
return index; return index;
} else { } else {
...@@ -216,8 +214,7 @@ static int next_valid_state(struct cpuidle_device *dev, ...@@ -216,8 +214,7 @@ static int next_valid_state(struct cpuidle_device *dev,
idx--; idx--;
for (; idx >= 0; idx--) { for (; idx >= 0; idx--) {
cx = cpuidle_get_statedata(&dev->states_usage[idx]); cx = cpuidle_get_statedata(&dev->states_usage[idx]);
if ((cx->valid) && if ((cx->mpu_state >= mpu_deepest_state) &&
(cx->mpu_state >= mpu_deepest_state) &&
(cx->core_state >= core_deepest_state)) { (cx->core_state >= core_deepest_state)) {
next_index = idx; next_index = idx;
break; break;
...@@ -371,7 +368,6 @@ static inline struct omap3_idle_statedata *_fill_cstate_usage( ...@@ -371,7 +368,6 @@ static inline struct omap3_idle_statedata *_fill_cstate_usage(
struct omap3_idle_statedata *cx = &omap3_idle_data[idx]; struct omap3_idle_statedata *cx = &omap3_idle_data[idx];
struct cpuidle_state_usage *state_usage = &dev->states_usage[idx]; struct cpuidle_state_usage *state_usage = &dev->states_usage[idx];
cx->valid = cpuidle_params_table[idx].valid;
cpuidle_set_statedata(state_usage, cx); cpuidle_set_statedata(state_usage, cx);
return cx; return cx;
...@@ -386,7 +382,6 @@ static inline struct omap3_idle_statedata *_fill_cstate_usage( ...@@ -386,7 +382,6 @@ static inline struct omap3_idle_statedata *_fill_cstate_usage(
int __init omap3_idle_init(void) int __init omap3_idle_init(void)
{ {
struct cpuidle_device *dev; struct cpuidle_device *dev;
struct cpuidle_driver *drv = &omap3_idle_driver;
struct omap3_idle_statedata *cx; struct omap3_idle_statedata *cx;
mpu_pd = pwrdm_lookup("mpu_pwrdm"); mpu_pd = pwrdm_lookup("mpu_pwrdm");
...@@ -399,7 +394,6 @@ int __init omap3_idle_init(void) ...@@ -399,7 +394,6 @@ int __init omap3_idle_init(void)
/* C1 . MPU WFI + Core active */ /* C1 . MPU WFI + Core active */
cx = _fill_cstate_usage(dev, 0); cx = _fill_cstate_usage(dev, 0);
cx->valid = 1; /* C1 is always valid */
cx->mpu_state = PWRDM_POWER_ON; cx->mpu_state = PWRDM_POWER_ON;
cx->core_state = PWRDM_POWER_ON; cx->core_state = PWRDM_POWER_ON;
...@@ -433,7 +427,6 @@ int __init omap3_idle_init(void) ...@@ -433,7 +427,6 @@ int __init omap3_idle_init(void)
cx->mpu_state = PWRDM_POWER_OFF; cx->mpu_state = PWRDM_POWER_OFF;
cx->core_state = PWRDM_POWER_OFF; cx->core_state = PWRDM_POWER_OFF;
drv->state_count = OMAP3_NUM_STATES;
cpuidle_register_driver(&omap3_idle_driver); cpuidle_register_driver(&omap3_idle_driver);
if (cpuidle_register_device(dev)) { if (cpuidle_register_device(dev)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册