From patchwork Thu Oct 4 01:16:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Turquette X-Patchwork-Id: 1544181 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 6BBDBDFF71 for ; Thu, 4 Oct 2012 01:16:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933227Ab2JDBQz (ORCPT ); Wed, 3 Oct 2012 21:16:55 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:52089 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933269Ab2JDBQy (ORCPT ); Wed, 3 Oct 2012 21:16:54 -0400 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id q941Gmig028092; Wed, 3 Oct 2012 20:16:48 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q941Gm0B015828; Wed, 3 Oct 2012 20:16:48 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by dfle73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.1.323.3; Wed, 3 Oct 2012 20:16:48 -0500 Received: from nucleus.nsc.com (nucleus.nsc.com [10.188.36.112]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id q941Gir6013802; Wed, 3 Oct 2012 20:16:47 -0500 From: Mike Turquette To: , CC: , , Mike Turquette , Mike Turquette Subject: [PATCH 5/5] ARM: omap: initialize voltdm->nominal_volt Date: Wed, 3 Oct 2012 18:16:05 -0700 Message-ID: <1349313365-5262-6-git-send-email-mturquette@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1349313365-5262-1-git-send-email-mturquette@ti.com> References: <1349313365-5262-1-git-send-email-mturquette@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org From: Mike Turquette Populate the .get_voltage callbacks for VC & VP. Use these callbacks to populate voltdm->nominal_volt during boot sequence. This is useful for the Adaptive Body-Bias sequence coming in a subsequent series. Without this patch voltdm->nominal will not be populated until after the first call to voltdm_scale. This is too late to be useful to the pre-scale sequence in the ABB series since that sequence needs to know the voltage prior to the first transition. Note that the .get_voltage callback will return zero for the corner case wherein the bootloader has not scaling the voltage. In this case it is safe to assume that we are running at the PMIC's default power-on voltage. DT data providing the default voltage for each PMIC is needed in this case. Signed-off-by: Mike Turquette Signed-off-by: Mike Turquette --- arch/arm/mach-omap2/voltage.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-omap2/voltage.c index 4dc60e8..f45716c 100644 --- a/arch/arm/mach-omap2/voltage.c +++ b/arch/arm/mach-omap2/voltage.c @@ -244,9 +244,11 @@ void omap_change_voltscale_method(struct voltagedomain *voltdm, switch (voltscale_method) { case VOLTSCALE_VPFORCEUPDATE: voltdm->scale = omap_vp_forceupdate_scale; + voltdm->get_voltage = omap_vp_get_init_voltage; return; case VOLTSCALE_VCBYPASS: voltdm->scale = omap_vc_bypass_scale; + voltdm->get_voltage = omap_vc_get_bypass_data; return; default: pr_warning("%s: Trying to change the method of voltage scaling" @@ -288,13 +290,24 @@ int __init omap_voltage_late_init(void) if (voltdm->vc) { voltdm->scale = omap_vc_bypass_scale; + voltdm->get_voltage = omap_vc_get_bypass_data; omap_vc_init_channel(voltdm); } if (voltdm->vp) { voltdm->scale = omap_vp_forceupdate_scale; + voltdm->get_voltage = omap_vp_get_init_voltage; omap_vp_init(voltdm); } + + /* + * XXX If voltdm->nominal_volt is zero after calling + * voltdm->get_voltage then we are likely running this + * voltage domain at the default boot voltage of the + * PMIC. In such a case it would be best to load this + * value from DT. + */ + voltdm->nominal_volt = voltdm->get_voltage(voltdm); } return 0;