aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/vp.c
diff options
context:
space:
mode:
authorNishanth Menon <nm@ti.com>2012-03-23 18:18:14 +0200
committerTodd Poynor <toddpoynor@google.com>2012-05-10 14:25:02 -0700
commitb5684a2fb068a51badd92db4b5f2f2812a50bc09 (patch)
tree20bbd29b254e7dadbd3d34fd7c90e234b5bcf50a /arch/arm/mach-omap2/vp.c
parentfa09b1c1912ca021e48929038bb8c55885b4d03b (diff)
downloadkernel_samsung_tuna-b5684a2fb068a51badd92db4b5f2f2812a50bc09.zip
kernel_samsung_tuna-b5684a2fb068a51badd92db4b5f2f2812a50bc09.tar.gz
kernel_samsung_tuna-b5684a2fb068a51badd92db4b5f2f2812a50bc09.tar.bz2
OMAP3+: VP/VC: ensure vp errgen is configured for the right OPP
Since target_volt converted by omap_voltage_get_voltdata to get to vp_errgain for the OPP voltage level, we can have a scenario as follows: OPP100 Vnom=1.2V, Vcalib = 0V(not calibrated) vp_errgain=0x16 OPPNitro Vnom=1.375, Vcalib = 1.2V vp_errgain=0x27 When a request to vc_bypass or vp_forceupdate is provided to OPPNitro volt_data pointer, it in turn calls vc_prescale with 1.2V, this gets passed down to vp_errgen_configure, who converts it back into vdata using omap_voltage_get_voltdata However, omap_voltage_get_voltdata walks through the volt_data array and finds the first match of OPP100 where Vnom = 1.2V and returns the volt_data pointer for OPP100, this causes 0x16 to be selected for VP errgain instead of 0x27, causing instability for voltage scale operation. Instead, pass the volt_data pointer straight to vc_prescale and down to vp_errgen_configure to ensure that the right configuration parameters are used. Change-Id: I96c697175fb5d16c53de9891ec5c008101c0550b Signed-off-by: Nishanth Menon <nm@ti.com> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/vp.c')
-rw-r--r--arch/arm/mach-omap2/vp.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/arch/arm/mach-omap2/vp.c b/arch/arm/mach-omap2/vp.c
index b5c3524..3f16be5 100644
--- a/arch/arm/mach-omap2/vp.c
+++ b/arch/arm/mach-omap2/vp.c
@@ -136,15 +136,11 @@ void omap_vp_clear_transdone(struct voltagedomain *voltdm)
}
int omap_vp_update_errorgain(struct voltagedomain *voltdm,
- unsigned long target_volt)
+ struct omap_volt_data *volt_data)
{
- 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)) {
- pr_err("%s: vdm %s no voltage data for %ld\n", __func__,
- voltdm->name, target_volt);
+ if (IS_ERR_OR_NULL(volt_data)) {
+ pr_err("%s: vdm %s bad voltage data %p\n", __func__,
+ voltdm->name, volt_data);
return -EINVAL;
}
@@ -203,7 +199,8 @@ int omap_vp_forceupdate_scale(struct voltagedomain *voltdm,
"%s:vdd_%s idletimdout forceupdate(v=%ld)\n",
__func__, voltdm->name, target_volt);
- ret = omap_vc_pre_scale(voltdm, target_volt, &target_vsel, &current_vsel);
+ ret = omap_vc_pre_scale(voltdm, target_volt, target_v,
+ &target_vsel, &current_vsel);
if (ret)
return ret;