From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4B319C43334 for ; Mon, 18 Jul 2022 20:05:56 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 572B883FDC; Mon, 18 Jul 2022 22:05:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=tinet.cat Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id AA25283FDE; Mon, 18 Jul 2022 22:05:52 +0200 (CEST) Received: from mx1.tinet.cat (mx1.dipta.cat [195.76.233.59]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EB2A583F97 for ; Mon, 18 Jul 2022 22:05:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=tinet.cat Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xdrudis@tinet.cat X-ASG-Debug-ID: 1658174747-12aaf258c3953660001-4l7tJC Received: from smtp01.tinet.cat (smtp01.tinet.cat [195.77.216.131]) by mx1.tinet.cat with ESMTP id Dl0IQNwvcrlXRiuW; Mon, 18 Jul 2022 22:05:47 +0200 (CEST) X-Barracuda-Envelope-From: xdrudis@tinet.cat X-Barracuda-Effective-Source-IP: smtp01.tinet.cat[195.77.216.131] X-Barracuda-Apparent-Source-IP: 195.77.216.131 Received: from begut (99.red-79-152-185.dynamicip.rima-tde.net [79.152.185.99]) by smtp01.tinet.cat (Postfix) with ESMTPSA id 5F518605D0A1; Mon, 18 Jul 2022 22:05:47 +0200 (CEST) Date: Mon, 18 Jul 2022 22:05:46 +0200 From: Xavier Drudis Ferran To: Quentin Schulz Cc: sjg@chromium.org, philipp.tomsich@vrull.eu, kever.yang@rock-chips.com, alpernebiyasak@gmail.com, email2tema@gmail.com, jagan@amarulasolutions.com, u-boot@lists.denx.de, Quentin Schulz Subject: Re: [SPAM] [PATCH v2 1/2] rockchip: rk3399: fix incorrect ifdef check on SPL_DM_REGULATOR Message-ID: <20220718200546.GF1686@begut> X-ASG-Orig-Subj: Re: [SPAM] [PATCH v2 1/2] rockchip: rk3399: fix incorrect ifdef check on SPL_DM_REGULATOR References: <20220715150949.952853-1-foss+uboot@0leil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220715150949.952853-1-foss+uboot@0leil.net> User-Agent: Mutt/1.10.1 (2018-07-13) X-Barracuda-Connect: smtp01.tinet.cat[195.77.216.131] X-Barracuda-Start-Time: 1658174747 X-Barracuda-URL: https://webmail.tinet.cat:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 2775 X-Barracuda-BRTS-Status: 1 X-Barracuda-Bayes: INNOCENT GLOBAL 0.7990 1.0000 2.2126 X-Barracuda-Spam-Score: 2.21 X-Barracuda-Spam-Status: No, SCORE=2.21 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=6.0 KILL_LEVEL=8.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.99470 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean El Fri, Jul 15, 2022 at 05:09:48PM +0200, Quentin Schulz deia: > From: Quentin Schulz > > The check to perform is on CONFIG_SPL_DM_REGULATOR and not > SPL_DM_REGULATOR. Also switch to in-code check instead of ifdefs. > Tested it on a Rock-Pi-4 with the patch below on top. So with the small correction: Tested-by: Xavier Drudis Ferran > Fixes: 07586ee4322a ("rockchip: rk3399: Support common spl_board_init") > Cc: Quentin Schulz > Signed-off-by: Quentin Schulz > --- > > v2: > - use IS_ENABLED checks, > > arch/arm/mach-rockchip/rk3399/rk3399.c | 17 +++++++++-------- > 1 file changed, 9 insertions(+), 8 deletions(-) > > diff --git a/arch/arm/mach-rockchip/rk3399/rk3399.c b/arch/arm/mach-rockchip/rk3399/rk3399.c > index de11a3fa30..920da22307 100644 > --- a/arch/arm/mach-rockchip/rk3399/rk3399.c > +++ b/arch/arm/mach-rockchip/rk3399/rk3399.c > @@ -275,13 +275,14 @@ void spl_board_init(void) > rk3399_force_power_on_reset(); > #endif > > -#if defined(SPL_DM_REGULATOR) > - /* > - * Turning the eMMC and SPI back on (if disabled via the Qseven > - * BIOS_ENABLE) signal is done through a always-on regulator). > - */ > - if (regulators_enable_boot_on(false)) > - debug("%s: Cannot enable boot on regulator\n", __func__); > -#endif > + if (IS_ENABLED(CONFIG_SPL_DM_REGULATOR)) { > + /* > + * Turning the eMMC and SPI back on (if disabled via the Qseven > + * BIOS_ENABLE) signal is done through a always-on regulator). > + */ > + if (regulators_enable_boot_on(false)) > + debug("%s: Cannot enable boot on regulator\n", > + __func__); > + } > } > #endif > -- > 2.36.1 > The small correction: --- common/spl/spl.c | 2 -- include/power/regulator.h | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/common/spl/spl.c b/common/spl/spl.c index 70c11aa275..6ab997279d 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -39,9 +39,7 @@ #include #include #include -#if CONFIG_IS_ENABLED(DM_REGULATOR) #include -#endif DECLARE_GLOBAL_DATA_PTR; DECLARE_BINMAN_MAGIC_SYM; diff --git a/include/power/regulator.h b/include/power/regulator.h index ff1bfc2435..4bce61dd9f 100644 --- a/include/power/regulator.h +++ b/include/power/regulator.h @@ -631,6 +631,11 @@ static inline int regulators_enable_boot_on(bool verbose) return -ENOSYS; } +static inline int regulators_enable_boot_off(bool verbose) +{ + return -ENOSYS; +} + static inline int regulator_autoset(struct udevice *dev) { return -ENOSYS; -- 2.20.1