2012-06-08 09:22:18

by Axel Lin

[permalink] [raw]
Subject: [PATCH RFT] regulator: max77686: Fix the delay time for set_voltage_time_sel

rdev->desc->uV_step * abs(new_selector - old_selector) returns uV.
The unit of ramp_rate is mV/us.
Thus 1000 should be multiplied.

Signed-off-by: Axel Lin <[email protected]>
---
drivers/regulator/max77686.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/max77686.c b/drivers/regulator/max77686.c
index b76a038..10bf65a 100644
--- a/drivers/regulator/max77686.c
+++ b/drivers/regulator/max77686.c
@@ -78,7 +78,7 @@ static int max77686_set_dvs_voltage_time_sel(struct regulator_dev *rdev,

return DIV_ROUND_UP(rdev->desc->uV_step *
abs(new_selector - old_selector),
- ramp_rate[max77686->ramp_delay]);
+ ramp_rate[max77686->ramp_delay] * 1000);
}

static int max77686_set_voltage_time_sel(struct regulator_dev *rdev,
@@ -86,7 +86,7 @@ static int max77686_set_voltage_time_sel(struct regulator_dev *rdev,
{
/* Unconditionally 100 mV/us */
return DIV_ROUND_UP(rdev->desc->uV_step *
- abs(new_selector - old_selector), 100);
+ abs(new_selector - old_selector), 100 * 1000);
}

static struct regulator_ops max77686_ops = {
--
1.7.9.5



2012-06-09 04:20:20

by Yadwinder Singh Brar

[permalink] [raw]
Subject: Re: [PATCH RFT] regulator: max77686: Fix the delay time for set_voltage_time_sel

On Fri, Jun 8, 2012 at 2:51 PM, Axel Lin <[email protected]> wrote:
> rdev->desc->uV_step * abs(new_selector - old_selector) returns uV.
> The unit of ramp_rate is mV/us.
> Thus 1000 should be multiplied.
>
> Signed-off-by: Axel Lin <[email protected]>
> ---
> ?drivers/regulator/max77686.c | ? ?4 ++--
> ?1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/regulator/max77686.c b/drivers/regulator/max77686.c
> index b76a038..10bf65a 100644
> --- a/drivers/regulator/max77686.c
> +++ b/drivers/regulator/max77686.c
> @@ -78,7 +78,7 @@ static int max77686_set_dvs_voltage_time_sel(struct regulator_dev *rdev,
>
> ? ? ? ?return DIV_ROUND_UP(rdev->desc->uV_step *
> ? ? ? ? ? ? ? ? ? ? ? ? ? ?abs(new_selector - old_selector),
> - ? ? ? ? ? ? ? ? ? ? ? ? ? ramp_rate[max77686->ramp_delay]);
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ramp_rate[max77686->ramp_delay] * 1000);
> ?}
>
> ?static int max77686_set_voltage_time_sel(struct regulator_dev *rdev,
> @@ -86,7 +86,7 @@ static int max77686_set_voltage_time_sel(struct regulator_dev *rdev,
> ?{
> ? ? ? ?/* Unconditionally 100 mV/us */
> ? ? ? ?return DIV_ROUND_UP(rdev->desc->uV_step *
> - ? ? ? ? ? ? ? ? ? ? ? ? ? abs(new_selector - old_selector), 100);
> + ? ? ? ? ? ? ? ? ? ? ? ? ? abs(new_selector - old_selector), 100 * 1000);
> ?}
>
> ?static struct regulator_ops max77686_ops = {
> --

Reviewed-by: Yadwinder Singh Brar <[email protected]>

Thanks,
Yadwinder.

2012-06-11 04:09:41

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH RFT] regulator: max77686: Fix the delay time for set_voltage_time_sel

On Fri, Jun 08, 2012 at 05:21:44PM +0800, Axel Lin wrote:
> rdev->desc->uV_step * abs(new_selector - old_selector) returns uV.
> The unit of ramp_rate is mV/us.
> Thus 1000 should be multiplied.

Applied, thanks.


Attachments:
(No filename) (213.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments