linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] regulator: gpio: Honor regulator-boot-on property
@ 2020-07-20 13:28 Chen-Yu Tsai
  2020-07-22  0:57 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Chen-Yu Tsai @ 2020-07-20 13:28 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: Chen-Yu Tsai, linux-arm-kernel, linux-kernel, Maxime Ripard

From: Chen-Yu Tsai <wens@csie.org>

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 add a comment stating that the enable-at-boot property should not
be used.

Fixes: 006694d099e8 ("regulator: gpio-regulator: Allow use of GPIO controlled regulators though DT")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
Changes since v2:
  - Keep enable-at-boot property support
  - Add comment stating enable-at-boot should not be used

Changes since v1:
  - Reworded commit log
  - Fixed typo in subject
---
 drivers/regulator/gpio-regulator.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/regulator/gpio-regulator.c b/drivers/regulator/gpio-regulator.c
index 110ee6fe76c4..044e45ee9629 100644
--- a/drivers/regulator/gpio-regulator.c
+++ b/drivers/regulator/gpio-regulator.c
@@ -148,6 +148,13 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np,
 
 	config->supply_name = config->init_data->constraints.name;
 
+	if (config->init_data->constraints.boot_on)
+		config->enabled_at_boot = true;
+
+	/*
+	 * Do not use: undocumented device tree property.
+	 * This is kept around solely for device tree ABI stability.
+	 */
 	if (of_property_read_bool(np, "enable-at-boot"))
 		config->enabled_at_boot = true;
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v3] regulator: gpio: Honor regulator-boot-on property
  2020-07-20 13:28 [PATCH v3] regulator: gpio: Honor regulator-boot-on property Chen-Yu Tsai
@ 2020-07-22  0:57 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2020-07-22  0:57 UTC (permalink / raw)
  To: Liam Girdwood, Chen-Yu Tsai
  Cc: linux-arm-kernel, Maxime Ripard, Chen-Yu Tsai, linux-kernel

On Mon, 20 Jul 2020 21:28:09 +0800, Chen-Yu Tsai wrote:
> 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.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next

Thanks!

[1/1] regulator: gpio: Honor regulator-boot-on property
      commit: 3acff11cef1dece31cd29956f19181895996a7c5

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-22  0:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-20 13:28 [PATCH v3] regulator: gpio: Honor regulator-boot-on property Chen-Yu Tsai
2020-07-22  0:57 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).