-
Notifications
You must be signed in to change notification settings - Fork 159
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
Add overlay that provides GPIO line names #27
Conversation
This enables gpioinfo and other tools to display the GPIO name for a given line offset/etc.
Without this patch, gpioinfo/etc gives no info about what each line offset maps to. It has no info at all in fact.
This was tested on a firefly ROC-RK3588S-PC because i don't have a rock pi 5 board, but assuming radxa hasn't reordered the GPIO chip numbers from the rk3588 base, it should work. |
This looks good, @RadxaStephen can you test and merge it? |
I will test that. |
There is no point for this to be an overlay. This should be added to the base dts like what I did with Zero 2, and customized to have names that make sense. There is no point to label an unexported GPIO pin. |
|
With gpiod you should run command like If boards don't label all the available pins, that's an inconsistency and should be fixed. We should not use a known broken state as an argument but should compare your proposal with how thing is supposed to work. |
So, again, no disagreement on whether to calculate it yourself, but your wiki, and every embedded wiki, has the user calculate it themselves. See https://wiki.radxa.com/Rock5/hardware/5b/gpio for example This is part of the larger point i'll make a little - you are suggesting an answer that is clearly a really good technical end state. Again, users literally can't tell what unlabeled state means. Ever. That isn't just about your boards. If the gpio line name was a required property, or they could be marked so that gpioinfo could display more than just a blank string (IE had a user-available flag" or something), i think you might have a good argument. But right now you are suggesting that lots of things should change, most of which you do not control, before a user could ever rely on "blank = unavailable" in their projects. That is true even in your boards. As for what to do, of course you should use the current broken state to decide what to do. The goal is not abstract perfection, but to help the users the most. It is a common, but not-great-for-users idea to chase the best possible technical end state. I do it myself sometimes. Nor do I actually disagree on what the technical best end state is. I only disagree that it makes sense to try to get there in one step, and put it on everyone else to follow. You should chase the best-reasonable-user-end-state first, then figure out if you can make a better technical state if you want. So by leaving them blank, you will only make that harder. If you go to the forums, and ask the same question of users, i would bet you would get the same answer. As a result, I can't see any reason, given the current broken state, to use "" rather than "unavailable" (or the GPIO names) to label thing that are not exported. Meanwhile, if we ever get to the point where everything is labeled, it's trivial to later replace the strings to be blank again (or whatever). In any case, do what you want, it's your project. I will not bother you about it further. |
Since we labeled GPIO on the 40-pin only, close this PR. |
This enables gpioinfo and other tools to display the GPIO name for a given line offset/etc.