From 76ea7424f80350884b4d70ae54cfa51f7f9b2a48 Mon Sep 17 00:00:00 2001 From: Kevin Hilman Date: Tue, 5 Apr 2011 15:15:31 -0700 Subject: 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 --- arch/arm/mach-omap2/vc.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'arch/arm/mach-omap2/vc.c') diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c index 7b87ea16ce4..f8bdd5183e2 100644 --- a/arch/arm/mach-omap2/vc.c +++ b/arch/arm/mach-omap2/vc.c @@ -105,9 +105,7 @@ int omap_vc_pre_scale(struct voltagedomain *voltdm, u8 *target_vsel, u8 *current_vsel) { struct omap_vc_channel *vc = voltdm->vc; - struct omap_vdd_info *vdd = voltdm->vdd; - struct omap_volt_data *volt_data; - u32 vc_cmdval, vp_errgain_val; + u32 vc_cmdval; /* Check if sufficient pmic info is available for this vdd */ if (!voltdm->pmic) { @@ -129,11 +127,6 @@ int omap_vc_pre_scale(struct voltagedomain *voltdm, return -EINVAL; } - /* Get volt_data corresponding to target_volt */ - volt_data = omap_voltage_get_voltdata(voltdm, target_volt); - if (IS_ERR(volt_data)) - volt_data = NULL; - *target_vsel = voltdm->pmic->uv_to_vsel(target_volt); *current_vsel = voltdm->pmic->uv_to_vsel(vdd->curr_volt); @@ -143,15 +136,7 @@ int omap_vc_pre_scale(struct voltagedomain *voltdm, vc_cmdval |= (*target_vsel << vc->common->cmd_on_shift); voltdm->write(vc_cmdval, vc->cmdval_reg); - /* Setting vp errorgain based on the voltage */ - if (volt_data) { - vp_errgain_val = voltdm->read(voltdm->vp->vpconfig); - vdd->vp_rt_data.vpconfig_errorgain = volt_data->vp_errgain; - vp_errgain_val &= voltdm->vp->common->vpconfig_errorgain_mask; - vp_errgain_val |= vdd->vp_rt_data.vpconfig_errorgain << - __ffs(voltdm->vp->common->vpconfig_errorgain_mask); - voltdm->write(vp_errgain_val, voltdm->vp->vpconfig); - } + omap_vp_update_errorgain(voltdm, target_volt); return 0; } -- cgit v1.2.3