mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Marco Felsch <m.felsch@pengutronix.de>
Cc: BAREBOX <barebox@lists.infradead.org>
Subject: Re: [PATCH 2/2] regulator: fixed: handle startup-delay-us property
Date: Tue, 3 Feb 2026 12:08:15 +0100	[thread overview]
Message-ID: <aYHXHwTUXDeiBaDH@pengutronix.de> (raw)
In-Reply-To: <20260129121038.vjbyckvvrncdgsml@pengutronix.de>

On Thu, Jan 29, 2026 at 01:10:38PM +0100, Marco Felsch wrote:
> On 26-01-29, Sascha Hauer wrote:
> > The "startup-delay-us" property of the fixed regulator has never been
> > handled by barebox. Handle it now.
> > 
> > The "startup-delay-us" property is specified as:
> > 
> > | startup time in microseconds
> > 
> > Then there's a regulator generic property "regulator-enable-ramp-delay"
> > which barebox handles, specified as:
> > 
> > | The time taken, in microseconds, for the supply rail to
> > | reach the target voltage, plus/minus whatever tolerance the board
> > | design requires. This property describes the total system ramp time
> > | required due to the combination of internal ramping of the regulator
> > | itself, and board design issues such as trace capacitance and load
> > | on the supply.
> > 
> > We just use the bigger of the two times as the time a regulator needs
> > to become stable.
> > 
> > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > ---
> >  drivers/regulator/core.c  | 9 +++++++--
> >  drivers/regulator/fixed.c | 3 +++
> >  include/regulator.h       | 2 ++
> >  3 files changed, 12 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
> > index 8ca937e8bd..1f8d77dc96 100644
> > --- a/drivers/regulator/core.c
> > +++ b/drivers/regulator/core.c
> > @@ -297,6 +297,7 @@ int of_regulator_register(struct regulator_dev *rdev, struct device_node *node)
> >  {
> >  	const char *name;
> >  	int ret;
> > +	u32 val = 0;
> >  
> >  	if (!rdev || !node)
> >  		return -EINVAL;
> > @@ -313,12 +314,16 @@ int of_regulator_register(struct regulator_dev *rdev, struct device_node *node)
> >  
> >  	if (rdev->desc->off_on_delay)
> >  		rdev->off_on_delay = rdev->desc->off_on_delay;
> > +	if (rdev->desc->enable_time_us)
> > +		rdev->enable_time_us = rdev->desc->enable_time_us;
> >  
> >  	if (rdev->desc->fixed_uV && rdev->desc->n_voltages == 1)
> >  		rdev->min_uv = rdev->max_uv = rdev->desc->fixed_uV;
> >  
> > -	of_property_read_u32(node, "regulator-enable-ramp-delay",
> > -			&rdev->enable_time_us);
> > +	of_property_read_u32(node, "regulator-enable-ramp-delay", &val);
> > +	if (val > rdev->enable_time_us)
> 
> Nit: Worth a comment to make it more obvious?

Added a comment while applying.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



  reply	other threads:[~2026-02-03 11:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-29 11:35 [PATCH 0/2] regulator: Fix enable delay handling Sascha Hauer
2026-01-29 11:35 ` [PATCH 1/2] regulator: fix handling of off_on_delay Sascha Hauer
2026-01-29 12:06   ` Marco Felsch
2026-02-03 11:06     ` Sascha Hauer
2026-01-29 11:35 ` [PATCH 2/2] regulator: fixed: handle startup-delay-us property Sascha Hauer
2026-01-29 12:10   ` Marco Felsch
2026-02-03 11:08     ` Sascha Hauer [this message]
2026-02-03 11:03 ` [PATCH 0/2] regulator: Fix enable delay handling Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aYHXHwTUXDeiBaDH@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=m.felsch@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox