[U-Boot] [PATCH v3 6/9] regulator: Add support for ramp delay
Krzysztof Kozlowski
krzk at kernel.org
Mon Feb 18 14:28:46 UTC 2019
On Mon, 18 Feb 2019 at 15:03, Torsten Duwe <duwe at lst.de> wrote:
>
> On Sat, Feb 16, 2019 at 10:45:45AM +0100, Krzysztof Kozlowski wrote:
> > Changing voltage and enabling regulator might require delays so the
> > regulator stabilizes at expected level.
> >
> > Add support for "regulator-ramp-delay" binding which can introduce
> > required time to both enabling the regulator and to changing the
> > voltage.
>
> I'm surprised that such a thing doesn't exist already.
>
> > Signed-off-by: Krzysztof Kozlowski <krzk at kernel.org>
>
> > --- a/doc/device-tree-bindings/regulator/regulator.txt
> > +++ b/doc/device-tree-bindings/regulator/regulator.txt
> > @@ -35,6 +35,7 @@ Optional properties:
> > - regulator-max-microamp: a maximum allowed Current value
> > - regulator-always-on: regulator should never be disabled
> > - regulator-boot-on: enabled by bootloader/firmware
> > +- regulator-ramp-delay: ramp delay for regulator (in uV/us)
>
> I guess you mean s/V, not V/s; at least the code suggests so.
uV/uS. It is correct in the code:
int delay = DIV_ROUND_UP(abs(new_uV - old_uV), ramp_delay);
delay = (uV - uV) / (uV / uS) = uS
> But my main point is: is the required delay always a linear
> function of the voltage jump? Depending on the dampening and
> load on the rail this could be an overshoot and settle, no?
>
> So I suggest to make that an array with 2 elements: a fixed part
> and a time per voltage change. Does that make sense?
Just to make it clear - then we do not follow Linux kernel DT bindings.
The voltage change might have exponential characteristic and/or have
additional fixed delay time (see patch 7 here). We could re-use some
properties from Linux bindings for that purpose:
https://elixir.bootlin.com/linux/latest/source/Documentation/devicetree/bindings/regulator/regulator.txt#L19
https://elixir.bootlin.com/linux/latest/source/Documentation/devicetree/bindings/regulator/regulator.txt#L24
Best regards,
Krzysztof
More information about the U-Boot
mailing list