aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/vc.c
diff options
context:
space:
mode:
authorKevin Hilman <khilman@ti.com>2011-04-05 18:15:31 -0400
committerKevin Hilman <khilman@ti.com>2011-09-15 15:09:08 -0400
commit76ea7424f80350884b4d70ae54cfa51f7f9b2a48 (patch)
tree933d9d3590c21860fcf02fd594b0a5db46c60252 /arch/arm/mach-omap2/vc.c
parent6f56727383ca3233f40af5e792a08bf07b18f5fd (diff)
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/vc.c')
-rw-r--r--arch/arm/mach-omap2/vc.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c
index 7b87ea16ce43..f8bdd5183e2f 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,
105 u8 *target_vsel, u8 *current_vsel) 105 u8 *target_vsel, u8 *current_vsel)
106{ 106{
107 struct omap_vc_channel *vc = voltdm->vc; 107 struct omap_vc_channel *vc = voltdm->vc;
108 struct omap_vdd_info *vdd = voltdm->vdd; 108 u32 vc_cmdval;
109 struct omap_volt_data *volt_data;
110 u32 vc_cmdval, vp_errgain_val;
111 109
112 /* Check if sufficient pmic info is available for this vdd */ 110 /* Check if sufficient pmic info is available for this vdd */
113 if (!voltdm->pmic) { 111 if (!voltdm->pmic) {
@@ -129,11 +127,6 @@ int omap_vc_pre_scale(struct voltagedomain *voltdm,
129 return -EINVAL; 127 return -EINVAL;
130 } 128 }
131 129
132 /* Get volt_data corresponding to target_volt */
133 volt_data = omap_voltage_get_voltdata(voltdm, target_volt);
134 if (IS_ERR(volt_data))
135 volt_data = NULL;
136
137 *target_vsel = voltdm->pmic->uv_to_vsel(target_volt); 130 *target_vsel = voltdm->pmic->uv_to_vsel(target_volt);
138 *current_vsel = voltdm->pmic->uv_to_vsel(vdd->curr_volt); 131 *current_vsel = voltdm->pmic->uv_to_vsel(vdd->curr_volt);
139 132
@@ -143,15 +136,7 @@ int omap_vc_pre_scale(struct voltagedomain *voltdm,
143 vc_cmdval |= (*target_vsel << vc->common->cmd_on_shift); 136 vc_cmdval |= (*target_vsel << vc->common->cmd_on_shift);
144 voltdm->write(vc_cmdval, vc->cmdval_reg); 137 voltdm->write(vc_cmdval, vc->cmdval_reg);
145 138
146 /* Setting vp errorgain based on the voltage */ 139 omap_vp_update_errorgain(voltdm, target_volt);
147 if (volt_data) {
148 vp_errgain_val = voltdm->read(voltdm->vp->vpconfig);
149 vdd->vp_rt_data.vpconfig_errorgain = volt_data->vp_errgain;
150 vp_errgain_val &= voltdm->vp->common->vpconfig_errorgain_mask;
151 vp_errgain_val |= vdd->vp_rt_data.vpconfig_errorgain <<
152 __ffs(voltdm->vp->common->vpconfig_errorgain_mask);
153 voltdm->write(vp_errgain_val, voltdm->vp->vpconfig);
154 }
155 140
156 return 0; 141 return 0;
157} 142}