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 X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D85BC433E2 for ; Mon, 20 Jul 2020 09:46:23 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E40E6208E4 for ; Mon, 20 Jul 2020 09:46:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YqSGjN1M"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="hsCU0a/a" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E40E6208E4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=gLcThTd1UmJVEdsy3yHhKhH8JP79oSRDqnmZ4EYHWi0=; b=YqSGjN1MvNKaowJKRnTl0sLAmL ZbBMcjaoIrS35m+dvj3+gSGYnyndrS5sjs2HsDpR3cGZiBZda8P4GxSHklHb6pa3HhSg9oLcLeEeH V+5qwwBCk1zNhr8VVi+Hhr2oIQ4HNsVRxP0oxgAg8KJ42RgACJZL718Mo3Zfaz5GB0YgTETKnkVip Gxi5IsUQOHGJ8CNsatxwb2hv3z0NPeqImz5pp07sPovYLfRxgv38KjOcaTFEdXRSoxwHjlc0xamM1 utlQmBUprxMfUvyW7Hg9vAoYhLQik5AxI5AslcD6lDErfGV2rT9WCJO9imxy2w3CMb66oRDTbw9LI 3b9JawjA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxSLz-0003KB-7W; Mon, 20 Jul 2020 09:44:59 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxSLw-0003JR-Bd for linux-arm-kernel@lists.infradead.org; Mon, 20 Jul 2020 09:44:57 +0000 Received: from wens.tw (mirror2.csie.ntu.edu.tw [140.112.194.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E7F23208E4; Mon, 20 Jul 2020 09:44:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595238295; bh=xG+MHTa8zHjZxmdpibpH8xzfEtpzgDpm4owhk97WPow=; h=From:To:Cc:Subject:Date:From; b=hsCU0a/aR4MuecLBLtFBKgrdrAbtbR+oeUtG6hk5xU2fymFpLEtEGig0REJi2zURF f/39pebyjEEOLA6J0rQXb5KKWHuynSRlm1xNC9zLbrm6cm0Z6UUiXXErWCHlS/6hsr EVaOuxZXDDmjnKkioy/EyrSnH6APHB8H7C4J3uDg= Received: by wens.tw (Postfix, from userid 1000) id 5F5EA5FC12; Mon, 20 Jul 2020 17:44:50 +0800 (CST) From: Chen-Yu Tsai To: Mark Brown , Liam Girdwood Subject: [PATCH] reuglator: gpio: Honor regulator-boot-on property Date: Mon, 20 Jul 2020 17:44:49 +0800 Message-Id: <20200720094449.32282-1-wens@kernel.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200720_054456_462541_A4EB65BB X-CRM114-Status: GOOD ( 13.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxime Ripard , Chen-Yu Tsai , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Chen-Yu Tsai When requesting the enable GPIO, the driver tries to do so with the correct output level matching the current state. This is done by checking the boot_on constraint, which is derived from the regulator-boot-on property in the device tree. This is especially important if the regulator is a critical one, such as a supply for the boot CPU. Honor the regulator-boot-on property by checking the boot_on constraint setting. This is the same as what is done in the fixed regulator driver. Also drop support for the undocumented enable-at-boot property. This property was not documented in the original commit introducing DT support, nor is it now, and there are no in-tree device trees that use this property. Fixes: 006694d099e8 ("regulator: gpio-regulator: Allow use of GPIO controlled regulators though DT") Signed-off-by: Chen-Yu Tsai --- drivers/regulator/gpio-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/gpio-regulator.c b/drivers/regulator/gpio-regulator.c index 110ee6fe76c4..5646b7a26288 100644 --- a/drivers/regulator/gpio-regulator.c +++ b/drivers/regulator/gpio-regulator.c @@ -148,7 +148,7 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np, config->supply_name = config->init_data->constraints.name; - if (of_property_read_bool(np, "enable-at-boot")) + if (config->init_data->constraints.boot_on) config->enabled_at_boot = true; of_property_read_u32(np, "startup-delay-us", &config->startup_delay); -- 2.27.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel