[U-Boot] [PATCH v2 03/17] Add gpio_request() to asm-generic header

Simon Glass sjg at chromium.org
Sat Dec 3 03:11:26 CET 2011


This function should also be part of the GPIO API, so add it.

Signed-off-by: Simon Glass <sjg at chromium.org>
---
Changes in v2:
- New patch to add gpio_request() to asm-generic header

 include/asm-generic/gpio.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index a1ebb28..c1d697f 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -72,3 +72,13 @@ int gpio_get_value(int gp);
  * @return 0 if ok, -1 on error
  */
 int gpio_set_value(int gp, int value);
+
+/**
+ * Request a gpio. This should be called before any of the other functions
+ * are used on this gpio.
+ *
+ * @param gp	GPIO number
+ * @param label	User label for this GPIO
+ * @return 0 if ok, -1 on error
+ */
+int gpio_request(unsigned gpio, const char *label);
-- 
1.7.3.1



More information about the U-Boot mailing list