Merged
Conversation
GPIO Chips, particularly on the Pi 5. Improved handling of duplicate pin names. Code now prefixes the pin name with the chip name if it's duplicated.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #64 +/- ##
=======================================
- Coverage 27.4% 27.3% -0.1%
=======================================
Files 96 96
Lines 11774 11815 +41
=======================================
- Hits 3221 3220 -1
- Misses 8418 8460 +42
Partials 135 135 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
Contributor
Author
|
@maruel Not sure why this is failing. It doesn't look like something I did... |
maruel
reviewed
Nov 22, 2024
Member
maruel
left a comment
There was a problem hiding this comment.
Thanks a lot. Everything is stylistic and optional except line 626 where it could be a real crash.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #62
GPIO Chips with labels pinctrl-* are sorted to register first. This is a kernel convention identifying a GPIO chip that has exported/user lines.
Handling for potential duplicate chips was added. The kernel is exporting gpiochip0, and symlinking it to gpiochip4 as well. This PR ensures a chip with the same name is not registered more than once.
Cleaned up some code duplication in the basic test.
If the registration code detects that a line is already registered, it attempts to make the line name unique by prefixing it with the chip name.
Tested on a Pi5, and a Pi Zero W.