* [PATCH] OF: gpio: don't warn if ignored GPIO flag matches the behavior
@ 2019-10-30 9:48 Lucas Stach
2019-11-04 8:06 ` Sascha Hauer
0 siblings, 1 reply; 2+ messages in thread
From: Lucas Stach @ 2019-10-30 9:48 UTC (permalink / raw)
To: barebox
Port of the upstream accepted change to the Linux kernel.
Some devicetrees specify the ACTIVE_LOW flag in the fixed regulator GPIO
handle. While this has always been ignored, it's consistent with the
behavior of the regulator binding in the absence of the
"enable-active-high" DT property. It doesn't make much sense to print a
user visible warning for a configuration which is consistent, so only
print the warning if the GPIO flag contradicts the behavior dictated by
by the enable-active-high property.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
drivers/of/of_gpio.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/of/of_gpio.c b/drivers/of/of_gpio.c
index 9a8331ed185b..7cbeeaf69e30 100644
--- a/drivers/of/of_gpio.c
+++ b/drivers/of/of_gpio.c
@@ -19,18 +19,20 @@ static void of_gpio_flags_quirks(struct device_node *np,
(!(strcmp(propname, "enable-gpio") &&
strcmp(propname, "enable-gpios")) &&
of_device_is_compatible(np, "regulator-gpio")))) {
+ bool active_low = !of_property_read_bool(np,
+ "enable-active-high");
/*
* The regulator GPIO handles are specified such that the
* presence or absence of "enable-active-high" solely controls
* the polarity of the GPIO line. Any phandle flags must
* be actively ignored.
*/
- if (*flags & OF_GPIO_ACTIVE_LOW) {
+ if ((*flags & OF_GPIO_ACTIVE_LOW) && !active_low) {
pr_warn("%s GPIO handle specifies active low - ignored\n",
np->full_name);
*flags &= ~OF_GPIO_ACTIVE_LOW;
}
- if (!of_property_read_bool(np, "enable-active-high"))
+ if (active_low)
*flags |= OF_GPIO_ACTIVE_LOW;
}
}
--
2.20.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] OF: gpio: don't warn if ignored GPIO flag matches the behavior
2019-10-30 9:48 [PATCH] OF: gpio: don't warn if ignored GPIO flag matches the behavior Lucas Stach
@ 2019-11-04 8:06 ` Sascha Hauer
0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2019-11-04 8:06 UTC (permalink / raw)
To: Lucas Stach; +Cc: barebox
On Wed, Oct 30, 2019 at 10:48:34AM +0100, Lucas Stach wrote:
> Port of the upstream accepted change to the Linux kernel.
>
> Some devicetrees specify the ACTIVE_LOW flag in the fixed regulator GPIO
> handle. While this has always been ignored, it's consistent with the
> behavior of the regulator binding in the absence of the
> "enable-active-high" DT property. It doesn't make much sense to print a
> user visible warning for a configuration which is consistent, so only
> print the warning if the GPIO flag contradicts the behavior dictated by
> by the enable-active-high property.
>
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
> drivers/of/of_gpio.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
Applied, thanks
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-11-04 8:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-30 9:48 [PATCH] OF: gpio: don't warn if ignored GPIO flag matches the behavior Lucas Stach
2019-11-04 8:06 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox