Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932091Ab0AMJ16 (ORCPT ); Wed, 13 Jan 2010 04:27:58 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932083Ab0AMJ14 (ORCPT ); Wed, 13 Jan 2010 04:27:56 -0500 Received: from mail-qy0-f194.google.com ([209.85.221.194]:39130 "EHLO mail-qy0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932079Ab0AMJ1y (ORCPT ); Wed, 13 Jan 2010 04:27:54 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=Ez9gzhvtRploFAkpNJMS/7GZ9LKtmhuM3Sx7/JBRJvwYfdVMbUMSAX+bS3qQTE23iz ZXzd0sBSUNpgHwexuNkDxnxVXKEbBY63IPRfCuzub7M7YLfzC/KoOlXUAeMb15/5U7A3 8q5IVR9bzYQIP6F6mBrWY42xfM65GZ0APGllA= MIME-Version: 1.0 In-Reply-To: <20100113002939.2d2c489d.akpm@linux-foundation.org> References: <20100112150952.aa224e20.akpm@linux-foundation.org> <20100113002939.2d2c489d.akpm@linux-foundation.org> From: Eric Miao Date: Wed, 13 Jan 2010 17:27:31 +0800 Message-ID: Subject: Re: [PATCH] gpio: introduce gpio_request_one() and friends To: Andrew Morton Cc: David Brownell , linux-kernel Content-Type: multipart/mixed; boundary=00151757461e79fbf8047d0862ad Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 15037 Lines: 337 --00151757461e79fbf8047d0862ad Content-Type: text/plain; charset=UTF-8 On Wed, Jan 13, 2010 at 4:29 PM, Andrew Morton wrote: > On Wed, 13 Jan 2010 16:23:35 +0800 Eric Miao wrote: > >> Attached is the patch against Documentation/gpio.txt > > Thanks. > > I was thinking kerneldoc in the .c file actually - most/all of the > other interface functions in gpiolib.c seem to be done that way. > OK, updated as follows (I've also make this an attached patch in case gmail wraps my line again): commit db30b9c15be3ee3ddcd914aadecfc8815c1a0170 Author: Eric Miao Date: Fri Jan 8 12:16:28 2010 +0800 gpio: introduce gpio_request_one() and friends gpio_request() without initial configuration of the GPIO is normally useless, introduce gpio_request_one() together with GPIOF_ flags for input/output direction and initial output level. gpio_{request,free}_array() for multiple GPIOs. Cc: David Brownell Signed-off-by: Eric Miao diff --git a/Documentation/gpio.txt b/Documentation/gpio.txt index 1866c27..c2c6e9b 100644 --- a/Documentation/gpio.txt +++ b/Documentation/gpio.txt @@ -253,6 +253,70 @@ pin setup (e.g. controlling which pin the GPIO uses, pullup/pulldown). Also note that it's your responsibility to have stopped using a GPIO before you free it. +Considering in most cases GPIOs are actually configured right after they +are claimed, three additional calls are defined: + + /* request a single GPIO, with initial configuration specified by + * 'flags', identical to gpio_request() wrt other arguments and + * return value + */ + int gpio_request_one(unsigned gpio, unsigned long flags, const char *label); + + /* request multiple GPIOs in a single call + */ + int gpio_request_array(struct gpio *array, size_t num); + + /* release multiple GPIOs in a single call + */ + void gpio_free_array(struct gpio *array, size_t num); + +where 'flags' is currently defined to specify the following properties: + + * GPIOF_DIR_IN - to configure direction as input + * GPIOF_DIR_OUT - to configure direction as output + + * GPIOF_INIT_LOW - as output, set initial level to LOW + * GPIOF_INIT_HIGH - as output, set initial level to HIGH + +since GPIOF_INIT_* are only valid when configured as output, so group valid +combinations as: + + * GPIOF_IN - configure as input + * GPIOF_OUT_INIT_LOW - configured as output, initial level LOW + * GPIOF_OUT_INIT_HIGH - configured as output, initial level HIGH + +In the future, these flags can be extended to support more properties such +as open-drain status. + +Further more, to ease the claim/release of multiple GPIOs, 'struct gpio' is +introduced to encapsulate all three fields as: + + struct gpio { + unsigned gpio; + unsigned long flags; + const char *label; + }; + +A typical example of usage: + + static struct gpio leds_gpios[] = { + { 32, GPIOF_OUT_INIT_HIGH, "Power LED" }, /* default to ON */ + { 33, GPIOF_OUT_INIT_LOW, "Green LED" }, /* default to OFF */ + { 34, GPIOF_OUT_INIT_LOW, "Red LED" }, /* default to OFF */ + { 35, GPIOF_OUT_INIT_LOW, "Blue LED" }, /* default to OFF */ + { ... }, + }; + + err = gpio_request_one(31, GPIOF_IN, "Reset Button"); + if (err) + ... + + err = gpio_request_array(leds_gpios, ARRAY_SIZE(leds_gpios)); + if (err) + ... + + gpio_free_array(leds_gpios, ARRAY_SIZE(leds_gpios)); + GPIOs mapped to IRQs -------------------- diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index a25ad28..0a81a1e 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1239,6 +1239,64 @@ void gpio_free(unsigned gpio) } EXPORT_SYMBOL_GPL(gpio_free); +/** + * gpio_request_one - request a single GPIO with initial configuration + * @gpio: the GPIO number + * @flags: GPIO configuration as specified by GPIOF_* + * @label: a literal description string of this GPIO + */ +int gpio_request_one(unsigned gpio, unsigned long flags, const char *label) +{ + int err; + + err = gpio_request(gpio, label); + if (err) + return err; + + if (flags & GPIOF_DIR_IN) + err = gpio_direction_input(gpio); + else + err = gpio_direction_output(gpio, + (flags & GPIOF_INIT_HIGH) ? 1 : 0); + + return err; +} +EXPORT_SYMBOL_GPL(gpio_request_one); + +/** + * gpio_request_array - request multiple GPIOs in a single call + * @array: array of the 'struct gpio' + * @num: how many GPIOs in the array + */ +int gpio_request_array(struct gpio *array, size_t num) +{ + int i, err; + + for (i = 0; i < num; i++, array++) { + err = gpio_request_one(array->gpio, array->flags, array->label); + if (err) + goto err_free; + } + return 0; + +err_free: + while (i--) + gpio_free((--array)->gpio); + return err; +} +EXPORT_SYMBOL_GPL(gpio_request_array); + +/** + * gpio_free_array - release multiple GPIOs in a single call + * @array: array of the 'struct gpio' + * @num: how many GPIOs in the array + */ +void gpio_free_array(struct gpio *array, size_t num) +{ + while (num--) + gpio_free((array++)->gpio); +} +EXPORT_SYMBOL_GPL(gpio_free_array); /** * gpiochip_is_requested - return string iff signal was requested diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index 485eeb6..979c6a5 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h @@ -136,6 +136,32 @@ extern int __gpio_cansleep(unsigned gpio); extern int __gpio_to_irq(unsigned gpio); +#define GPIOF_DIR_OUT (0 << 0) +#define GPIOF_DIR_IN (1 << 0) + +#define GPIOF_INIT_LOW (0 << 1) +#define GPIOF_INIT_HIGH (1 << 1) + +#define GPIOF_IN (GPIOF_DIR_IN) +#define GPIOF_OUT_INIT_LOW (GPIOF_DIR_OUT | GPIOF_INIT_LOW) +#define GPIOF_OUT_INIT_HIGH (GPIOF_DIR_OUT | GPIOF_INIT_HIGH) + +/** + * struct gpio - a structure describing a GPIO with configuration + * @gpio: the GPIO number + * @flags: GPIO configuration as specified by GPIOF_* + * @label: a literal description string of this GPIO + */ +struct gpio { + unsigned gpio; + unsigned long flags; + const char *label; +}; + +extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *label); +extern int gpio_request_array(struct gpio *array, size_t num); +extern void gpio_free_array(struct gpio *array, size_t num); + #ifdef CONFIG_GPIO_SYSFS /* --00151757461e79fbf8047d0862ad Content-Type: text/x-patch; charset=US-ASCII; name="0001-gpio-introduce-gpio_request_one-and-friends.patch" Content-Disposition: attachment; filename="0001-gpio-introduce-gpio_request_one-and-friends.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g4dwqlc90 RnJvbSBkYjMwYjljMTViZTNlZTNkZGNkOTE0YWFkZWNmYzg4MTVjMWEwMTcwIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBFcmljIE1pYW8gPGVyaWMueS5taWFvQGdtYWlsLmNvbT4KRGF0 ZTogRnJpLCA4IEphbiAyMDEwIDEyOjE2OjI4ICswODAwClN1YmplY3Q6IFtQQVRDSF0gZ3Bpbzog aW50cm9kdWNlIGdwaW9fcmVxdWVzdF9vbmUoKSBhbmQgZnJpZW5kcwoKZ3Bpb19yZXF1Z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KHN0cnVjdCBncGlvICphcnJheSwgc2l6ZV90IG51 bSk7CitleHRlcm4gdm9pZCBncGlvX2ZyZWVfYXJyYXkoc3RydWN0IGdwaW8gKmFycmF5LCBzaXpl X3QgbnVtKTsKKwogI2lmZGVmIENPTkZJR19HUElPX1NZU0ZTCiAKIC8qCi0tIAoxLjYuMy4zCgo= --00151757461e79fbf8047d0862ad-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/