Thread (3 messages) 3 messages, 3 authors, 2024-05-06

Re: [PATCH V2] pinctrl: bcm2835: Make pin freeing behavior configurable

From: Andy Shevchenko <hidden>
Date: 2024-05-06 20:31:11
Also in: linux-gpio

Fri, May 03, 2024 at 08:27:45AM +0200, Stefan Wahren kirjoitti:
Until now after a bcm2835 pin was freed its pinmux was set to GPIO_IN.
So in case it was configured as GPIO_OUT before the configured output
level also get lost. As long as GPIO sysfs was used this wasn't
actually a problem because the pins and their possible output level
were kept by sysfs.

Since more and more Raspberry Pi users start using libgpiod they are
confused about this behavior. So make the pin freeing behavior of
GPIO_OUT configurable via module parameter. In case
pinctrl-bcm2835.persist_gpio_outputs is set to 1, the output level is
kept.

This patch based on the downstream work of Phil Elwell.
...
+static bool persist_gpio_outputs;
+module_param(persist_gpio_outputs, bool, 0644);
Do you need 'w' attribute?

...
+	dev_info(dev, "GPIO_OUT persistence: %s\n",
+		 persist_gpio_outputs ? "yes" : "no");
str_yes_no() and with it can be put on a single line.

-- 
With Best Regards,
Andy Shevchenko



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help