From patchwork Wed May 18 07:37:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Menon X-Patchwork-Id: 792982 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4I7bqvM028870 for ; Wed, 18 May 2011 07:38:01 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755031Ab1ERHiA (ORCPT ); Wed, 18 May 2011 03:38:00 -0400 Received: from na3sys009aog101.obsmtp.com ([74.125.149.67]:33394 "EHLO na3sys009aog101.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755009Ab1ERHiA (ORCPT ); Wed, 18 May 2011 03:38:00 -0400 Received: from mail-gw0-f47.google.com ([74.125.83.47]) (using TLSv1) by na3sys009aob101.postini.com ([74.125.148.12]) with SMTP ID DSNKTdN3VyOr77H+Ng+5rE0ZX1ow/n2RX9Hi@postini.com; Wed, 18 May 2011 00:38:00 PDT Received: by mail-gw0-f47.google.com with SMTP id 11so519020gwb.20 for ; Wed, 18 May 2011 00:37:59 -0700 (PDT) Received: by 10.236.9.5 with SMTP id 5mr1556626yhs.426.1305704279561; Wed, 18 May 2011 00:37:59 -0700 (PDT) Received: from localhost (dragon.ti.com [192.94.94.33]) by mx.google.com with ESMTPS id 41sm573590yha.65.2011.05.18.00.37.58 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 18 May 2011 00:37:58 -0700 (PDT) From: Nishanth Menon To: kevin Cc: linux-omap , Nishanth Menon Subject: [PM-WIP_CPUFREQ][PATCH 4/6 v2] OMAP2: cpufreq: use clk_init_cpufreq_table if OPPs not available Date: Wed, 18 May 2011 02:37:44 -0500 Message-Id: <1305704266-17623-5-git-send-email-nm@ti.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <[PM-WIP_CPUFREQ][PATCH 0/5] Cleanups for cpufreq> References: <[PM-WIP_CPUFREQ][PATCH 0/5] Cleanups for cpufreq> 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 (demeter2.kernel.org [140.211.167.43]); Wed, 18 May 2011 07:38:01 +0000 (UTC) OMAP2 does not use OPP tables at the moment for DVFS. Currently, we depend on opp table initialization to give us the freq_table, which makes sense for OMAP3+. for OMAP2, we should be using clk_init_cpufreq_table - so if the opp based frequency table initilization fails, fall back to clk_init_cpufreq_table to give us the table. Signed-off-by: Nishanth Menon --- arch/arm/mach-omap2/omap2plus-cpufreq.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/omap2plus-cpufreq.c b/arch/arm/mach-omap2/omap2plus-cpufreq.c index 45f1e9e..854f4b3 100644 --- a/arch/arm/mach-omap2/omap2plus-cpufreq.c +++ b/arch/arm/mach-omap2/omap2plus-cpufreq.c @@ -180,7 +180,13 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy) pr_warning("%s: unable to get the mpu device\n", __func__); return -EINVAL; } - opp_init_cpufreq_table(mpu_dev, &freq_table); + + /* + * if we dont get cpufreq table using opp, use traditional omap2 lookup + * as a fallback + */ + if (opp_init_cpufreq_table(mpu_dev, &freq_table)) + clk_init_cpufreq_table(&freq_table); if (freq_table) { result = cpufreq_frequency_table_cpuinfo(policy, freq_table); @@ -188,6 +194,7 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy) cpufreq_frequency_table_get_attr(freq_table, policy->cpu); } else { + clk_exit_cpufreq_table(&freq_table); WARN(true, "%s: fallback to clk_round(freq_table=%d)\n", __func__, result); kfree(freq_table);