瀏覽代碼

Add gpio_request() to asm-generic header

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

Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass 13 年之前
父節點
當前提交
1bbd28d215
共有 1 個文件被更改,包括 9 次插入0 次删除
  1. 9 0
      include/asm-generic/gpio.h

+ 9 - 0
include/asm-generic/gpio.h

@@ -94,4 +94,13 @@ int gpio_get_value(unsigned gpio);
  */
 int gpio_set_value(unsigned gpio, 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);
 #endif	/* _ASM_GENERIC_GPIO_H_ */