From 6199ab2690ca6f44f838603da079b3faa837e502 Mon Sep 17 00:00:00 2001 From: Peter 'p2' De Schrijver Date: Wed, 15 Oct 2008 18:13:49 +0300 Subject: 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 Signed-off-by: Kevin Hilman --- arch/arm/mach-omap2/powerdomain.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index a2d98718c6d..5a6cef3e42b 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c @@ -35,6 +35,8 @@ #include #include +#include "pm.h" + enum { PWRDM_STATE_NOW = 0, PWRDM_STATE_PREV, @@ -134,19 +136,21 @@ static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag) if (state != prev) pwrdm->state_counter[state]++; + pm_dbg_update_time(pwrdm, prev); + pwrdm->state = state; return 0; } -static int _pwrdm_pre_transition_cb(struct powerdomain *pwrdm) +static int _pwrdm_pre_transition_cb(struct powerdomain *pwrdm, void *unused) { pwrdm_clear_all_prev_pwrst(pwrdm); _pwrdm_state_switch(pwrdm, PWRDM_STATE_NOW); return 0; } -static int _pwrdm_post_transition_cb(struct powerdomain *pwrdm) +static int _pwrdm_post_transition_cb(struct powerdomain *pwrdm, void *unused) { _pwrdm_state_switch(pwrdm, PWRDM_STATE_PREV); return 0; @@ -282,7 +286,8 @@ struct powerdomain *pwrdm_lookup(const char *name) * anything else to indicate failure; or -EINVAL if the function * pointer is null. */ -int pwrdm_for_each(int (*fn)(struct powerdomain *pwrdm)) +int pwrdm_for_each(int (*fn)(struct powerdomain *pwrdm, void *user), + void *user) { struct powerdomain *temp_pwrdm; unsigned long flags; @@ -293,7 +298,7 @@ int pwrdm_for_each(int (*fn)(struct powerdomain *pwrdm)) read_lock_irqsave(&pwrdm_rwlock, flags); list_for_each_entry(temp_pwrdm, &pwrdm_list, node) { - ret = (*fn)(temp_pwrdm); + ret = (*fn)(temp_pwrdm, user); if (ret) break; } @@ -1198,13 +1203,13 @@ int pwrdm_clk_state_switch(struct clk *clk) int pwrdm_pre_transition(void) { - pwrdm_for_each(_pwrdm_pre_transition_cb); + pwrdm_for_each(_pwrdm_pre_transition_cb, NULL); return 0; } int pwrdm_post_transition(void) { - pwrdm_for_each(_pwrdm_post_transition_cb); + pwrdm_for_each(_pwrdm_post_transition_cb, NULL); return 0; } -- cgit v1.2.3