diff options
author | Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com> | 2008-10-15 11:13:49 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2009-09-02 18:08:24 -0400 |
commit | 6199ab2690ca6f44f838603da079b3faa837e502 (patch) | |
tree | 429262219735ee7e01b227d15d77a9ea24455f1b /arch/arm/mach-omap2/powerdomain.c | |
parent | 331b93f41dff21c8f95709032cb184fb82bf2003 (diff) |
OMAP: PM debug: make powerdomains use PM-debug counters
Make the powerdomain code call the new hook for updating the time.
Also implement the updated pwrdm_for_each.
Signed-off-by: Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-omap2/powerdomain.c')
-rw-r--r-- | arch/arm/mach-omap2/powerdomain.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index a2d98718c6d7..5a6cef3e42bf 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c | |||
@@ -35,6 +35,8 @@ | |||
35 | #include <mach/powerdomain.h> | 35 | #include <mach/powerdomain.h> |
36 | #include <mach/clockdomain.h> | 36 | #include <mach/clockdomain.h> |
37 | 37 | ||
38 | #include "pm.h" | ||
39 | |||
38 | enum { | 40 | enum { |
39 | PWRDM_STATE_NOW = 0, | 41 | PWRDM_STATE_NOW = 0, |
40 | PWRDM_STATE_PREV, | 42 | PWRDM_STATE_PREV, |
@@ -134,19 +136,21 @@ static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag) | |||
134 | if (state != prev) | 136 | if (state != prev) |
135 | pwrdm->state_counter[state]++; | 137 | pwrdm->state_counter[state]++; |
136 | 138 | ||
139 | pm_dbg_update_time(pwrdm, prev); | ||
140 | |||
137 | pwrdm->state = state; | 141 | pwrdm->state = state; |
138 | 142 | ||
139 | return 0; | 143 | return 0; |
140 | } | 144 | } |
141 | 145 | ||
142 | static int _pwrdm_pre_transition_cb(struct powerdomain *pwrdm) | 146 | static int _pwrdm_pre_transition_cb(struct powerdomain *pwrdm, void *unused) |
143 | { | 147 | { |
144 | pwrdm_clear_all_prev_pwrst(pwrdm); | 148 | pwrdm_clear_all_prev_pwrst(pwrdm); |
145 | _pwrdm_state_switch(pwrdm, PWRDM_STATE_NOW); | 149 | _pwrdm_state_switch(pwrdm, PWRDM_STATE_NOW); |
146 | return 0; | 150 | return 0; |
147 | } | 151 | } |
148 | 152 | ||
149 | static int _pwrdm_post_transition_cb(struct powerdomain *pwrdm) | 153 | static int _pwrdm_post_transition_cb(struct powerdomain *pwrdm, void *unused) |
150 | { | 154 | { |
151 | _pwrdm_state_switch(pwrdm, PWRDM_STATE_PREV); | 155 | _pwrdm_state_switch(pwrdm, PWRDM_STATE_PREV); |
152 | return 0; | 156 | return 0; |
@@ -282,7 +286,8 @@ struct powerdomain *pwrdm_lookup(const char *name) | |||
282 | * anything else to indicate failure; or -EINVAL if the function | 286 | * anything else to indicate failure; or -EINVAL if the function |
283 | * pointer is null. | 287 | * pointer is null. |
284 | */ | 288 | */ |
285 | int pwrdm_for_each(int (*fn)(struct powerdomain *pwrdm)) | 289 | int pwrdm_for_each(int (*fn)(struct powerdomain *pwrdm, void *user), |
290 | void *user) | ||
286 | { | 291 | { |
287 | struct powerdomain *temp_pwrdm; | 292 | struct powerdomain *temp_pwrdm; |
288 | unsigned long flags; | 293 | unsigned long flags; |
@@ -293,7 +298,7 @@ int pwrdm_for_each(int (*fn)(struct powerdomain *pwrdm)) | |||
293 | 298 | ||
294 | read_lock_irqsave(&pwrdm_rwlock, flags); | 299 | read_lock_irqsave(&pwrdm_rwlock, flags); |
295 | list_for_each_entry(temp_pwrdm, &pwrdm_list, node) { | 300 | list_for_each_entry(temp_pwrdm, &pwrdm_list, node) { |
296 | ret = (*fn)(temp_pwrdm); | 301 | ret = (*fn)(temp_pwrdm, user); |
297 | if (ret) | 302 | if (ret) |
298 | break; | 303 | break; |
299 | } | 304 | } |
@@ -1198,13 +1203,13 @@ int pwrdm_clk_state_switch(struct clk *clk) | |||
1198 | 1203 | ||
1199 | int pwrdm_pre_transition(void) | 1204 | int pwrdm_pre_transition(void) |
1200 | { | 1205 | { |
1201 | pwrdm_for_each(_pwrdm_pre_transition_cb); | 1206 | pwrdm_for_each(_pwrdm_pre_transition_cb, NULL); |
1202 | return 0; | 1207 | return 0; |
1203 | } | 1208 | } |
1204 | 1209 | ||
1205 | int pwrdm_post_transition(void) | 1210 | int pwrdm_post_transition(void) |
1206 | { | 1211 | { |
1207 | pwrdm_for_each(_pwrdm_post_transition_cb); | 1212 | pwrdm_for_each(_pwrdm_post_transition_cb, NULL); |
1208 | return 0; | 1213 | return 0; |
1209 | } | 1214 | } |
1210 | 1215 | ||