Commit 2354eb5a authored by Paul Walmsley's avatar Paul Walmsley Committed by paul

OMAP powerdomain/PM: use symbolic constants for the max number of power states

Replace some bare constants with power states.
Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
parent 6a06fa68
...@@ -326,7 +326,7 @@ int pm_dbg_regset_save(int reg_set) ...@@ -326,7 +326,7 @@ int pm_dbg_regset_save(int reg_set)
return 0; return 0;
} }
static const char pwrdm_state_names[][4] = { static const char pwrdm_state_names[][PWRDM_MAX_PWRSTS] = {
"OFF", "OFF",
"RET", "RET",
"INA", "INA",
...@@ -381,7 +381,7 @@ static int pwrdm_dbg_show_counter(struct powerdomain *pwrdm, void *user) ...@@ -381,7 +381,7 @@ static int pwrdm_dbg_show_counter(struct powerdomain *pwrdm, void *user)
seq_printf(s, "%s (%s)", pwrdm->name, seq_printf(s, "%s (%s)", pwrdm->name,
pwrdm_state_names[pwrdm->state]); pwrdm_state_names[pwrdm->state]);
for (i = 0; i < 4; i++) for (i = 0; i < PWRDM_MAX_PWRSTS; i++)
seq_printf(s, ",%s:%d", pwrdm_state_names[i], seq_printf(s, ",%s:%d", pwrdm_state_names[i],
pwrdm->state_counter[i]); pwrdm->state_counter[i]);
......
...@@ -158,7 +158,7 @@ static __init void _pwrdm_setup(struct powerdomain *pwrdm) ...@@ -158,7 +158,7 @@ static __init void _pwrdm_setup(struct powerdomain *pwrdm)
{ {
int i; int i;
for (i = 0; i < 4; i++) for (i = 0; i < PWRDM_MAX_PWRSTS; i++)
pwrdm->state_counter[i] = 0; pwrdm->state_counter[i] = 0;
pwrdm_wait_transition(pwrdm); pwrdm_wait_transition(pwrdm);
......
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
#define PWRDM_POWER_INACTIVE 0x2 #define PWRDM_POWER_INACTIVE 0x2
#define PWRDM_POWER_ON 0x3 #define PWRDM_POWER_ON 0x3
#define PWRDM_MAX_PWRSTS 4
/* Powerdomain allowable state bitfields */ /* Powerdomain allowable state bitfields */
#define PWRSTS_OFF_ON ((1 << PWRDM_POWER_OFF) | \ #define PWRSTS_OFF_ON ((1 << PWRDM_POWER_OFF) | \
(1 << PWRDM_POWER_ON)) (1 << PWRDM_POWER_ON))
...@@ -118,11 +120,11 @@ struct powerdomain { ...@@ -118,11 +120,11 @@ struct powerdomain {
struct list_head node; struct list_head node;
int state; int state;
unsigned state_counter[4]; unsigned state_counter[PWRDM_MAX_PWRSTS];
#ifdef CONFIG_PM_DEBUG #ifdef CONFIG_PM_DEBUG
s64 timer; s64 timer;
s64 state_timer[4]; s64 state_timer[PWRDM_MAX_PWRSTS];
#endif #endif
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment