Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1619150ybh; Mon, 20 Jul 2020 03:02:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmNvXmqYnPOAxLzoDXGaTZGa68ympNbXGM+XrrB4Mi/PwCKYsFcCCKT6/jsMhotz5XDeo5 X-Received: by 2002:a17:907:4003:: with SMTP id nj3mr19544853ejb.278.1595239369279; Mon, 20 Jul 2020 03:02:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595239369; cv=none; d=google.com; s=arc-20160816; b=qOhIkYNpVPiiOvZADgeUToNGh+01MDsjOlNI/4T5LCKiHtj4hMWPPVPNuu9okUMZ1x kOdp3BKSGkSDGuIAHIM6Cps5elnzQ+oSEdrrP3ZC4jzo9KbZ+pRspdY6ZDjiRVKsk6xc AnmpHMUo4wmPceeJD0E1fnbu+9+LxlPjImV2ibN6I2bA80oT8qJ7cKSdZwCaeuBMTg7p H69aZ5HM2hYB4WZmFmDCZuKFvMgkF2ixUoUSRydXsyBnHFufK3OW6ClV1/nQpXyn8DFL c6PO6dTOcKCEgJ1Cw85OjZAeZKmKECg0yFqJ5UY85/kNvrcvXoRbImAJnfgubeG7oExM i6pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=cQHgpn2aVNcdRjYxCbqnl6v1Av2KOmc6phk3j5PDFgU=; b=08sLskjVSGRwbvIs0+P8xdFKXXThOJdWY2JBkU+BmTM2sVmO+eGecJHEqZ/kyB1ds2 HhrgfxUCGgiNSjf7ErPzuzboBHYJ7LU/luSUmsj9bcq1iCVDz+jiiP5AosEqJcdEJ171 vsSgWzbYOo5bu5S1DbgrJfABOyHozaeV/tXQctX9GZQPfQWgAFTz1FFSdMXIbn1uKN8I mqGctbQHqZ4/AOWlwv183Wrx9KtlCp1y7gkBhB2KxUqBgeYMUXZoSi9kut61FtsymiY5 E0FGMgF9Ir34aGWhl/TjcfNcbdhpis1/5fJMiJ9spnlpQbjU75kFsz22GIws3VhBAL8V 1Xag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RfDRxT0L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gu14si10412644ejb.589.2020.07.20.03.02.06; Mon, 20 Jul 2020 03:02:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RfDRxT0L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728404AbgGTKBT (ORCPT + 99 others); Mon, 20 Jul 2020 06:01:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:56486 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727120AbgGTKBT (ORCPT ); Mon, 20 Jul 2020 06:01:19 -0400 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 Cc: Chen-Yu Tsai , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Maxime Ripard 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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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); -- 2.27.0