From mboxrd@z Thu Jan 1 00:00:00 1970 From: mturquette@ti.com (Mike Turquette) Date: Wed, 3 Oct 2012 18:26:14 -0700 Subject: [PATCH 7/7] ARM: omap: voltage: add ABB to voltage scaling In-Reply-To: <1349313974-5473-1-git-send-email-mturquette@ti.com> References: <1349313974-5473-1-git-send-email-mturquette@ti.com> Message-ID: <1349313974-5473-8-git-send-email-mturquette@ti.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.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 -- 1.7.9.5