public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PM-WIP-OPP] [PATCH] cleaner ceil function for uv to vsel conversion
@ 2010-01-11  5:53 Romit Dasgupta
  2010-01-11 22:29 ` Kevin Hilman
  0 siblings, 1 reply; 5+ messages in thread
From: Romit Dasgupta @ 2010-01-11  5:53 UTC (permalink / raw)
  To: khilman; +Cc: nm, linux-omap

Cleaner ceil function.
Signed-off-by: Romit Dasgupta <romit@ti.com>
---
diff --git a/arch/arm/plat-omap/opp_twl_tps.c b/arch/arm/plat-omap/opp_twl_tps.c
index e0db39b..1caa414 100644
--- a/arch/arm/plat-omap/opp_twl_tps.c
+++ b/arch/arm/plat-omap/opp_twl_tps.c
@@ -36,14 +36,7 @@ unsigned long omap_twl_vsel_to_uv(const u8 vsel)
  */
 u8 omap_twl_uv_to_vsel(unsigned long uv)
 {
-	u8 vsel;
 
-	vsel = ((uv / 100) - 6000) / 125;
+	return (((uv + 99) / 100 - 6000) + 124) / 125;
 
-	/* round off to higher voltage */
-	/* XXX Surely not the best way to handle this. */
-	if (uv > omap_twl_vsel_to_uv(vsel))
-		vsel++;
-
-	return vsel;
 }



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-01-12 12:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-11  5:53 [PM-WIP-OPP] [PATCH] cleaner ceil function for uv to vsel conversion Romit Dasgupta
2010-01-11 22:29 ` Kevin Hilman
2010-01-12  8:58   ` Romit Dasgupta
2010-01-12 12:08     ` Nishanth Menon
2010-01-12 12:13       ` Romit Dasgupta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox