summaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap2/vp.c
diff options
context:
space:
mode:
authorKevin Hilman <khilman@ti.com>2011-04-06 02:15:31 +0400
committerKevin Hilman <khilman@ti.com>2011-09-15 23:09:08 +0400
commit76ea7424f80350884b4d70ae54cfa51f7f9b2a48 (patch)
tree933d9d3590c21860fcf02fd594b0a5db46c60252 /arch/arm/mach-omap2/vp.c
parent6f56727383ca3233f40af5e792a08bf07b18f5fd (diff)
downloadlinux-76ea7424f80350884b4d70ae54cfa51f7f9b2a48.tar.xz
OMAP3+: VP: create VP helper function for updating error gain
Create new helper function in VP layer for updating VP error gain. Currently used during pre-scale for VP force update and VC bypass. TODO: determine if this can be removed from the pre-scale path and moved to VP enable path. Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/vp.c')
-rw-r--r--arch/arm/mach-omap2/vp.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/vp.c b/arch/arm/mach-omap2/vp.c
index ea61a47bd199..f68a6db27111 100644
--- a/arch/arm/mach-omap2/vp.c
+++ b/arch/arm/mach-omap2/vp.c
@@ -106,6 +106,25 @@ void __init omap_vp_init(struct voltagedomain *voltdm)
voltdm->write(vp_val, vp->vlimitto);
}
+int omap_vp_update_errorgain(struct voltagedomain *voltdm,
+ unsigned long target_volt)
+{
+ struct omap_volt_data *volt_data;
+
+ /* Get volt_data corresponding to target_volt */
+ volt_data = omap_voltage_get_voltdata(voltdm, target_volt);
+ if (IS_ERR(volt_data))
+ return -EINVAL;
+
+ /* Setting vp errorgain based on the voltage */
+ voltdm->rmw(voltdm->vp->common->vpconfig_errorgain_mask,
+ volt_data->vp_errgain <<
+ __ffs(voltdm->vp->common->vpconfig_errorgain_mask),
+ voltdm->vp->vpconfig);
+
+ return 0;
+}
+
/* VP force update method of voltage scaling */
int omap_vp_forceupdate_scale(struct voltagedomain *voltdm,
unsigned long target_volt)