From: Andrew Jeffery <andrew@aj.id.au>
To: Joel Stanley <joel@jms.id.au>, Xo Wang <xow@google.com>
Cc: OpenBMC <openbmc@lists.ozlabs.org>
Subject: Re: GPIO offsets used by userspace
Date: Wed, 01 Feb 2017 12:50:49 +1030 [thread overview]
Message-ID: <1485915649.4137.37.camel@aj.id.au> (raw)
In-Reply-To: <CACPK8XeZeBhTMy4rtdXULuKbGYjYWtusaAfCoQuWx1qZoQMdEw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1024 bytes --]
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@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
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
next prev parent reply other threads:[~2017-02-01 2:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-30 1:34 GPIO offsets used by userspace Andrew Jeffery
2017-01-31 0:25 ` Joel Stanley
2017-01-31 0:50 ` Hergert, Nolan
2017-01-31 1:12 ` Andrew Jeffery
2017-01-31 1:23 ` Hergert, Nolan
2017-01-31 18:06 ` Patrick Williams
2017-01-31 1:15 ` Andrew Jeffery
2017-01-31 22:15 ` Xo Wang
2017-01-31 23:25 ` Joel Stanley
2017-02-01 1:26 ` Xo Wang
2017-02-01 2:20 ` Andrew Jeffery [this message]
2017-02-07 1:41 ` Andrew Jeffery
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1485915649.4137.37.camel@aj.id.au \
--to=andrew@aj.id.au \
--cc=joel@jms.id.au \
--cc=openbmc@lists.ozlabs.org \
--cc=xow@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.