From patchwork Tue Feb 2 07:17:26 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Menon X-Patchwork-Id: 76234 X-Patchwork-Delegate: omar.ramirez@ti.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 o127HeWN013125 for ; Tue, 2 Feb 2010 07:17:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755410Ab0BBHRd (ORCPT ); Tue, 2 Feb 2010 02:17:33 -0500 Received: from comal.ext.ti.com ([198.47.26.152]:52310 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755038Ab0BBHRc (ORCPT ); Tue, 2 Feb 2010 02:17:32 -0500 Received: from dlep33.itg.ti.com ([157.170.170.112]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id o127HUfX014814 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 2 Feb 2010 01:17:30 -0600 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 o127HTEP027571; Tue, 2 Feb 2010 01:17:29 -0600 (CST) 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 o127HTZ00064; Tue, 2 Feb 2010 01:17:29 -0600 (CST) Received: by senorita (Postfix, from userid 1000) id CEB5BC198; Tue, 2 Feb 2010 01:17:28 -0600 (CST) From: Nishanth Menon To: linux-omap Cc: Nishanth Menon , Ameya Palande , Deepak Chitriki , Felipe Contreras , Hiroshi Doyu , Omar Ramirez Luna , Romit Dasgupta Subject: [PATCH 2/2 v2] DSPBRIDGE: pm: use old implementation for opps Date: Tue, 2 Feb 2010 01:17:26 -0600 Message-Id: <1265095046-25253-3-git-send-email-nm@ti.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1265095046-25253-2-git-send-email-nm@ti.com> References: <1265095046-25253-1-git-send-email-nm@ti.com> <1265095046-25253-2-git-send-email-nm@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.3 (demeter.kernel.org [140.211.167.41]); Tue, 02 Feb 2010 07:17:40 +0000 (UTC) diff --git a/arch/arm/mach-omap2/dspbridge.c b/arch/arm/mach-omap2/dspbridge.c index 8b71e5f..0bcbf2e 100644 --- a/arch/arm/mach-omap2/dspbridge.c +++ b/arch/arm/mach-omap2/dspbridge.c @@ -42,7 +42,70 @@ static struct dspbridge_platform_data dspbridge_pdata __initdata = { static int get_opp_table(struct dspbridge_platform_data *pdata) { #ifdef CONFIG_BRIDGE_DVFS - /* Do nothing now - fill based on PM implementation */ + /* + * TODO: The following code is a direct replacement + * improvements are possible. + */ + /* legacy values for 3430 */ + u32 vdd1_dsp_freq[6][4] = { + {0, 0, 0, 0}, + /*OPP1*/ + {0, 90000, 0, 86000}, + /*OPP2*/ + {0, 180000, 80000, 170000}, + /*OPP3*/ + {0, 360000, 160000, 340000}, + /*OPP4*/ + {0, 396000, 325000, 376000}, + /*OPP5*/ + {0, 430000, 355000, 430000}, + }; + struct omap_opp vdd1_rate_table_bridge[] = { + {0, 0, 0}, + /*OPP1*/ + {S125M, VDD1_OPP1, 0}, + /*OPP2*/ + {S250M, VDD1_OPP2, 0}, + /*OPP3*/ + {S500M, VDD1_OPP3, 0}, + /*OPP4*/ + {S550M, VDD1_OPP4, 0}, + /*OPP5*/ + {S600M, VDD1_OPP5, 0}, + }; + pdata->mpu_num_speeds = VDD1_OPP5; + pdata->mpu_speeds = kzalloc(sizeof(u32) * (pdata->mpu_num_speeds + 1), + GFP_KERNEL); + if (!pdata->mpu_speeds) { + pr_err("%s: unable to allocate memory for the mpu" + "frequencies\n", __func__); + return -ENOMEM; + } + pdata->dsp_num_speeds = VDD1_OPP5; + pdata->dsp_freq_table = kzalloc( + sizeof(struct dsp_shm_freq_table) * + (pdata->dsp_num_speeds + 1), GFP_KERNEL); + if (!pdata->dsp_freq_table) { + pr_err("%s: unable to allocate memory for the dsp" + "frequencies\n", __func__); + kfree(pdata->mpu_speeds); + pdata->mpu_speeds = NULL; + return -ENOMEM; + } + for (i = 0; i <= pdata->mpu_num_speeds; i++) + pdata->mpu_speed[i] = vdd1_rate_table_bridge[i].rate; + pdata->mpu_max_speed = pdata->mpu_speed[VDD1_OPP5]; + pdata->mpu_min_speed = pdata->mpu_speed[VDD1_OPP1]; + + for (i = 0; i <= pdata->dsp_num_speeds; i++) { + pdata->dsp_freq_table[i].u_volts = + vdd1_dsp_freq[i][0]; + pdata->dsp_freq_table[i].dsp_freq = vdd1_dsp_freq[i][1]; + pdata->dsp_freq_table[i].thresh_min_freq = + vdd1_dsp_freq[i][2]; + pdata->dsp_freq_table[i].thresh_max_freq = + vdd1_dsp_freq[i][3]; + } #endif return 0; }