From patchwork Thu Jul 25 07:12:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrice CHOTARD X-Patchwork-Id: 1136701 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="0segR5fY"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45vNj822jDz9s00 for ; Thu, 25 Jul 2019 17:13:16 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 86F8CC21C6A; Thu, 25 Jul 2019 07:13:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 3EF2AC21C27; Thu, 25 Jul 2019 07:13:06 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 7925FC21C27; Thu, 25 Jul 2019 07:13:04 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [62.209.51.94]) by lists.denx.de (Postfix) with ESMTPS id 2B303C21BE5 for ; Thu, 25 Jul 2019 07:13:04 +0000 (UTC) Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x6P768o1009020; Thu, 25 Jul 2019 09:13:02 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=STMicroelectronics; bh=luxTaIp7mfWS/DFt0s5+sFlmPnrNvZKz/d/YF91wtCs=; b=0segR5fYQBIlXuT7pOalYdOnr7qetYkG7elPxUWMpGoNGEI6aN3aLVgV1QkQ6tjR2fvP BUHEH0bN10SjgpsQC7xQITTZGTRUBe+rQR1O3uvWMQyxVBAqpMhsg7jxSEJcSYBTKNMT CjlaE+rLFdEsd2udnpQPfNkeguuy3Rn9sdXlUn1/Rw3omSAWFD5nfd3KJuUIYrbo2tYh XsGpFuIe8q8ZOBb637mtIo8sh1eqQTbdDblUqzfSLwRFFuY+jcqH8J+nLpqGvzFRS3RM wwowOZzdNivWa3n/9rR+A2WvxhWepwPJ0mYYWmh2CPzS7778dwrq4KeSpFdLP67ArGDH uQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2tx604a29s-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 25 Jul 2019 09:13:02 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 729B841; Thu, 25 Jul 2019 07:12:51 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas24.st.com [10.75.90.94]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 504DC16A6; Thu, 25 Jul 2019 07:12:51 +0000 (GMT) Received: from SAFEX1HUBCAS23.st.com (10.75.90.47) by Safex1hubcas24.st.com (10.75.90.94) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 25 Jul 2019 09:12:51 +0200 Received: from localhost (10.201.23.73) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 25 Jul 2019 09:12:50 +0200 From: Patrice Chotard To: Date: Thu, 25 Jul 2019 09:12:39 +0200 Message-ID: <20190725071239.31398-1-patrice.chotard@st.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.201.23.73] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-07-25_03:, , signatures=0 Cc: Sven Schwermer , U-Boot STM32 Subject: [U-Boot] [PATCH] regulator: fixed: Modify enable-active-high behavior X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" Regulator should not be enabled at probe time if regulator-boot-on property is not in the dt node. "enable-active-high" property is only used to indicate the GPIO polarity. See kernel documentation : - Documentation/devicetree/bindings/regulator/fixed-regulator.yaml - Documentation/devicetree/bindings/regulator/gpio-regulator.yaml Signed-off-by: Christophe Kerello Signed-off-by: Patrice Chotard --- drivers/power/regulator/regulator_common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/power/regulator/regulator_common.c b/drivers/power/regulator/regulator_common.c index 3dabbe2a85..2e8a083c75 100644 --- a/drivers/power/regulator/regulator_common.c +++ b/drivers/power/regulator/regulator_common.c @@ -15,7 +15,9 @@ int regulator_common_ofdata_to_platdata(struct udevice *dev, int flags = GPIOD_IS_OUT; int ret; - if (dev_read_bool(dev, "enable-active-high")) + if (!dev_read_bool(dev, "enable-active-high")) + flags |= GPIOD_ACTIVE_LOW; + if (uc_pdata->boot_on) flags |= GPIOD_IS_OUT_ACTIVE; /* Get optional enable GPIO desc */