Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1610568ybh; Mon, 20 Jul 2020 02:47:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvJBZX/8aGZteqqy2CslQL3kJw/eAmLG2v55z5JsoJrboCfmcww7boMh9bjMgBoIvY8Uyf X-Received: by 2002:a17:906:c007:: with SMTP id e7mr19907071ejz.481.1595238445697; Mon, 20 Jul 2020 02:47:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595238445; cv=none; d=google.com; s=arc-20160816; b=spFb5T84m5AgJdOrXiL3QlzqhvEM8YxUpeI0VMUkXmJQXuNn1J0MnWzxJ6P2jhdjLE EJZNg57t0xMBPHwc+EqL8953kaik7W4W2v8FKuvJ/n0GtdGScCLzbjGEBqF1Ldc88IyU se82XEMnEKtVLaxw6ebbsKhUt6RKi1EF8r73TOHMK+omn4LocOKlovyXBk+LLzpzHUHK MYdWhmO0oRazvCmXbjMnqdpNjIVtRVW/lDUTkVg43Wpbiak04UH5RpvpJaC+VzOo2kn8 OWD5Kt6qa3GrrO1/t++Diq9Wg1Qx1f/ZqIX9tdDSrdJb2HvAzH1NqwMitlAB69Polr7i O/wg== 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=gDaLPwx/CsiYeTWKf/FF1ckTD7wqc/Ea7DwHAQI135I=; b=mTMC3TV489zIJnANARpmXXsTg/TRbFKioOVe0OQSg4Yb7n1NEHDj2vjHvG+dejD9vP kxfp/bueO00xBObc7RlBjqi7yiuaoflIbug4YfIMEGXfo7nDQpXwCFn7tPGiqEShIAO6 1/llHNoCMSisiBH7kmGrylv6TcCSZIeozVeuTwHY4CXist4BkoX5vE6hWb6aO1vBOWqe U2SqNS9Tl1BeJp6ptH5pA5SQKYs07F15pOprq0Imn3zQ0CM0/sr6RbVGoL8qUoBrPtOK EwJgWUnqISHm2w16WqA1tRzyqVzPwmzU3dOETfomOozjKPsLc4UdOrZLXIW8e1Zec2mw ujPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="hsCU0a/a"; 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 q26si9978408eja.585.2020.07.20.02.47.03; Mon, 20 Jul 2020 02:47:25 -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="hsCU0a/a"; 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 S1728151AbgGTJoz (ORCPT + 99 others); Mon, 20 Jul 2020 05:44:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:51464 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727769AbgGTJoz (ORCPT ); Mon, 20 Jul 2020 05:44:55 -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 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 Cc: Chen-Yu Tsai , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Maxime Ripard 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 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 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