summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-06-23 15:38:41 -0600
committerSimon Glass <sjg@chromium.org>2015-07-21 17:39:23 -0600
commitefa677fb481aec0888d3d37803643219d4ea57d1 (patch)
tree1b84001c3eab9eff32b5c3a5d242eab08ff84493 /include
parent32ec159844d7b76f199b07412dd054ad842bdd58 (diff)
downloadtalos-obmc-uboot-efa677fb481aec0888d3d37803643219d4ea57d1.tar.gz
talos-obmc-uboot-efa677fb481aec0888d3d37803643219d4ea57d1.zip
dm: gpio: Add dm_gpio_request() to manually request a GPIO
This function can be used for testing to manually request a GPIO for use, without resorting to the legacy GPIO API. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/gpio.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index b1cf95c687..0af599f86d 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -434,6 +434,18 @@ int gpio_request_list_by_name(struct udevice *dev, const char *list_name,
int flags);
/**
+ * dm_gpio_request() - manually request a GPIO
+ *
+ * Note: This function should only be used for testing / debugging. Instead.
+ * use gpio_request_by_name() to pull GPIOs from the device tree.
+ *
+ * @desc: GPIO description of GPIO to request (see dm_gpio_lookup_name())
+ * @label: Label to attach to the GPIO while claimed
+ * @return 0 if OK, -ve on error
+ */
+int dm_gpio_request(struct gpio_desc *desc, const char *label);
+
+/**
* gpio_get_list_count() - Returns the number of GPIOs in a list
*
* Counts the GPIOs in a list. See gpio_request_by_name() for additional
OpenPOWER on IntegriCloud