From patchwork Thu Oct 4 01:26:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Turquette X-Patchwork-Id: 1544301 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id D4CBC3FD9C for ; Thu, 4 Oct 2012 01:26:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754830Ab2JDB0q (ORCPT ); Wed, 3 Oct 2012 21:26:46 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:36984 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754796Ab2JDB0p (ORCPT ); Wed, 3 Oct 2012 21:26:45 -0400 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id q941QaJn002278; Wed, 3 Oct 2012 20:26:36 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q941Qaqi024951; Wed, 3 Oct 2012 20:26:36 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by dfle72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.1.323.3; Wed, 3 Oct 2012 20:26:36 -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 q941QWfa015948; Wed, 3 Oct 2012 20:26:36 -0500 From: Mike Turquette To: , CC: , , Mike Turquette , Mike Turquette Subject: [PATCH 7/7] ARM: omap: voltage: add ABB to voltage scaling Date: Wed, 3 Oct 2012 18:26:14 -0700 Message-ID: <1349313974-5473-8-git-send-email-mturquette@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1349313974-5473-1-git-send-email-mturquette@ti.com> References: <1349313974-5473-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 Adaptive Body-Bias ldo state should be transitioned (if necessary) during any voltage scaling operation. This patch initializes ABB LDO's as a part of the greater voltage domain initialization sequence and adds the ABB transition callbacks to the primary voltage domain scaling function, voltdm_scale(). Signed-off-by: Mike Turquette Signed-off-by: Mike Turquette --- arch/arm/mach-omap2/voltage.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-omap2/voltage.c index f45716c..9cac9fe 100644 --- a/arch/arm/mach-omap2/voltage.c +++ b/arch/arm/mach-omap2/voltage.c @@ -41,6 +41,7 @@ #include "vc.h" #include "vp.h" +#include "abb.h" static LIST_HEAD(voltdm_list); @@ -101,10 +102,30 @@ int voltdm_scale(struct voltagedomain *voltdm, return -EINVAL; } + ret = omap_abb_pre_scale(voltdm, volt); + if (ret) { + pr_err("%s: abb prescale failed for vdd%s: %d\n", + __func__, voltdm->name, ret); + goto out; + } + ret = voltdm->scale(voltdm, volt); - if (!ret) - voltdm->nominal_volt = volt; + if (ret) { + pr_err("%s: vdd_%s failed to scale: %d\n", + __func__, voltdm->name, ret); + goto out; + } + + voltdm->nominal_volt = volt; + ret = omap_abb_post_scale(voltdm, volt); + if (ret) { + pr_err("%s: abb postscale failed for vdd%s: %d\n", + __func__, voltdm->name, ret); + goto out; + } + +out: return ret; } @@ -300,6 +321,9 @@ int __init omap_voltage_late_init(void) omap_vp_init(voltdm); } + if (voltdm->abb) + omap_abb_init(voltdm); + /* * XXX If voltdm->nominal_volt is zero after calling * voltdm->get_voltage then we are likely running this