aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorNishanth Menon <nm@ti.com>2011-05-18 01:17:31 -0400
committerKevin Hilman <khilman@ti.com>2011-09-15 15:09:36 -0400
commit366494250b60af14fbab4d94d6bb1d1b6d17f10b (patch)
tree47557a9d03cb7249dea97b430d86138bfecc2c6a /arch/arm/mach-omap2
parent58e241f7be8dfbb19fa8f5bf8b2e56bb6d655752 (diff)
OMAP4: PM: TWL6030: fix uv to voltage for >0x39
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>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/omap_twl.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/omap_twl.c b/arch/arm/mach-omap2/omap_twl.c
index a66bf6b9fb05..5def7c274f75 100644
--- a/arch/arm/mach-omap2/omap_twl.c
+++ b/arch/arm/mach-omap2/omap_twl.c
@@ -134,8 +134,13 @@ static u8 twl6030_uv_to_vsel(unsigned long uv)
134 * hardcoding only for 1.35 V which is used for 1GH OPP for 134 * hardcoding only for 1.35 V which is used for 1GH OPP for
135 * OMAP4430. 135 * OMAP4430.
136 */ 136 */
137 if (uv == 1350000) 137 if (uv > twl6030_vsel_to_uv(0x39)) {
138 if (uv == 1350000)
139 return 0x3A;
140 pr_err("%s:OUT OF RANGE! non mapped vsel for %ld Vs max %ld\n",
141 __func__, uv, twl6030_vsel_to_uv(0x39));
138 return 0x3A; 142 return 0x3A;
143 }
139 144
140 if (smps_offset & 0x8) 145 if (smps_offset & 0x8)
141 return DIV_ROUND_UP(uv - 709000, 12660) + 1; 146 return DIV_ROUND_UP(uv - 709000, 12660) + 1;