From patchwork Mon Aug 29 18:10:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 1109742 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 p7TICFAb006761 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 29 Aug 2011 18:12:36 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Qy6JG-0005d3-7u; Mon, 29 Aug 2011 18:11:46 +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 1Qy6JF-0007hr-Lz; Mon, 29 Aug 2011 18:11:45 +0000 Received: from na3sys009aog108.obsmtp.com ([74.125.149.199]) by canuck.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1Qy6Hy-0007Yb-CH for linux-arm-kernel@lists.infradead.org; Mon, 29 Aug 2011 18:10:27 +0000 Received: from mail-pz0-f42.google.com ([209.85.210.42]) (using TLSv1) by na3sys009aob108.postini.com ([74.125.148.12]) with SMTP ID DSNKTlvWEJpmDbJRg1rJttpQ+Pj8NpVxiqs6@postini.com; Mon, 29 Aug 2011 11:10:26 PDT Received: by mail-pz0-f42.google.com with SMTP id 37so10715076pzk.29 for ; Mon, 29 Aug 2011 11:10:24 -0700 (PDT) Received: by 10.142.185.10 with SMTP id i10mr557673wff.22.1314641424516; Mon, 29 Aug 2011 11:10:24 -0700 (PDT) Received: from localhost.localdomain (c-24-19-7-36.hsd1.wa.comcast.net. [24.19.7.36]) by mx.google.com with ESMTPS id b7sm19660839pbm.0.2011.08.29.11.10.22 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 29 Aug 2011 11:10:23 -0700 (PDT) From: Kevin Hilman To: linux-omap@vger.kernel.org Subject: [PATCH 2/7] OMAP3+: voltage: move/rename curr_volt from vdd_info into struct voltagedomain Date: Mon, 29 Aug 2011 11:10:44 -0700 Message-Id: <1314641449-5089-3-git-send-email-khilman@ti.com> X-Mailer: git-send-email 1.7.6 In-Reply-To: <1314641449-5089-1-git-send-email-khilman@ti.com> References: <1314641449-5089-1-git-send-email-khilman@ti.com> X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110829_141026_686520_87745E5A X-CRM114-Status: GOOD ( 14.55 ) 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 ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [74.125.149.199 listed in list.dnswl.org] Cc: 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: , MIME-Version: 1.0 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]); Mon, 29 Aug 2011 18:12:36 +0000 (UTC) Track current nominal voltage as part of struct voltagedomain instead of omap_vdd_info, which will soon be removed. Also renames field from curr_volt to nominal_volt. No functional changes. Signed-off-by: Kevin Hilman --- arch/arm/mach-omap2/vc.c | 5 ++--- arch/arm/mach-omap2/voltage.c | 6 +----- arch/arm/mach-omap2/voltage.h | 4 ++-- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c index 38ba13b..130df29 100644 --- a/arch/arm/mach-omap2/vc.c +++ b/arch/arm/mach-omap2/vc.c @@ -119,7 +119,7 @@ int omap_vc_pre_scale(struct voltagedomain *voltdm, } *target_vsel = voltdm->pmic->uv_to_vsel(target_volt); - *current_vsel = voltdm->pmic->uv_to_vsel(vdd->curr_volt); + *current_vsel = voltdm->pmic->uv_to_vsel(voltdm->nominal_volt); /* Setting the ON voltage to the new target voltage */ vc_cmdval = voltdm->read(vc->cmdval_reg); @@ -136,7 +136,6 @@ void omap_vc_post_scale(struct voltagedomain *voltdm, unsigned long target_volt, u8 target_vsel, u8 current_vsel) { - struct omap_vdd_info *vdd = voltdm->vdd; u32 smps_steps = 0, smps_delay = 0; smps_steps = abs(target_vsel - current_vsel); @@ -145,7 +144,7 @@ void omap_vc_post_scale(struct voltagedomain *voltdm, voltdm->pmic->slew_rate) + 2; udelay(smps_delay); - vdd->curr_volt = target_volt; + voltdm->nominal_volt = target_volt; } /* vc_bypass_scale - VC bypass method of voltage scaling */ diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-omap2/voltage.c index 4afb368..1b39e68 100644 --- a/arch/arm/mach-omap2/voltage.c +++ b/arch/arm/mach-omap2/voltage.c @@ -81,16 +81,12 @@ ovdc_out: */ unsigned long omap_voltage_get_nom_volt(struct voltagedomain *voltdm) { - struct omap_vdd_info *vdd; - if (!voltdm || IS_ERR(voltdm)) { pr_warning("%s: VDD specified does not exist!\n", __func__); return 0; } - vdd = voltdm->vdd; - - return vdd->curr_volt; + return voltdm->nominal_volt; } /** diff --git a/arch/arm/mach-omap2/voltage.h b/arch/arm/mach-omap2/voltage.h index e3efbf9..3e32eda 100644 --- a/arch/arm/mach-omap2/voltage.h +++ b/arch/arm/mach-omap2/voltage.h @@ -61,6 +61,7 @@ struct omap_vfsm_instance { * @vdd: to be removed * @pwrdms: powerdomains in this voltagedomain * @scale: function used to scale the voltage of the voltagedomain + * @nominal_volt: current nominal voltage for this voltage domain */ struct voltagedomain { char *name; @@ -84,6 +85,7 @@ struct voltagedomain { int (*scale) (struct voltagedomain *voltdm, unsigned long target_volt); + u32 nominal_volt; struct omap_vdd_info *vdd; }; @@ -144,11 +146,9 @@ struct omap_voltdm_pmic { * * @volt_data : voltage table having the distinct voltages supported * by the domain and other associated per voltage data. - * @curr_volt : current voltage for this vdd. */ struct omap_vdd_info { struct omap_volt_data *volt_data; - u32 curr_volt; }; void omap_voltage_get_volttable(struct voltagedomain *voltdm,