[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1387550902-6086-1-git-send-email-festevam@gmail.com>
Date: Fri, 20 Dec 2013 12:48:22 -0200
From: Fabio Estevam <festevam@...il.com>
To: broonie@...nel.org
Cc: shawn.guo@...aro.org, b20788@...escale.com,
linux-kernel@...r.kernel.org,
Fabio Estevam <fabio.estevam@...escale.com>
Subject: [RFC] regulator: anatop-regulator: Also provide a delay when voltage decreases
From: Fabio Estevam <fabio.estevam@...escale.com>
Currently we only wait for a delay for the LDO voltages to settle when it goes
from a lower voltage to a higher one.
Also provide the delay when the opposite transition happens.
Signed-off-by: Fabio Estevam <fabio.estevam@...escale.com>
---
Hi Anson/Shawn,
I could not find in the reference manual anywhere that says that the delay
should de done only when the voltage increases.
drivers/regulator/anatop-regulator.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/regulator/anatop-regulator.c b/drivers/regulator/anatop-regulator.c
index 7d7c05e..843c5d1 100644
--- a/drivers/regulator/anatop-regulator.c
+++ b/drivers/regulator/anatop-regulator.c
@@ -70,7 +70,7 @@ static int anatop_regmap_set_voltage_time_sel(struct regulator_dev *reg,
int ret = 0;
/* check whether need to care about LDO ramp up speed */
- if (anatop_reg->delay_bit_width && new_sel > old_sel) {
+ if (anatop_reg->delay_bit_width) {
/*
* the delay for LDO ramp up time is
* based on the register setting, we need
@@ -80,7 +80,7 @@ static int anatop_regmap_set_voltage_time_sel(struct regulator_dev *reg,
regmap_read(anatop_reg->anatop, anatop_reg->delay_reg, &val);
val = (val >> anatop_reg->delay_bit_shift) &
((1 << anatop_reg->delay_bit_width) - 1);
- ret = (new_sel - old_sel) * (LDO_RAMP_UP_UNIT_IN_CYCLES <<
+ ret = abs(new_sel - old_sel) * (LDO_RAMP_UP_UNIT_IN_CYCLES <<
val) / LDO_RAMP_UP_FREQ_IN_MHZ + 1;
}
--
1.8.1.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists