[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100226183944.56bfee13@droptest.queued.net>
Date: Fri, 26 Feb 2010 18:39:44 -0500
From: Andres Salomon <dilinger@...labora.co.uk>
To: Ben Gardner <gardner.ben@...il.com>
Cc: linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
David Brownell <dbrownell@...rs.sourceforge.net>,
Jani Nikula <ext-jani.1.nikula@...ia.com>
Subject: Re: [PATCH 1/3] gpiolib: add gpio_set_direction()
On Fri, 26 Feb 2010 17:26:24 -0600
Ben Gardner <gardner.ben@...il.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@...il.com>
> CC: Andres Salomon <dilinger@...labora.co.uk>
> CC: Andrew Morton <akpm@...ux-foundation.org>
> CC: David Brownell <dbrownell@...rs.sourceforge.net>
> CC: Jani Nikula <ext-jani.1.nikula@...ia.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)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists