Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 303359
b: refs/heads/master
c: c15f1d8
h: refs/heads/master
i:
  303357: 3d870a7
  303355: be785ec
  303351: 98a0d0f
  303343: f8a10ff
  303327: 791f2c9
  303295: 1e7b2cf
  303231: 3f8fc7f
  303103: 9f474f7
v: v3
  • Loading branch information
Kevin Hilman committed Mar 7, 2012
1 parent a3832f0 commit 6b43915
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 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: e160dda0f49f54deddd62e943e449a13430c2e8b
refs/heads/master: c15f1d84bb3ddd668593e9bca53221a2f82e9e99
21 changes: 18 additions & 3 deletions trunk/arch/arm/mach-omap2/voltage.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ unsigned long voltdm_get_voltage(struct voltagedomain *voltdm)
int voltdm_scale(struct voltagedomain *voltdm,
unsigned long target_volt)
{
int ret;
int ret, i;
unsigned long volt = 0;

if (!voltdm || IS_ERR(voltdm)) {
pr_warning("%s: VDD specified does not exist!\n", __func__);
Expand All @@ -86,9 +87,23 @@ int voltdm_scale(struct voltagedomain *voltdm,
return -ENODATA;
}

ret = voltdm->scale(voltdm, target_volt);
/* Adjust voltage to the exact voltage from the OPP table */
for (i = 0; voltdm->volt_data[i].volt_nominal != 0; i++) {
if (voltdm->volt_data[i].volt_nominal >= target_volt) {
volt = voltdm->volt_data[i].volt_nominal;
break;
}
}

if (!volt) {
pr_warning("%s: not scaling. OPP voltage for %lu, not found.\n",
__func__, target_volt);
return -EINVAL;
}

ret = voltdm->scale(voltdm, volt);
if (!ret)
voltdm->nominal_volt = target_volt;
voltdm->nominal_volt = volt;

return ret;
}
Expand Down

0 comments on commit 6b43915

Please sign in to comment.