-
Notifications
You must be signed in to change notification settings - Fork 33
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
gpioioctl: Improve Registration #64
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:
|
@maruel Not sure why this is failing. It doesn't look like something I did... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot. Everything is stylistic and optional except line 626 where it could be a real crash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again!
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.