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

Simon Glass sjg at chromium.org
Wed Dec 7 02:24:02 CET 2011


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

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 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