diff mbox

[03/10] OMAP4: Add the new voltage to vsel calculation formula

Message ID 1282130191-9062-4-git-send-email-thara@ti.com (mailing list archive)
State Changes Requested
Delegated to: Kevin Hilman
Headers show

Commit Message

Thara Gopinath Aug. 18, 2010, 11:16 a.m. UTC
None
diff mbox

Patch

diff --git a/arch/arm/plat-omap/opp_twl_tps.c b/arch/arm/plat-omap/opp_twl_tps.c
index 112f106..9445733 100644
--- a/arch/arm/plat-omap/opp_twl_tps.c
+++ b/arch/arm/plat-omap/opp_twl_tps.c
@@ -13,6 +13,8 @@ 
  * XXX This code should be part of some other TWL/TPS code.
  */
 
+#include <linux/i2c/twl.h>
+
 #include <plat/opp_twl_tps.h>
 
 /**
@@ -24,6 +26,9 @@ 
  */
 unsigned long omap_twl_vsel_to_uv(const u8 vsel)
 {
+	if (twl_class_is_6030())
+		return ((((vsel - 1) * 125) + 7000)) * 100;
+
 	return (((vsel * 125) + 6000)) * 100;
 }
 
@@ -37,5 +42,8 @@  unsigned long omap_twl_vsel_to_uv(const u8 vsel)
 u8 omap_twl_uv_to_vsel(unsigned long uv)
 {
 	/* Round up to higher voltage */
+	if (twl_class_is_6030())
+		return DIV_ROUND_UP(uv - 700000, 12500) + 1;
+
 	return DIV_ROUND_UP(uv - 600000, 12500);
 }