From patchwork Thu May 20 01:14:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Menon X-Patchwork-Id: 101103 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4K1ExkY017594 for ; Thu, 20 May 2010 01:15:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752271Ab0ETBO6 (ORCPT ); Wed, 19 May 2010 21:14:58 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:51673 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751791Ab0ETBO6 (ORCPT ); Wed, 19 May 2010 21:14:58 -0400 Received: from dlep33.itg.ti.com ([157.170.170.112]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id o4K1EuTf011958 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 19 May 2010 20:14:56 -0500 Received: from legion.dal.design.ti.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id o4K1Etr5023607; Wed, 19 May 2010 20:14:56 -0500 (CDT) Received: from senorita (senorita.am.dhcp.ti.com [128.247.75.1]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id o4K1EtP22422; Wed, 19 May 2010 20:14:55 -0500 (CDT) Received: by senorita (Postfix, from userid 1000) id 8CD1FC243; Wed, 19 May 2010 20:14:55 -0500 (CDT) From: Nishanth Menon To: linux-omap Cc: Nishanth Menon , Cliff Brake , Kevin Hilman Subject: [PM][PATCH] omap3: cpufreq: allow default opp table init Date: Wed, 19 May 2010 20:14:53 -0500 Message-Id: <1274318093-29010-1-git-send-email-nm@ti.com> X-Mailer: git-send-email 1.6.3.3 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.3 (demeter.kernel.org [140.211.167.41]); Thu, 20 May 2010 01:15:00 +0000 (UTC) diff --git a/arch/arm/mach-omap2/cpufreq34xx.c b/arch/arm/mach-omap2/cpufreq34xx.c index 8747dd6..b9d75cf 100644 --- a/arch/arm/mach-omap2/cpufreq34xx.c +++ b/arch/arm/mach-omap2/cpufreq34xx.c @@ -110,6 +110,9 @@ static struct omap_opp_def __initdata omap36xx_dsp_rate_table[] = { OMAP_OPP_DEF(0, 0, 0) }; +/* Temp variable to allow multiple calls */ +static u8 __initdata omap3_table_init; + int __init omap3_pm_init_opp_table(void) { int i, r; @@ -130,6 +133,14 @@ int __init omap3_pm_init_opp_table(void) OPP_DSP }; + /* + * Allow multiple calls, but initialize only if not already initalized + * even if the previous call failed, coz, no reason we'd succeed again + */ + if (omap3_table_init) + return 0; + omap3_table_init = 1; + omap3_opp_def_list = cpu_is_omap3630() ? omap36xx_opp_def_list : omap34xx_opp_def_list; diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index 984bdbf..203c7e8 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c @@ -47,6 +47,7 @@ #include "clockdomains.h" #include +#include "omap3-opp.h" /* * The machine specific code may provide the extra mapping besides the * default mapping provided here. @@ -307,6 +308,9 @@ static int __init _omap2_init_reprogram_sdrc(void) void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0, struct omap_sdrc_params *sdrc_cs1) { + /* initialize the opp table if board file has not done so */ + omap3_pm_init_opp_table(); + pwrdm_init(powerdomains_omap); clkdm_init(clockdomains_omap, clkdm_autodeps); if (cpu_is_omap242x())