[PATCH v2 3/7] power: regulator-uclass: perform regulator setup inside uclass

Svyatoslav Ryhel clamor95 at gmail.com
Fri Jul 21 07:34:09 CEST 2023

чт, 20 лип. 2023 р. о 22:43 Simon Glass <sjg at chromium.org> пише:
> Hi Svyatoslav,
> On Thu, 20 Jul 2023 at 06:38, Svyatoslav Ryhel <clamor95 at gmail.com> wrote:
> >
> > Regulators initial setup was previously dependent on board call.
> > To move from this behaviour were introduced two steps. First is
> > that all individual regulators will be probed just after binding
> We must not probe devices automatically when bound. The i2c interface
> may not be available, etc. Do a probe afterwards.
> Perhaps I am misunderstanding this, iwc please reword this commit message.

After bound. If the regulator is a self-sufficient i2c device then it
will be bound
after i2c is available by code design so i2c interface should be
available at that
moment. At least led and gpio uclasses perform this for initial setup
of devices.

Platform regulators (aka fixed/gpio regulators) work perfectly fine. I
have no i2c
regulators to test deeply.

As for now only one uclass is not compatible with this system - PMIC which has
strong dependency between regulator and main mfd. This is why probing after
bind for pmic regulators is disabled and pmic regulators are probed on pmic core

> > which ensures that regulator pdata is filled and second is setting
> > up regulator in post probe which enseres that correct regulator
> > state according to pdata is reached.
> >
> > Signed-off-by: Svyatoslav Ryhel <clamor95 at gmail.com>
> > ---
> >  drivers/power/regulator/regulator-uclass.c | 212 ++++++---------------
> >  include/power/regulator.h                  | 119 ------------
> >  2 files changed, 62 insertions(+), 269 deletions(-)
> Regards,
> SImon

More information about the U-Boot mailing list