From patchwork Mon Aug 29 18:10:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 1109982 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7TI9kJi010254 for ; Mon, 29 Aug 2011 18:19:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754324Ab1H2SKc (ORCPT ); Mon, 29 Aug 2011 14:10:32 -0400 Received: from na3sys009aog126.obsmtp.com ([74.125.149.155]:43738 "EHLO na3sys009aog126.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754680Ab1H2SKa (ORCPT ); Mon, 29 Aug 2011 14:10:30 -0400 Received: from mail-pz0-f46.google.com ([209.85.210.46]) (using TLSv1) by na3sys009aob126.postini.com ([74.125.148.12]) with SMTP ID DSNKTlvWFRDA8XRD5HA9UixqyX6k2fC5m5Yo@postini.com; Mon, 29 Aug 2011 11:10:29 PDT Received: by mail-pz0-f46.google.com with SMTP id 32so10284581pzk.33 for ; Mon, 29 Aug 2011 11:10:29 -0700 (PDT) Received: by 10.142.156.9 with SMTP id d9mr2786423wfe.156.1314641429292; Mon, 29 Aug 2011 11:10:29 -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.27 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 29 Aug 2011 11:10:28 -0700 (PDT) From: Kevin Hilman To: linux-omap@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Subject: [PATCH 5/7] OMAP3+: voltage: update nominal voltage in voltdm_scale() not VC post-scale Date: Mon, 29 Aug 2011 11:10:47 -0700 Message-Id: <1314641449-5089-6-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> 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 (demeter1.kernel.org [140.211.167.41]); Mon, 29 Aug 2011 18:20:03 +0000 (UTC) Currently, the nominal voltage is updated in the VC post-scale function which is common to both scaling methods. However, this has readabiliy problems as this update is not where it might be expected. Instead, move the updated into voltdm_scale() upon a successful return of voltdm->scale() Signed-off-by: Kevin Hilman --- arch/arm/mach-omap2/vc.c | 2 -- arch/arm/mach-omap2/voltage.c | 6 +++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c index 130df29..1c2bb9c 100644 --- a/arch/arm/mach-omap2/vc.c +++ b/arch/arm/mach-omap2/vc.c @@ -143,8 +143,6 @@ void omap_vc_post_scale(struct voltagedomain *voltdm, smps_delay = ((smps_steps * voltdm->pmic->step_size) / voltdm->pmic->slew_rate) + 2; udelay(smps_delay); - - 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 441c2d9..64070ac 100644 --- a/arch/arm/mach-omap2/voltage.c +++ b/arch/arm/mach-omap2/voltage.c @@ -85,7 +85,11 @@ int voltdm_scale(struct voltagedomain *voltdm, return -ENODATA; } - return voltdm->scale(voltdm, target_volt); + ret = voltdm->scale(voltdm, target_volt); + if (!ret) + voltdm->nominal_volt = target_volt; + + return ret; } /**