* [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
* Re: [PATCH] regulator: max8997: Fix setting inappropriate value for ramp_delay variable
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
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2011-07-07 15:26 UTC (permalink / raw)
To: Donggeun Kim; +Cc: linux-kernel, lrg, myungjoo.ham, kyungmin.park
On Thu, Jul 07, 2011 at 04:51:56PM +0900, Donggeun Kim wrote:
> The ramp_delay variable can be set lower than the desired value.
> This patch fixes it.
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] regulator: max8997: Fix setting inappropriate value for ramp_delay variable
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
1 sibling, 0 replies; 3+ messages in thread
From: Liam Girdwood @ 2011-07-08 18:28 UTC (permalink / raw)
To: Donggeun Kim; +Cc: linux-kernel, lrg, broonie, myungjoo.ham, kyungmin.park
On Thu, 2011-07-07 at 16:51 +0900, Donggeun Kim wrote:
> 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;
Applied.
^ permalink raw reply [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;
as well as URLs for NNTP newsgroup(s).