From: Andres Salomon <dilinger@collabora.co.uk>
To: Ben Gardner <gardner.ben@gmail.com>
Cc: linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
David Brownell <dbrownell@users.sourceforge.net>,
Jani Nikula <ext-jani.1.nikula@nokia.com>
Subject: Re: [PATCH 1/3] gpiolib: add gpio_set_direction()
Date: Fri, 26 Feb 2010 18:39:44 -0500 [thread overview]
Message-ID: <20100226183944.56bfee13@droptest.queued.net> (raw)
In-Reply-To: <14e456b7d269efd860bb36c312de2bc4ad504dca.1267225701.git.gardner.ben@gmail.com>
On Fri, 26 Feb 2010 17:26:24 -0600
Ben Gardner <gardner.ben@gmail.com> wrote:
> Combine gpio_direction_input() and gpio_direction_output() into
> gpio_set_direction().
> Add 'none' and 'inout' directions to the sysfs interface.
>
> Signed-off-by: Ben Gardner <gardner.ben@gmail.com>
> CC: Andres Salomon <dilinger@collabora.co.uk>
> CC: Andrew Morton <akpm@linux-foundation.org>
> CC: David Brownell <dbrownell@users.sourceforge.net>
> CC: Jani Nikula <ext-jani.1.nikula@nokia.com>
> ---
> drivers/gpio/gpiolib.c | 123 ++++++++++++++++++++++----------------------
> include/asm-generic/gpio.h | 6 ++
> include/linux/gpio.h | 5 ++
> 3 files changed, 73 insertions(+), 61 deletions(-)
>
[...]
> diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
> index 485eeb6..17c7642 100644
> --- a/include/asm-generic/gpio.h
> +++ b/include/asm-generic/gpio.h
> @@ -41,6 +41,8 @@ struct module;
> * enabling module power and clock; may sleep
> * @free: optional hook for chip-specific deactivation, such as
> * disabling module power and clock; may sleep
> + * @set_direction: configures signal "offset" as "direction" (0-3, bit0=input,
> + * bit1=output) or returns error
How about something like the following for set_direction, so we're not
comparing magic bits?
/* gpio direction flags */
#define GPIO_DIR_NONE 0
#define GPIO_DIR_INPUT (1 << 0)
#define GPIO_DIR_OUTPUT (1 << 1)
next prev parent reply other threads:[~2010-02-26 23:40 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-26 23:26 [PATCH 0/3] gpio: add gpio_set_direction Ben Gardner
2010-02-26 23:26 ` [PATCH 1/3] gpiolib: add gpio_set_direction() Ben Gardner
2010-02-26 23:39 ` Andres Salomon [this message]
2010-02-27 5:11 ` Ben Gardner
2010-02-27 7:02 ` David Brownell
2010-02-27 10:26 ` Mark Brown
2010-02-27 16:24 ` David Brownell
2010-02-27 17:20 ` Mark Brown
2010-02-27 17:51 ` David Brownell
2010-03-01 10:35 ` Mark Brown
2010-02-27 18:36 ` Ben Gardner
2010-02-27 19:23 ` David Brownell
2010-02-27 18:36 ` [PATCH] cs5535-gpio: change input/output enable to match gpiolib expectations Ben Gardner
2010-02-27 18:40 ` Ben Gardner
2010-02-27 18:56 ` [PATCH v2] " Ben Gardner
2010-02-27 19:18 ` David Brownell
2010-02-26 23:26 ` [PATCH 2/3] cs5535-gpio: Use set_direction Ben Gardner
2010-02-27 7:04 ` David Brownell
2010-02-27 18:18 ` Ben Gardner
2010-02-26 23:26 ` [PATCH 3/3] OLPC: ALSA: fix cs5535audio's MIC GPIO to enable input Ben Gardner
2010-02-27 7:14 ` David Brownell
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=20100226183944.56bfee13@droptest.queued.net \
--to=dilinger@collabora.co.uk \
--cc=akpm@linux-foundation.org \
--cc=dbrownell@users.sourceforge.net \
--cc=ext-jani.1.nikula@nokia.com \
--cc=gardner.ben@gmail.com \
--cc=linux-kernel@vger.kernel.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