From patchwork Fri Jul 15 11:44:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Koyamangalath, Abhilash" X-Patchwork-Id: 980352 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6FIIKVT031663 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 15 Jul 2011 18:18:41 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QhmxG-0004Lb-Q4; Fri, 15 Jul 2011 18:17:40 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Qhgot-0005j8-JC; Fri, 15 Jul 2011 11:44:35 +0000 Received: from bear.ext.ti.com ([192.94.94.41]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Qhgon-0005im-2g for linux-arm-kernel@lists.infradead.org; Fri, 15 Jul 2011 11:44:33 +0000 Received: from dlep33.itg.ti.com ([157.170.170.112]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id p6FBiImk015855 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 15 Jul 2011 06:44:19 -0500 Received: from dlep26.itg.ti.com (smtp-le.itg.ti.com [157.170.170.27]) by dlep33.itg.ti.com (8.13.7/8.13.8) with ESMTP id p6FBiIG6029928; Fri, 15 Jul 2011 06:44:18 -0500 (CDT) Received: from dbde71.ent.ti.com (localhost [127.0.0.1]) by dlep26.itg.ti.com (8.13.8/8.13.8) with ESMTP id p6FBi5rC006266; Fri, 15 Jul 2011 06:44:18 -0500 (CDT) Received: from dbdp31.itg.ti.com (172.24.170.98) by DBDE71.ent.ti.com (172.24.170.149) with Microsoft SMTP Server id 8.3.106.1; Fri, 15 Jul 2011 17:14:16 +0530 Received: from localhost.localdomain (dbdp20.itg.ti.com [172.24.170.38]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id p6FBiBLr014736; Fri, 15 Jul 2011 17:14:12 +0530 (IST) From: Abhilash K V To: Subject: [PATCH v2] OMAP3: powerdomains: Match silicon revision to select the correct "core_pwrdm" definition Date: Fri, 15 Jul 2011 17:14:10 +0530 Message-ID: <1310730250-10920-1-git-send-email-abhilash.kv@ti.com> X-Mailer: git-send-email 1.6.2.4 MIME-Version: 1.0 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110715_074429_265593_DE0C04FC X-CRM114-Status: GOOD ( 11.99 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [192.94.94.41 listed in list.dnswl.org] Cc: tony@atomide.com, Abhilash K V , linux@arm.linux.org.uk, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Fri, 15 Jul 2011 18:18:41 +0000 (UTC) powerdomains3xxx_data.c defines core_3xxx_pre_es3_1_pwrdm and core_3xxx_es3_1_pwrdm to take care of differences in "core_pwrdm" implementations across revisions. However,_pwrdm_lookup("core_pwrdm") always matches the first definition for 3630 ES 1.1 and 1.2 which is incorrect. This patch fixes this issue by adding code to match silicon revision as well while looking up "core_pwrdm" in _pwrdm_lookup(). core_3xxx_es3_1_pwrdm is different from core_3xxx_pre_es3_1_pwrdm in that the former adds hardware save-restore support for USBTLL for 3430 ES3.1 and for 3630 ES1.1 and ES1.2. Signed-off-by: Abhilash K V --- v2: * now tested on 3630 (ES1.2 and ES1.0) and 3530 (ES3.0 and ES3.1) * fixed checkpatch errors/warnings. arch/arm/mach-omap2/powerdomain.c | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index 9af0847..82a2e30 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c @@ -32,6 +32,7 @@ #include "powerdomain.h" #include "clockdomain.h" #include +#include #include "pm.h" @@ -58,6 +59,24 @@ static struct powerdomain *_pwrdm_lookup(const char *name) list_for_each_entry(temp_pwrdm, &pwrdm_list, node) { if (!strcmp(name, temp_pwrdm->name)) { + if (!strcmp(name, "core_pwrdm") && cpu_is_omap3630()) { + if (omap_rev() > OMAP3630_REV_ES1_0) { + /* + * match omap_chip info for OMAP3630 + * Rev ES1.1, ES1.2 or higher + */ + if (!(temp_pwrdm->omap_chip.oc + & CHIP_GE_OMAP3630ES1_1)) + continue; + } else { + /* match omap_chip info for OMAP3630 + * Rev ES1.0 + */ + if (!(temp_pwrdm->omap_chip.oc + & CHIP_IS_OMAP3630ES1)) + continue; + } + } pwrdm = temp_pwrdm; break; }