[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6190301.lOV4Wx5bFT@fw-rgant>
Date: Wed, 21 May 2025 13:50:22 +0200
From: Romain Gantois <romain.gantois@...tlin.com>
To: Mark Brown <broonie@...nel.org>
Cc: Liam Girdwood <lgirdwood@...il.com>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>, linux-kernel@...r.kernel.org
Subject:
Re: [PATCH] regulator: core: do not ignore repeated requests on stepped
regulators
On Wednesday, 21 May 2025 12:07:05 CEST Mark Brown wrote:
> On Wed, May 21, 2025 at 10:47:24AM +0200, Romain Gantois wrote:
> > Currently, the regulator_set_voltage() function will assume a noop if a
> > consumer requests the same voltage range twice in a row.
> >
> > This can lead to unexpected behavior if the target regulator has a maximum
> > voltage step constraint. With such constraints, the regulator core may
> > clamp the requested voltage to a lesser value, to ensure that the voltage
> > delta stays under the specified limit.
>
> No, if there's an issue here we should handle it the first time we set
> the voltage by doing multiple steps in one set_voltage() call. Having
> individual client drivers all having to repeatedly call set_voltage() is
> obviously not a good API.
Understood, would it make sense to handle this directly in
regulator_set_voltage_unlocked()? For example by checking for a max_uV_step
condition and repeating calls to regulator_do_balance_voltage() until the
resulting voltage stabilizes?
Thanks,
--
Romain Gantois, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists