Skip to content

Commit

Permalink
OMAP4: PM: TWL6030: fix uv to voltage for >0x39
Browse files Browse the repository at this point in the history
using 1.35V as a check is not correct, we know that beyond 0x39,
voltages are non linear - hence use the conversion iff uV greater
than that for 0x39. For example, with  709mV as the smps offset,
the max linear is actually 1.41V(0x39vsel)!

Signed-off-by: Nishanth Menon <nm@ti.com>
  • Loading branch information
Nishanth Menon authored and Kevin Hilman committed Sep 15, 2011
1 parent 58e241f commit 3664942
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion arch/arm/mach-omap2/omap_twl.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,13 @@ static u8 twl6030_uv_to_vsel(unsigned long uv)
* hardcoding only for 1.35 V which is used for 1GH OPP for
* OMAP4430.
*/
if (uv == 1350000)
if (uv > twl6030_vsel_to_uv(0x39)) {
if (uv == 1350000)
return 0x3A;
pr_err("%s:OUT OF RANGE! non mapped vsel for %ld Vs max %ld\n",
__func__, uv, twl6030_vsel_to_uv(0x39));
return 0x3A;
}

if (smps_offset & 0x8)
return DIV_ROUND_UP(uv - 709000, 12660) + 1;
Expand Down

0 comments on commit 3664942

Please sign in to comment.