linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: stigge@antcom.de (Roland Stigge)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/6 v14] gpio: Add a block GPIO API to gpiolib
Date: Sun, 27 Jan 2013 14:58:00 +0100	[thread overview]
Message-ID: <51053268.2000002@antcom.de> (raw)
In-Reply-To: <CAOY=C6ERX=2HdvmtAW-__947_-P8r=Lvp88KzZDQdf4kAuRB5Q@mail.gmail.com>

On 27/01/13 14:19, Stijn Devriendt wrote:
>> +Block GPIO
>> +----------
>> +
>> +The above described interface concentrates on handling single GPIOs.  However,
>> +in applications where it is critical to set several GPIOs at once, this
>> +interface doesn't work well, e.g. bit-banging protocols via grouped GPIO lines.
>> +Consider a GPIO controller that is connected via a slow I2C line. When
>> +switching two or more GPIOs one after another, there can be considerable time
>> +between those events. This is solved by an interface called Block GPIO:
>> +
>> +struct gpio_block *gpio_block_create(unsigned int *gpios, size_t size,
>> +                                    const char *name);
>> +
>> +This creates a new block of GPIOs as a list of GPIO numbers with the specified
>> +size which are accessible via the returned struct gpio_block and the accessor
>> +functions described below. Please note that you need to request the GPIOs
>> +separately via gpio_request(). Similarly, the direction of the used GPIOs need
>> +to be set by the user before using the block.
> 
> Is there anything holding you back from letting gpio_block_create() do
> the request
> for all the pins?

It's analoguous to plain GPIOs: They exist, but are not requested (by
whom?) by default.

> Also, wouldn't it make sense to have a gpio_block_direction_input()
> and _output()
> variant? On the other hand, for things like I2C and SPI emulation,
> some pins will
> naturally be always output (like clock lines) while other could be
> switched between
> in and output (like the i2c data line).

Right. Current implementation emphasizes on switching, not direction or
other convenience functions, which could be added, nevertheless.

Roland

  reply	other threads:[~2013-01-27 13:58 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-22 12:06 [PATCH 0/6 v14] gpio: Add block GPIO Roland Stigge
2013-01-22 12:06 ` [PATCH 1/6 v14] gpio: Add a block GPIO API to gpiolib Roland Stigge
2013-01-27 13:19   ` Stijn Devriendt
2013-01-27 13:58     ` Roland Stigge [this message]
2013-01-28 11:30       ` Stijn Devriendt
2013-01-31 20:56         ` Linus Walleij
2013-01-22 12:06 ` [PATCH 2/6 v14] gpio: Add sysfs support to block GPIO API Roland Stigge
2013-01-22 12:06 ` [PATCH 3/6 v14] gpio: Add userland device interface to block GPIO Roland Stigge
2013-01-23  1:03   ` Jonathan Corbet
2013-01-23 18:47     ` Roland Stigge
2013-01-24  9:13   ` Alexander Stein
2013-01-22 12:06 ` [PATCH 4/6 v14] gpiolib: Fix default attributes for class Roland Stigge
2013-01-22 12:06 ` [PATCH 5/6 v14] gpio: Add device tree support to block GPIO API Roland Stigge
2013-01-27 13:07   ` Stijn Devriendt
2013-01-27 14:29     ` Roland Stigge
2013-01-28 11:39       ` Stijn Devriendt
2013-01-28 12:29         ` Roland Stigge
2013-01-22 12:06 ` [PATCH 6/6 v14] gpio: Add block gpio to several gpio drivers Roland Stigge
2013-01-24 12:02   ` Stijn Devriendt
2013-01-24 12:17     ` Mark Brown
2013-01-24 12:19     ` Roland Stigge
2013-01-27 12:18       ` Stijn Devriendt
2013-01-27 13:48         ` Roland Stigge
2013-01-28 11:27           ` Stijn Devriendt

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=51053268.2000002@antcom.de \
    --to=stigge@antcom.de \
    --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).