GPIO offsets used by userspace

Andrew Jeffery andrew at aj.id.au
Wed Feb 1 13:20:49 AEDT 2017


On Wed, 2017-02-01 at 09:55 +1030, Joel Stanley wrote:
> > I mentioned this on GitHub, but in theory we should have at least one
> > /sys/class/gpio/gpiochipN directory, where N is the offset for GPIOs
> > provided by that GPIO device.
> >
> > On a BMC not attached to GPIO expanders this directory name could be
> > parsed by the Python currently in use. Not foolproof, but it could be
> > a working stopgap.
> 
> You're right, we could find this one. This would break on Witherspoon
> though which will soon gain a driver for a GPIO expander.
> 
> We could write some python to iterate through the gpiochipN
> directories, and match against the label:
> 
> root at zaius5:~# cat /sys/class/gpio/gpiochip320/label
> 1e780000.gpio
> 
> This would be a stopgap until we could get something saner, like sysfs
> files named after the net or function.

If we're going to change things so significantly we should move away
from using sysfs given it's deprecated, even if the alternative isn't
great.

Andrew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20170201/1622fa44/attachment.sig>


More information about the openbmc mailing list