2012-06-11 05:15:39

by Axel Lin

[permalink] [raw]
Subject: [PATCH] regulator: core: Return correct delay time in regulator_set_voltage_time_sel

rdev->desc->uV_step * abs(new_selector - old_selector) returns uV.
The unit of ramp_delay is mV/us.

Current code multiples 1000 at wrong place.

Signed-off-by: Axel Lin <[email protected]>
---
drivers/regulator/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index f4c056a..63507a5 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2308,7 +2308,7 @@ int regulator_set_voltage_time_sel(struct regulator_dev *rdev,
if (rdev->desc->ramp_delay && rdev->desc->uV_step)
return DIV_ROUND_UP(rdev->desc->uV_step *
abs(new_selector - old_selector),
- rdev->desc->ramp_delay) * 1000;
+ rdev->desc->ramp_delay * 1000);
return 0;
}

--
1.7.9.5



2012-06-11 05:38:09

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH] regulator: core: Return correct delay time in regulator_set_voltage_time_sel

On Mon, Jun 11, 2012 at 01:14:50PM +0800, Axel Lin wrote:
> rdev->desc->uV_step * abs(new_selector - old_selector) returns uV.
> The unit of ramp_delay is mV/us.

Applied, thanks.


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

2012-06-11 06:59:40

by Yadwinder Singh Brar

[permalink] [raw]
Subject: Re: [PATCH] regulator: core: Return correct delay time in regulator_set_voltage_time_sel

On Mon, Jun 11, 2012 at 10:44 AM, Axel Lin <[email protected]> wrote:
> rdev->desc->uV_step * abs(new_selector - old_selector) returns uV.
> The unit of ramp_delay is mV/us.
>
> Current code multiples 1000 at wrong place.
>

I am moving ramp_delay to constraints, so i have to modify this line again.
It will be corrected their.

Thanks,
Yadwinder.

> Signed-off-by: Axel Lin <[email protected]>
> ---
> ?drivers/regulator/core.c | ? ?2 +-
> ?1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
> index f4c056a..63507a5 100644
> --- a/drivers/regulator/core.c
> +++ b/drivers/regulator/core.c
> @@ -2308,7 +2308,7 @@ int regulator_set_voltage_time_sel(struct regulator_dev *rdev,
> ? ? ? ?if (rdev->desc->ramp_delay && rdev->desc->uV_step)
> ? ? ? ? ? ? ? ?return DIV_ROUND_UP(rdev->desc->uV_step *
> ? ? ? ? ? ? ? ? ? ? ? ?abs(new_selector - old_selector),
> - ? ? ? ? ? ? ? ? ? ? ? rdev->desc->ramp_delay) * 1000;
> + ? ? ? ? ? ? ? ? ? ? ? rdev->desc->ramp_delay * 1000);
> ? ? ? ?return 0;
> ?}
>
> --
> 1.7.9.5
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at ?http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at ?http://www.tux.org/lkml/
>
>