Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gpios: Adapt to the upstream persist_gpio_outputs change #6150

Merged
merged 6 commits into from
May 7, 2024

Conversation

pelwell
Copy link
Contributor

@pelwell pelwell commented May 7, 2024

Commit 8ff0598 ("pinctrl: bcm2835: Make pin freeing behavior configurable") is a version of "pinctrl: bcm2835: Only return non-GPIOs to inputs" with upstream blessing. Backport and adopt that commit, making a similar change to pinctrl-rp1, with sufficient changes to preserve the existing downstream behaviour.

pelwell and others added 6 commits May 7, 2024 11:54
commit 8ff0598 upstream.

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.

Link: raspberrypi#6117
Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Message-ID: <20240503062745.11298-1-wahrenst@gmx.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Having accepted the upstream change to add the persist_gpio_outputs
parameter, make it true by default.

See: raspberrypi#6117

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Following 8ff0598, adopt the same
parameter name but with the opposite default.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Following the adoption upstream of a similar parameter but with another
name, update the dtparam definitions to use the new name and sense.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
@pelwell pelwell merged commit c10f023 into raspberrypi:rpi-6.6.y May 7, 2024
11 of 12 checks passed
popcornmix added a commit to raspberrypi/firmware that referenced this pull request May 9, 2024
See: raspberrypi/linux#6151

kernel: defconfigs: Add ILI9881 to rpi and bcm2709 defconfigs
See: raspberrypi/linux#6025

kernel: configs: Enable BCACHEFS as a module
See: raspberrypi/linux#6149

kernel: gpios: Adapt to the upstream persist_gpio_outputs change
See: raspberrypi/linux#6150

kernel: dts: bcm2712: Drop snd_bcm2835 bootargs references from Pi5
See: raspberrypi/linux#6153

kernel: overlays: Add sc16is750-spi0
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request May 9, 2024
See: raspberrypi/linux#6151

kernel: defconfigs: Add ILI9881 to rpi and bcm2709 defconfigs
See: raspberrypi/linux#6025

kernel: configs: Enable BCACHEFS as a module
See: raspberrypi/linux#6149

kernel: gpios: Adapt to the upstream persist_gpio_outputs change
See: raspberrypi/linux#6150

kernel: dts: bcm2712: Drop snd_bcm2835 bootargs references from Pi5
See: raspberrypi/linux#6153

kernel: overlays: Add sc16is750-spi0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants