public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regulator: max8997: Fix setting inappropriate value for ramp_delay variable
@ 2011-07-07  7:51 Donggeun Kim
  2011-07-07 15:26 ` Mark Brown
  2011-07-08 18:28 ` Liam Girdwood
  0 siblings, 2 replies; 3+ messages in thread
From: Donggeun Kim @ 2011-07-07  7:51 UTC (permalink / raw)
  To: linux-kernel; +Cc: lrg, broonie, myungjoo.ham, kyungmin.park, dg77.kim

The ramp_delay variable can be set lower than the desired value.
This patch fixes it.

Signed-off-by: Donggeun Kim <dg77.kim@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: KyungMin Park <kyungmin.park@samsung.com>
---
 drivers/regulator/max8997.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c
index 10d5a1d..682bc79 100644
--- a/drivers/regulator/max8997.c
+++ b/drivers/regulator/max8997.c
@@ -543,7 +543,8 @@ static int max8997_set_voltage_ldobuck(struct regulator_dev *rdev,
 			rid == MAX8997_BUCK4 || rid == MAX8997_BUCK5) {
 		/* If the voltage is increasing */
 		if (org < i)
-			udelay(desc->step * (i - org) / max8997->ramp_delay);
+			udelay(DIV_ROUND_UP(desc->step * (i - org),
+						max8997->ramp_delay));
 	}
 
 	return ret;
-- 
1.7.4.1


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

end of thread, other threads:[~2011-07-08 18:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-07  7:51 [PATCH] regulator: max8997: Fix setting inappropriate value for ramp_delay variable Donggeun Kim
2011-07-07 15:26 ` Mark Brown
2011-07-08 18:28 ` Liam Girdwood

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