From patchwork Sun Aug 23 21:32:24 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 43521 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7NLWZQ7004282 for ; Sun, 23 Aug 2009 21:32:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934139AbZHWVcm (ORCPT ); Sun, 23 Aug 2009 17:32:42 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S934141AbZHWVcm (ORCPT ); Sun, 23 Aug 2009 17:32:42 -0400 Received: from mail-ew0-f207.google.com ([209.85.219.207]:35606 "EHLO mail-ew0-f207.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934139AbZHWVcm (ORCPT ); Sun, 23 Aug 2009 17:32:42 -0400 Received: by mail-ew0-f207.google.com with SMTP id 3so1908394ewy.18 for ; Sun, 23 Aug 2009 14:32:44 -0700 (PDT) Received: by 10.210.141.5 with SMTP id o5mr3957339ebd.89.1251063164060; Sun, 23 Aug 2009 14:32:44 -0700 (PDT) Received: from localhost (cs181240116.pp.htv.fi [82.181.240.116]) by mx.google.com with ESMTPS id 5sm9333197eyh.56.2009.08.23.14.32.42 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 23 Aug 2009 14:32:43 -0700 (PDT) From: Kevin Hilman To: linux-omap@vger.kernel.org Cc: "Peter 'p2' De Schrijver" Subject: [PATCH v2 5/7] OMAP: PM debug: make powerdomains use PM-debug counters Date: Mon, 24 Aug 2009 00:32:24 +0300 Message-Id: <1251063146-9255-6-git-send-email-khilman@deeprootsystems.com> X-Mailer: git-send-email 1.6.4 In-Reply-To: <1251063146-9255-5-git-send-email-khilman@deeprootsystems.com> References: <1251063146-9255-1-git-send-email-khilman@deeprootsystems.com> <1251063146-9255-2-git-send-email-khilman@deeprootsystems.com> <1251063146-9255-3-git-send-email-khilman@deeprootsystems.com> <1251063146-9255-4-git-send-email-khilman@deeprootsystems.com> <1251063146-9255-5-git-send-email-khilman@deeprootsystems.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org From: Peter 'p2' De Schrijver 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 files changed, 11 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index a2d9871..5a6cef3 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; }