Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 272746
b: refs/heads/master
c: 76ea742
h: refs/heads/master
v: v3
  • Loading branch information
Kevin Hilman committed Sep 15, 2011
1 parent 2f0cf80 commit 2506fd4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6f56727383ca3233f40af5e792a08bf07b18f5fd
refs/heads/master: 76ea7424f80350884b4d70ae54cfa51f7f9b2a48
19 changes: 2 additions & 17 deletions trunk/arch/arm/mach-omap2/vc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);

Expand All @@ -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;
}
Expand Down
19 changes: 19 additions & 0 deletions trunk/arch/arm/mach-omap2/vp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/arm/mach-omap2/vp.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,5 +149,7 @@ void omap_vp_disable(struct voltagedomain *voltdm);
unsigned long omap_vp_get_curr_volt(struct voltagedomain *voltdm);
int omap_vp_forceupdate_scale(struct voltagedomain *voltdm,
unsigned long target_volt);
int omap_vp_update_errorgain(struct voltagedomain *voltdm,
unsigned long target_volt);

#endif

0 comments on commit 2506fd4

Please sign in to comment.