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

Use GPIO directory based on actual device tree path #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

VipSaran
Copy link

@VipSaran VipSaran commented Mar 8, 2015

By testing the device tree directory we can detrermine whether to use the "old" /sys/devices/virtual/gpio/gpio%u/%s path or to use the one used after update to kernel 3.18.x: /sys/class/gpio/gpio%u/%s, so both configurations are supported.

@lurch
Copy link

lurch commented Mar 24, 2015

I believe this is unnecessary as #6 already contains the fix for this problem.

@olivierrr
Copy link

+1

1 similar comment
@catskull
Copy link

+1

@VipSaran
Copy link
Author

updated the fix

@knocte
Copy link

knocte commented Oct 19, 2015

@lurch, that fix is worse because it only uses one path, this one checks both.

@lurch
Copy link

lurch commented Oct 19, 2015

Nope, #6 is the better fix, as the same path works on all versions of Raspberry Pi, and is in fact the "correct" path to use.
The fact that gpio-admin was ever looking in /sys/devices/virtual/gpio/ in the first place could be considered a bug, as the 'public GPIO interface' is under /sys/class/gpio/ (see e.g. https://www.kernel.org/doc/Documentation/gpio/sysfs.txt), and is what gpio-admin should have been using all along. There was a big discussion about this quite a while ago on the Raspberry Pi forums.

@abuisman
Copy link

@VipSaran thanks for your work. Your solution fixes the issues I had with master and #6 .

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

6 participants