public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Xavier Drudis Ferran <xdrudis@tinet.cat>
To: Quentin Schulz <foss+uboot@0leil.net>
Cc: sjg@chromium.org, philipp.tomsich@vrull.eu,
	kever.yang@rock-chips.com, alpernebiyasak@gmail.com,
	email2tema@gmail.com, u-boot@lists.denx.de,
	Quentin Schulz <quentin.schulz@theobroma-systems.com>
Subject: Re: [SPAM] [RFC PATCH 1/2] spl: enable regulator-boot-on and disable regulator-force-boot-off
Date: Mon, 18 Jul 2022 10:34:54 +0200	[thread overview]
Message-ID: <20220718083454.GB1824@begut> (raw)
In-Reply-To: <20220715151426.953412-1-foss+uboot@0leil.net>


Hello, and thanks for you work 

El Fri, Jul 15, 2022 at 05:14:25PM +0200, Quentin Schulz deia:
> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> 
> This makes sure regulators that need to be turned on or off at boot are
> turned on or off in the SPL.
> 
> This may be required for the SPL to do some operations, such as finding
> possible loading media for U-Boot proper.
> 
> Cc: Quentin Schulz <foss+uboot@0leil.net>
> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> ---
> 
>  - RFC because only tested on Puma Haikou RK3399
> 
>  common/spl/spl.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/common/spl/spl.c b/common/spl/spl.c
> index c8c463f80b..762e9918c7 100644
> --- a/common/spl/spl.c
> +++ b/common/spl/spl.c
> @@ -37,6 +37,9 @@
>  #include <fdt_support.h>
>  #include <bootcount.h>
>  #include <wdt.h>
> +#if CONFIG_IS_ENABLED(DM_REGULATOR)
> +#include <power/regulator.h>
> +#endif
>

Can we remove the #if ? 
Otherwise I get 2 compilation warnings in tpl,
because I miss the dummy regulators_enable_boot_on (and _off)
  in include/power/regulator.h 

When compiling tpl for Rock-pi-4 
I have CONFIG_DM_REGULATOR=y, but not CONFIG_TPL_DM_REGULATOR or
CONFIG_SPL_DM_REGULATOR.

>  DECLARE_GLOBAL_DATA_PTR;
>  
> @@ -766,6 +769,15 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
>  	if (CONFIG_IS_ENABLED(GPIO_HOG))
>  		gpio_hog_probe_all();
>  
> +	if (CONFIG_IS_ENABLED(DM_REGULATOR)) {
> +		if (regulators_enable_boot_on(false))
> +			debug("%s: Cannot enable boot on regulator\n",
> +			      __func__);
> +		if (regulators_enable_boot_off(false))
> +			debug("%s: Cannot enable boot off regulator\n",
> +			      __func__);
> +	}
> +

This still introduces a warning for me. 

warning: implicit declaration of function 'regulators_enable_boot_off'

So maybe the dummy function must be added to include/power/regulator.h
 commit 16cc5ad0b439 ("power: regulator: add dummy helper")
introduced the dummy  regulators_enable_boot_on but missed 
the regulators_enable_boot_off.

Alternatively one could replace the if with an #if, but I think that'd 
be against U-Boot policy. 


  parent reply	other threads:[~2022-07-18  8:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-15 15:14 [RFC PATCH 1/2] spl: enable regulator-boot-on and disable regulator-force-boot-off Quentin Schulz
2022-07-15 15:14 ` [RFC PATCH 2/2] rockchip: rk3399: remove duplicate call to regulators_enable_boot_on Quentin Schulz
2022-07-18 20:13   ` [SPAM] " Xavier Drudis Ferran
2022-07-18  8:34 ` Xavier Drudis Ferran [this message]
2022-07-18  8:42   ` [SPAM] [RFC PATCH 1/2] spl: enable regulator-boot-on and disable regulator-force-boot-off Xavier Drudis Ferran
2022-07-18 20:12 ` Xavier Drudis Ferran

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=20220718083454.GB1824@begut \
    --to=xdrudis@tinet.cat \
    --cc=alpernebiyasak@gmail.com \
    --cc=email2tema@gmail.com \
    --cc=foss+uboot@0leil.net \
    --cc=kever.yang@rock-chips.com \
    --cc=philipp.tomsich@vrull.eu \
    --cc=quentin.schulz@theobroma-systems.com \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.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