[PATCH v4 3/4] power: regulator: Perform regulator setup inside uclass

Simon Glass sjg at chromium.org
Wed Oct 4 04:10:52 CEST 2023


Hi Svyatoslav,

On Tue, 3 Oct 2023 at 00:21, Svyatoslav Ryhel <clamor95 at gmail.com> wrote:
>
> Regulators initial setup was previously dependent on board call.
> To move from this behaviour next solution is proposed: on post_bind
> boot-on/always-on properties are checked, all regulators with
> such props will be probed just after binding which ensures that
> essential regulators are set, then in the post probe regulator
> autoset is called so that correct regulator state according to
> device tree is reached.

We need a way to do this later, after all devices are probed.

i.e. we must not probe things as we go. There might be other
dependencies not yet bound. It may also take some time. This is not
following driver model design, sorry.

So please think of a way to do this properly.

One option would be to add a new phase in dm_init_and_scan() which
probes devices that want to be probed early.

>
> Signed-off-by: Svyatoslav Ryhel <clamor95 at gmail.com>
> [jonas at kwiboo.se: use autoset func, only probe with always/boot-on prop]
> Signed-off-by: Jonas Karlman <jonas at kwiboo.se>
> ---
>  drivers/power/regulator/regulator-uclass.c | 30 ++++++++++++++++++----
>  1 file changed, 25 insertions(+), 5 deletions(-)
>

Regards,
Simon


More information about the U-Boot mailing list