From: Stephen Warren <swarren@wwwdotorg.org>
To: Alexandre Courbot <acourbot@nvidia.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Arnd Bergmann <arnd@arndb.de>,
Grant Likely <grant.likely@linaro.org>,
Thierry Reding <thierry.reding@gmail.com>,
gnurou@gmail.com, linux-gpio@vger.kernel.org,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arch@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [RFC 2/5] gpiolib: export descriptor-based GPIO interface
Date: Wed, 04 Sep 2013 13:58:14 -0600 [thread overview]
Message-ID: <522790D6.6080803@wwwdotorg.org> (raw)
In-Reply-To: <1378294169-22661-3-git-send-email-acourbot@nvidia.com>
On 09/04/2013 05:29 AM, Alexandre Courbot wrote:
> This patch exports the gpiod_* family of API functions, a safer
> alternative to the legacy gpio interface. Differences between the gpiod
> and gpio APIs are:
>
> - gpio works with integers, whereas gpiod operates on opaque handlers
> which cannot be forged or used before proper acquisition
> - gpiod get/set functions are aware of the active low state of a GPIO
> - gpio consumers should now include <linux/gpio/consumer.h> to access
> the new interface, whereas chips drivers will use
> <linux/gpio/driver.h>
>
> The legacy gpio API is now built as inline functions on top of gpiod.
>
> diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
> +struct gpio_chip {
> + int (*get_direction)(struct gpio_chip *chip,
> + unsigned offset);
> + int (*direction_input)(struct gpio_chip *chip,
> + unsigned offset);
> + int (*get)(struct gpio_chip *chip,
> + unsigned offset);
> + int (*direction_output)(struct gpio_chip *chip,
> + unsigned offset, int value);
> + int (*set_debounce)(struct gpio_chip *chip,
> + unsigned offset,
> + unsigned debounce);
> +
> + void (*set)(struct gpio_chip *chip,
> + unsigned offset, int value);
> +
Minor nit: It might be nice to sort/group these entries more cohesively,
i.e. get_direction, direction_input, direction_output, get, set,
set_debounce?
next prev parent reply other threads:[~2013-09-04 19:58 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-04 11:29 [RFC 0/5] New descriptor-based GPIO interface Alexandre Courbot
2013-09-04 11:29 ` [RFC 1/5] gpiolib: factorize gpiod_get/set functions Alexandre Courbot
2013-09-04 11:29 ` Alexandre Courbot
2013-09-20 8:36 ` Linus Walleij
2013-09-21 12:39 ` Alexandre Courbot
2013-09-21 12:39 ` Alexandre Courbot
2013-09-04 11:29 ` [RFC 2/5] gpiolib: export descriptor-based GPIO interface Alexandre Courbot
2013-09-04 11:29 ` Alexandre Courbot
2013-09-04 19:58 ` Stephen Warren [this message]
2013-09-04 19:58 ` Stephen Warren
2013-09-05 3:45 ` Alexandre Courbot
2013-09-04 11:29 ` [RFC 3/5] gpiolib: port of_ functions to use gpiod Alexandre Courbot
2013-09-04 11:29 ` Alexandre Courbot
2013-09-04 11:29 ` [RFC 4/5] gpiolib: add gpiod_get() and gpiod_put() functions Alexandre Courbot
2013-09-04 11:29 ` Alexandre Courbot
2013-09-04 19:56 ` Stephen Warren
2013-09-04 19:56 ` Stephen Warren
2013-09-05 3:44 ` Alexandre Courbot
2013-09-05 3:44 ` Alexandre Courbot
2013-09-11 13:57 ` Thierry Reding
[not found] ` <52279082.5010105-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-09-20 18:40 ` Linus Walleij
2013-09-20 18:40 ` Linus Walleij
[not found] ` <CACRpkdY70r8mL8PSDmexr+_0Ddi-Y8x0RaDF-WWucZM9V8n=yw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-23 9:31 ` Mika Westerberg
2013-09-23 9:31 ` Mika Westerberg
2013-09-04 11:29 ` [RFC 5/5] gpiolib: update documentation Alexandre Courbot
2013-09-04 11:29 ` Alexandre Courbot
2013-09-20 17:59 ` Linus Walleij
2013-09-20 17:59 ` Linus Walleij
2013-09-20 8:28 ` [RFC 0/5] New descriptor-based GPIO interface Linus Walleij
2013-09-20 8:28 ` Linus Walleij
2013-09-20 18:06 ` Linus Walleij
2013-09-20 18:06 ` Linus Walleij
2013-09-20 19:32 ` Thierry Reding
2013-09-20 19:32 ` Thierry Reding
2013-09-20 21:23 ` Linus Walleij
[not found] ` <CACRpkdbFhORYnAUf+BMXtL1LezL7gPJ6gKQnqwvKZjqqCt3A4Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-21 12:32 ` Alexandre Courbot
2013-09-21 12:32 ` Alexandre Courbot
[not found] ` <CACRpkdYjkDf7c9VxfDTHtFx_upWWRAK8vpXTkrkrRsMjErq1dQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-23 10:21 ` Mika Westerberg
2013-09-23 10:21 ` Mika Westerberg
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=522790D6.6080803@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--cc=acourbot@nvidia.com \
--cc=arnd@arndb.de \
--cc=devicetree@vger.kernel.org \
--cc=gnurou@gmail.com \
--cc=grant.likely@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=thierry.reding@gmail.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 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).