* [PATCH v2] regulator: gpio: Honor regulator-boot-on property
@ 2020-07-20 10:01 ` Chen-Yu Tsai
0 siblings, 0 replies; 8+ messages in thread
From: Chen-Yu Tsai @ 2020-07-20 10:01 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 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
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2] regulator: gpio: Honor regulator-boot-on property
@ 2020-07-20 10:01 ` Chen-Yu Tsai
0 siblings, 0 replies; 8+ messages in thread
From: Chen-Yu Tsai @ 2020-07-20 10:01 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 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 <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] 8+ messages in thread
* Re: [PATCH v2] regulator: gpio: Honor regulator-boot-on property
2020-07-20 10:01 ` Chen-Yu Tsai
@ 2020-07-20 11:06 ` Mark Brown
-1 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2020-07-20 11:06 UTC (permalink / raw)
To: Chen-Yu Tsai
Cc: Liam Girdwood, Chen-Yu Tsai, linux-arm-kernel, linux-kernel,
Maxime Ripard
[-- Attachment #1: Type: text/plain, Size: 349 bytes --]
On Mon, Jul 20, 2020 at 06:01:13PM +0800, Chen-Yu Tsai wrote:
> 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.
There may still be out of tree users, an ABI is an ABI.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] regulator: gpio: Honor regulator-boot-on property
@ 2020-07-20 11:06 ` Mark Brown
0 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2020-07-20 11:06 UTC (permalink / raw)
To: Chen-Yu Tsai
Cc: Maxime Ripard, Chen-Yu Tsai, Liam Girdwood, linux-arm-kernel,
linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 349 bytes --]
On Mon, Jul 20, 2020 at 06:01:13PM +0800, Chen-Yu Tsai wrote:
> 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.
There may still be out of tree users, an ABI is an ABI.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
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] 8+ messages in thread
* Re: [PATCH v2] regulator: gpio: Honor regulator-boot-on property
2020-07-20 11:06 ` Mark Brown
@ 2020-07-20 12:03 ` Chen-Yu Tsai
-1 siblings, 0 replies; 8+ messages in thread
From: Chen-Yu Tsai @ 2020-07-20 12:03 UTC (permalink / raw)
To: Mark Brown
Cc: Chen-Yu Tsai, Liam Girdwood, linux-arm-kernel, linux-kernel,
Maxime Ripard
On Mon, Jul 20, 2020 at 7:06 PM Mark Brown <broonie@kernel.org> wrote:
>
> On Mon, Jul 20, 2020 at 06:01:13PM +0800, Chen-Yu Tsai wrote:
>
> > 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.
>
> There may still be out of tree users, an ABI is an ABI.
Ok. Should I add a comment stating this should not be used in new files?
Or just leave it as it?
ChenYu
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] regulator: gpio: Honor regulator-boot-on property
@ 2020-07-20 12:03 ` Chen-Yu Tsai
0 siblings, 0 replies; 8+ messages in thread
From: Chen-Yu Tsai @ 2020-07-20 12:03 UTC (permalink / raw)
To: Mark Brown
Cc: Maxime Ripard, Chen-Yu Tsai, Liam Girdwood, linux-arm-kernel,
linux-kernel
On Mon, Jul 20, 2020 at 7:06 PM Mark Brown <broonie@kernel.org> wrote:
>
> On Mon, Jul 20, 2020 at 06:01:13PM +0800, Chen-Yu Tsai wrote:
>
> > 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.
>
> There may still be out of tree users, an ABI is an ABI.
Ok. Should I add a comment stating this should not be used in new files?
Or just leave it as it?
ChenYu
_______________________________________________
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] 8+ messages in thread
* Re: [PATCH v2] regulator: gpio: Honor regulator-boot-on property
2020-07-20 12:03 ` Chen-Yu Tsai
@ 2020-07-20 12:04 ` Mark Brown
-1 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2020-07-20 12:04 UTC (permalink / raw)
To: Chen-Yu Tsai; +Cc: Liam Girdwood, linux-arm-kernel, linux-kernel, Maxime Ripard
[-- Attachment #1: Type: text/plain, Size: 324 bytes --]
On Mon, Jul 20, 2020 at 08:03:06PM +0800, Chen-Yu Tsai wrote:
> On Mon, Jul 20, 2020 at 7:06 PM Mark Brown <broonie@kernel.org> wrote:
> > There may still be out of tree users, an ABI is an ABI.
> Ok. Should I add a comment stating this should not be used in new files?
> Or just leave it as it?
A comment would be fine.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] regulator: gpio: Honor regulator-boot-on property
@ 2020-07-20 12:04 ` Mark Brown
0 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2020-07-20 12:04 UTC (permalink / raw)
To: Chen-Yu Tsai; +Cc: Maxime Ripard, Liam Girdwood, linux-arm-kernel, linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 324 bytes --]
On Mon, Jul 20, 2020 at 08:03:06PM +0800, Chen-Yu Tsai wrote:
> On Mon, Jul 20, 2020 at 7:06 PM Mark Brown <broonie@kernel.org> wrote:
> > There may still be out of tree users, an ABI is an ABI.
> Ok. Should I add a comment stating this should not be used in new files?
> Or just leave it as it?
A comment would be fine.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
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] 8+ messages in thread
end of thread, other threads:[~2020-07-20 12:06 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-20 10:01 [PATCH v2] regulator: gpio: Honor regulator-boot-on property Chen-Yu Tsai
2020-07-20 10:01 ` Chen-Yu Tsai
2020-07-20 11:06 ` Mark Brown
2020-07-20 11:06 ` Mark Brown
2020-07-20 12:03 ` Chen-Yu Tsai
2020-07-20 12:03 ` Chen-Yu Tsai
2020-07-20 12:04 ` Mark Brown
2020-07-20 12:04 ` Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.