diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2014-04-08 18:23:53 +0530 |
---|---|---|
committer | Laxman Dewangan <ldewangan@nvidia.com> | 2014-04-08 23:32:50 -0700 |
commit | 4c0eeeb97364a934994b492e65639ddde5aa8882 (patch) | |
tree | d1440623653b17d9175440ea01bfb517cd80b7b2 /drivers/regulator | |
parent | dcaffe4540980ccd9da9388df222c21c959ba14d (diff) |
regulator: add support to scale ramp delay
There is possibilty on a given platform where the ramp delay
for rail can difer from datsheet due to baord design and it need
to scale for more delay like 2x or 1.5x or 1.25x etc.
Add support for scaling the ramp delay in core.
Change-Id: I3e0d6f89225f5bb4ffc387f87087688d15f29907
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/393504
GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/core.c | 3 | ||||
-rw-r--r-- | drivers/regulator/of_regulator.c | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index f4fd7eced264..ed5d1bec3436 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -2824,6 +2824,9 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev, delay); delay = 0; } + if (rdev->constraints && rdev->constraints->ramp_delay_scale) + delay = DIV_ROUND_UP(delay * + rdev->constraints->ramp_delay_scale, 100); /* Insert any necessary delays */ if (delay >= 1000) { diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c index c01480c89aaa..880879e71967 100644 --- a/drivers/regulator/of_regulator.c +++ b/drivers/regulator/of_regulator.c @@ -128,6 +128,10 @@ static void of_get_regulation_constraints(struct device_node *np, if (ramp_delay) constraints->ramp_delay = be32_to_cpu(*ramp_delay); + ret = of_property_read_u32(np, "regulator-ramp-delay-scale", &pval); + if (!ret) + constraints->ramp_delay_scale = pval; + ret = of_property_read_u32(np, "regulator-enable-ramp-delay", &pval); if (!ret) constraints->enable_time = pval; |