From patchwork Wed Mar 30 15:19:24 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean Pihet X-Patchwork-Id: 674431 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2UFRm7E006720 for ; Wed, 30 Mar 2011 15:29:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754710Ab1C3P3I (ORCPT ); Wed, 30 Mar 2011 11:29:08 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:33094 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754572Ab1C3P3H (ORCPT ); Wed, 30 Mar 2011 11:29:07 -0400 Received: by wya21 with SMTP id 21so1184697wya.19 for ; Wed, 30 Mar 2011 08:29:06 -0700 (PDT) Received: by 10.227.150.101 with SMTP id x37mr1401324wbv.225.1301498384400; Wed, 30 Mar 2011 08:19:44 -0700 (PDT) Received: from localhost.localdomain (245.207-245-81.adsl-dyn.isp.belgacom.be [81.245.207.245]) by mx.google.com with ESMTPS id w25sm104997wbd.39.2011.03.30.08.19.42 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 30 Mar 2011 08:19:43 -0700 (PDT) From: jean.pihet@newoldbits.com To: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Kevin Hilman , paul@pwsan.com Cc: Jean Pihet Subject: [PATCH 8/8] OMAP PM: early init of the pwrdms states Date: Wed, 30 Mar 2011 17:19:24 +0200 Message-Id: <1301498364-726-9-git-send-email-j-pihet@ti.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1301498364-726-1-git-send-email-j-pihet@ti.com> References: <1301498364-726-1-git-send-email-j-pihet@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 30 Mar 2011 15:29:09 +0000 (UTC) diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 0c5e3a4..8d202a7 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -840,7 +840,7 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused) if (!pwrst) return -ENOMEM; pwrst->pwrdm = pwrdm; - pwrst->next_state = PWRDM_POWER_RET; + pwrst->next_state = pwrdm_read_next_pwrst(pwrdm); list_add(&pwrst->node, &pwrst_list); if (pwrdm_has_hdwr_sar(pwrdm)) diff --git a/arch/arm/mach-omap2/pm44xx.c b/arch/arm/mach-omap2/pm44xx.c index 76cfff2..ed35482 100644 --- a/arch/arm/mach-omap2/pm44xx.c +++ b/arch/arm/mach-omap2/pm44xx.c @@ -84,7 +84,7 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused) if (!pwrst) return -ENOMEM; pwrst->pwrdm = pwrdm; - pwrst->next_state = PWRDM_POWER_ON; + pwrdm->state = pwrdm_read_pwrst(pwrdm); list_add(&pwrst->node, &pwrst_list); return pwrdm_set_next_pwrst(pwrst->pwrdm, pwrst->next_state); diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index b8d3860..ac8a2d7 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c @@ -78,6 +78,7 @@ static struct powerdomain *_pwrdm_lookup(const char *name) static int _pwrdm_register(struct powerdomain *pwrdm) { int i; + int next_state = PWRDM_POWER_RET; if (!pwrdm || !pwrdm->name) return -EINVAL; @@ -114,6 +115,10 @@ static int _pwrdm_register(struct powerdomain *pwrdm) pwrdm_wait_transition(pwrdm); pwrdm->state = pwrdm_read_pwrst(pwrdm); pwrdm->state_counter[pwrdm->state] = 1; + /* Early init of the next power state */ + if (cpu_is_omap44xx()) + next_state = PWRDM_POWER_ON; + pwrdm_set_next_pwrst(pwrdm, next_state); pr_debug("powerdomain: registered %s\n", pwrdm->name);