Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755096Ab0AMIX5 (ORCPT ); Wed, 13 Jan 2010 03:23:57 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755047Ab0AMIX4 (ORCPT ); Wed, 13 Jan 2010 03:23:56 -0500 Received: from mail-qy0-f194.google.com ([209.85.221.194]:42826 "EHLO mail-qy0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752499Ab0AMIX4 (ORCPT ); Wed, 13 Jan 2010 03:23:56 -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=V+ofIMAp9WJixwhDx+dYpJBuEVsCFK29m0oFG5t3GhX+mIzKvmY4sFd36ZDo3w0Npb PhxHUUF+H9ihWpT8bLXgf4VQjGL4e5hUWe3d/okvwgcIibDNGAvMaSrdkE2IBEGaUE7p E06q7vxop+ij4z7mUQgQSC/9PdTHkVX0CGUyw= MIME-Version: 1.0 In-Reply-To: References: <20100112150952.aa224e20.akpm@linux-foundation.org> From: Eric Miao Date: Wed, 13 Jan 2010 16:23:35 +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=00c09f90580dc60c44047d077dd6 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 14050 Lines: 249 --00c09f90580dc60c44047d077dd6 Content-Type: text/plain; charset=UTF-8 > > Global, exported-to-modules interfaces should be documented, IMO. > > > > OK, will do. > Andrew, Attached is the patch against Documentation/gpio.txt (also inlined), which you may either use as an incremental patch, or merge with the last one, or if you want, use the other one attached for a merged version. 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 -------------------- --00c09f90580dc60c44047d077dd6 Content-Type: text/x-patch; charset=US-ASCII; name="Documentation_gpio_txt.diff" Content-Disposition: attachment; filename="Docum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KTsKKwogCiBHUElPcyBtYXBwZWQgdG8gSVJRcwog LS0tLS0tLS0tLS0tLS0tLS0tLS0K --00c09f90580dc60c44047d077dd6 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_g4dugn531 RnJvbSBjNDZkYzE2NWI2ZjhlNzIwYTlmMDQ1NTkxNDBiMzhjMjBlNzUwNTE2IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBFcmljIE1pYW8gPGVyaWMueS5taWFvQGdtYWlsLmNvbT4KRGF0 ZTogRnJpLCA4IEphbiAyMDEwIDEyOjE2OjI4ICswODAwClN1YmplY3Q6IFtQQVRDSF0gZ3Bpbzog aW50cm9kdWNlIGdwaW9fcmVxdWVzdF9vbmUoKSBhbmQgZnJpZW5kcwoKZ3Bpb19yZXF1ZXN0KCkg d2l0aG91dCBpbml0aWFsIGNvbmZpZ3VyYXRpb24gb2YgdGhlIEdQSU8gaXMgbm9ybWFsbHkKdXNl bGVzcywgaW50cm9kdWNlIGdwaW9fcmVxdWVzdF9vbmUoKSB0b2dldGhlciB3aXRoIEdQSU9GXyBm bGFncyBmb3IKaW5wdXQvb3V0cHV0IGRpcmVjdGlvbiBhbmQgaW5pdGlhbCBvdXRwdXQgbGV2ZWwu CgpncGlvX3tyZXF1ZXN0LGZyZWV9X2FycmF5KCkgZm9yIG11bHRpcGxlIEdQSU9zLgoKQ2M6IERh dmlkIEJyb3duZWxsIDxkYnJvd25lbGxAdXNlcnMuc291cmNlZm9yZ2UubmV0PgpTaWduZWQtb2Zm LWJ5OiBFcmljIE1pYW8gPGVyaWMueS5taWFvQGdtYWlsLmNvbT4KLS0tCiBEb2N1bWVudGF0aW9u L2dwaW8udHh0ICAgICB8ICAgNjQgKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysr KysrKysr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AwKQorI2RlZmluZSBHUElPRl9ESVJfSU4JKDEgPDwgMCkKKworI2RlZmlu ZSBHUElPRl9JTklUX0xPVwkoMCA8PCAxKQorI2RlZmluZSBHUElPRl9JTklUX0hJR0gJKDEgPDwg MSkKKworI2RlZmluZSBHUElPRl9JTgkJKEdQSU9GX0RJUl9JTikKKyNkZWZpbmUgR1BJT0ZfT1VU X0lOSVRfTE9XCShHUElPRl9ESVJfT1VUIHwgR1BJT0ZfSU5JVF9MT1cpCisjZGVmaW5lIEdQSU9G X09VVF9JTklUX0hJR0gJKEdQSU9GX0RJUl9PVVQgfCBHUElPRl9JTklUX0hJR0gpCisKK3N0cnVj dCBncGlvIHsKKwl1bnNpZ25lZAlncGlvOworCXVuc2lnbmVkIGxvbmcJZmxhZ3M7CisJY29uc3Qg Y2hhcgkqbGFiZWw7Cit9OworCitleHRlcm4gaW50IGdwaW9fcmVxdWVzdF9vbmUodW5zaWduZWQg Z3BpbywgdW5zaWduZWQgbG9uZyBmbGFncywgY29uc3QgY2hhciAqbGFiZWwpOworZXh0ZXJuIGlu dCBncGlvX3JlcXVlc3RfYXJyYXkoc3RydWN0IGdwaW8gKmFycmF5LCBzaXplX3QgbnVtKTsKK2V4 dGVybiB2b2lkIGdwaW9fZnJlZV9hcnJheShzdHJ1Y3QgZ3BpbyAqYXJyYXksIHNpemVfdCBudW0p OworCiAjaWZkZWYgQ09ORklHX0dQSU9fU1lTRlMKIAogLyoKLS0gCjEuNi4zLjMKCg== --00c09f90580dc60c44047d077dd6-- -- 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/