Re: Regulator probe

From: Andy Shevchenko
Date: Wed Sep 07 2016 - 10:30:10 EST


On Tue, 2016-09-06 at 11:24 +0100, Mark Brown wrote:
>Â
> > > Anyway if that's the case then it should all be working already
> > > then unless SFI goes down the ACPI code paths or someone changed
> > > SFI since SFI won't flag as having full costraints and therefore
> > > any missing regulator will report as deferring.
>
> >
> > But it's a real burden to describe in platform code _every_
> > regulators that device driver may need (for example, "vqmmc" is
> > optional and even "vmmc" is optional for 2 out of 3 SDHCI host
> > controllers!).
>
> Nothing says you have to describe all regulators, you just need to
> tell the core you have told it about everything you're going to tell
> it about.ÂÂUntil you do that the core has to assume that something may
> come along later and describe that supply.
>

That's I would like to make work. For now we have fixed voltage
regulator which returns EPROBE_DEFER since GPIO IP is not initialized
yet at that point. But regulator framework decides that it's not
possible case and overrides the error code.

For me it still looks that regulator framework would not intercept
deferred regulators in case of full constraints. Feels like I'm missing
something...

> > > > Basically you mean we have not call
> > > > regulator_has_full_constraints()? In that case we have to
> > > > provide stubs for all expected regulators, in case of SDHCI one
> > > > real and one dummy, who knows how many them in the drivers, but
> > > > for each we have to provide that. Am I right?

> > > You have to either not call regulator_has_full_constraints() or
> > > supply all the mappings for device supplies before you register a
> > > device.ÂÂIf you don't call regulator_has_full_constraints()
> > > missing regulators will always defer so you would need to provide
> > > a fixed voltage regulator for it.

...and fixed regulator is also deferred due to GPIO is not ready _yet_.


--
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Intel Finland Oy