Skip to content

Use GPIO directory based on actual device tree path#7

Open
VipSaran wants to merge 3 commits into
romilly:masterfrom
VipSaran:master
Open

Use GPIO directory based on actual device tree path#7
VipSaran wants to merge 3 commits into
romilly:masterfrom
VipSaran:master

Conversation

@VipSaran

@VipSaran VipSaran commented Mar 8, 2015

Copy link
Copy Markdown

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

lurch commented Mar 24, 2015

Copy link
Copy Markdown

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

@olivierrr

Copy link
Copy Markdown

+1

1 similar comment
@catskull

Copy link
Copy Markdown

+1

@VipSaran

Copy link
Copy Markdown
Author

updated the fix

@knocte

knocte commented Oct 19, 2015

Copy link
Copy Markdown

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

@lurch

lurch commented Oct 19, 2015

Copy link
Copy Markdown

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
Copy Markdown

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

@ghost ghost left a comment

Copy link
Copy Markdown

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