From: Simon Glass Date: Tue, 6 Dec 2011 17:24:02 -0800 Subject: [U-Boot] [PATCH v3 03/16] Add gpio_request() to asm-generic header In-Reply-To: <1323221055-20113-1-git-send-email-sjg@chromium.org> References: <1323221055-20113-1-git-send-email-sjg@chromium.org> Message-ID: <1323221055-20113-4-git-send-email-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de This function should also be part of the GPIO API, so add it. Signed-off-by: Simon Glass --- 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