diff options
| author | Anirudh Ghayal <aghayal@codeaurora.org> | 2016-07-12 08:31:57 +0530 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-03-17 03:52:09 -0700 |
| commit | 61997e84cd87fa9cc24bb9d33c8f3b6960f661b2 (patch) | |
| tree | 9e7e31da4293318e22bd6a224069f719d6edb3c6 | |
| parent | 8bb7c391c765886b2b73e58838533cf3cde975a5 (diff) | |
regulator: spm-regulator: Fix the usage of the 'uV' variable
The commit 639277b6c73c ("regulator: spm-regulator: Add additional
settling delay for FTS2.5 SMPS") incorrectly changed the usage
of 'uV' variable. The local 'uV' variable holds the correct voltage
level to be scaled up/down. Use it instead of vreg->uV.
CRs-Fixed: 1036738
Change-Id: I52540237a4db79c149409c6017ffc750b5abddd2
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
| -rw-r--r-- | drivers/regulator/spm-regulator.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/regulator/spm-regulator.c b/drivers/regulator/spm-regulator.c index aed6ac160ddb..484f0412addf 100644 --- a/drivers/regulator/spm-regulator.c +++ b/drivers/regulator/spm-regulator.c @@ -302,14 +302,14 @@ static int spm_regulator_write_voltage(struct spm_vreg *vreg, int uV) if (uV > vreg->last_set_uV) { /* Wait for voltage stepping to complete. */ - slew_delay = DIV_ROUND_UP(vreg->uV - vreg->last_set_uV, + slew_delay = DIV_ROUND_UP(uV - vreg->last_set_uV, vreg->step_rate); if (vreg->regulator_type == QPNP_TYPE_FTS2p5) slew_delay += FTS2P5_SETTLING_DELAY_US; udelay(slew_delay); } else if (vreg->regulator_type == QPNP_TYPE_FTS2p5) { /* add the ramp-down delay */ - slew_delay = DIV_ROUND_UP(vreg->last_set_uV - vreg->uV, + slew_delay = DIV_ROUND_UP(vreg->last_set_uV - uV, vreg->step_rate) + FTS2P5_SETTLING_DELAY_US; udelay(slew_delay); } |
