From patchwork Mon Jul 20 10:01:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 11673447 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ABED317C5 for ; Mon, 20 Jul 2020 10:02:50 +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 8656721775 for ; Mon, 20 Jul 2020 10:02:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="c+meemLo"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="RfDRxT0L" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8656721775 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+patchwork-linux-arm=patchwork.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=BH4iICQgdnHzKgiBkhpOlJmwKo2xpiK7IshmHUM9zJg=; b=c+meemLosv5Le7ZBUv7hiVHXuQ qhcZfGFC9P9FrgLIIzMVAg9ACF57Mp9ZXl+1rM3NucOQrwEOt5AP8pB9G2ua7BpE8lAWXN0faRuuf EieMEmD7pQJYIjrl5ScTrAUd9NXlviTd79PXxKFPTp89HbBZWS+7CH/JrYJtQHYGsLDuR+YHPHr3q JghvPcrWU6BiZ/bubdaBDVtqOErPLls8PHuopmXNDwHteXijJUlXHOfOnDvZrPjAhAvpre7GmaeIZ ryIy6fw9t/BjhNP0s+Vae563TGUhoqq4qG83Pxm/bbxqwp6ImSo2H5ENX2h42BHP4bAXpah4KtHKC wcKNzBDw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxSbp-0005kg-Ik; Mon, 20 Jul 2020 10:01:21 +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 1jxSbn-0005kB-LW for linux-arm-kernel@lists.infradead.org; Mon, 20 Jul 2020 10:01:20 +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 9FB1B21775; Mon, 20 Jul 2020 10:01:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595239278; bh=LVubc+F0JQI4FQaSy7JIShrF/KXQ3v3Jg/s4/IEFm8o=; h=From:To:Cc:Subject:Date:From; b=RfDRxT0LglMSisisyD29I5hbPDUDhHBF/mLSSNWuh950m1n7hZY6rKeN9DgcmxrDc Bj/CQ3C67v6hzRfQw9ydcgEUF8s9MASPhnZEgtWzD1oFJiekLmyT5bE4cSu3+ZjYqB W/r+tioH9xGDGzjD3QNFFnbEWExF27ijOziYLqaQ= Received: by wens.tw (Postfix, from userid 1000) id 29FF95FC86; Mon, 20 Jul 2020 18:01:16 +0800 (CST) From: Chen-Yu Tsai To: Mark Brown , Liam Girdwood Subject: [PATCH v2] regulator: gpio: Honor regulator-boot-on property Date: Mon, 20 Jul 2020 18:01:13 +0800 Message-Id: <20200720100113.6481-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_060119_786457_B93CE65F X-CRM114-Status: GOOD ( 14.08 ) X-Spam-Score: -5.2 (-----) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-5.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [198.145.29.99 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender 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 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Chen-Yu Tsai When requesting the enable GPIO, the driver should do so with the correct output level matching some expected state. This is especially important if the regulator is a critical one, such as a supply for the boot CPU. This is currently done by checking for the enable-at-boot property, but this is not documented in the device tree binding, nor does it match the common regulator properties. Honor the common regulator-boot-on property by checking the boot_on constraint setting within the DT probe path. 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);