linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: broonie@opensource.wolfsonmicro.com (Mark Brown)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RESEND 1/5 v6] gpio: Add a block GPIO API to gpiolib
Date: Wed, 31 Oct 2012 19:30:34 +0000	[thread overview]
Message-ID: <20121031193033.GA4164@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <CACxGe6vgryMPygc8SKFLKqP8Wq=pcGiJe_dPCiDC-evzf32UMA@mail.gmail.com>

On Wed, Oct 31, 2012 at 04:00:17PM +0100, Grant Likely wrote:

> For the API, I don't think it is a good idea at all to try and
> abstract away gpios on multiple controllers. I understand that it
> makes life a lot easier for userspace to abstract those details away,
> but the problem is that it hides very important information about how
> the system is actually constructed that is important to actually get
> things to work. For example, say you have a gpio-connected device with
> the constraint that GPIOA must change either before or at the same
> time as GPIOB, but never after. If those GPIOs are on separate
> controllers, then the order is completely undefined, and the user has
> no way to control that other than to fall back to manipulating GPIOs
> one at a time again (and losing all the performance benefits). Either
> controller affinity needs to be explicit in the API, or the API needs
> to be constraint oriented (ie. a stream of commands and individual
> commands can be coalesced if they meet the constraints**). Also, the
> API requires remapping the GPIO numbers which forces the code to be a
> lot more complex than it needs to be.

It feels like I'm missing something here but can we not simply say that
if the user cares about the ordering of the signal changes within an
update then they should be doing two separate updates?  Most of the
cases I'm aware of do things as an update with a strobe or clock that
latches the values.

The big advantage of grouping things together is that it means that we
centralise the fallback code.

> I would rather see new attribute(s) added to the gpiochip's directory
> to allow modifying all the pins on a given controller. It's
> considerably less complex, and I'm a lot happier about extending the
> sysfs ABI in that way than committing to the remapping block approach.

When I've looked at this stuff I've only looked at and thought about in
kernel users.  The gpiolib sysfs ABI is already fun enough :)

  parent reply	other threads:[~2012-10-31 19:30 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-28 20:46 [PATCH RESEND 0/5 v6] gpio: Add block GPIO Roland Stigge
2012-10-28 20:46 ` [PATCH RESEND 1/5 v6] gpio: Add a block GPIO API to gpiolib Roland Stigge
2012-10-31 14:06   ` Linus Walleij
2012-10-31 17:47     ` Roland Stigge
2012-10-31 15:00   ` Grant Likely
2012-10-31 17:19     ` Roland Stigge
2012-10-31 18:59       ` Grant Likely
2012-11-01 14:44         ` Jean-Christophe PLAGNIOL-VILLARD
2012-11-02  9:22         ` Roland Stigge
2012-10-31 19:30     ` Mark Brown [this message]
2012-11-01 15:14       ` Grant Likely
2012-10-28 20:46 ` [PATCH RESEND 2/5 v6] gpio: Add sysfs support to block GPIO API Roland Stigge
2012-10-28 20:46 ` [PATCH RESEND 3/5 v6] gpiolib: Fix default attributes for class Roland Stigge
2012-10-31 15:04   ` Grant Likely
2012-10-28 20:46 ` [PATCH RESEND 4/5 v6] gpio: Add device tree support to block GPIO API Roland Stigge
2012-10-31 15:05   ` Grant Likely
2012-10-28 20:46 ` [PATCH RESEND 5/5 v6] gpio: Add block gpio to several gpio drivers Roland Stigge

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=20121031193033.GA4164@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).