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

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

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 <wens@csie.org>
---
 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

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

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

Hi,

Please ignore this one. I'll send v2 shortly.

On Mon, Jul 20, 2020 at 5:44 PM Chen-Yu Tsai <wens@kernel.org> wrote:
>
> From: Chen-Yu Tsai <wens@csie.org>
>
> 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.

I'll rework the commit log so it makes more sense. (and fix the typo ...)

ChenYu

> Fixes: 006694d099e8 ("regulator: gpio-regulator: Allow use of GPIO controlled regulators though DT")
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
>  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

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

end of thread, other threads:[~2020-07-20  9:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-20  9:44 [PATCH] reuglator: gpio: Honor regulator-boot-on property Chen-Yu Tsai
2020-07-20  9:54 ` Chen-Yu Tsai

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).