summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-06-23 15:38:40 -0600
committerSimon Glass <sjg@chromium.org>2015-07-21 17:39:23 -0600
commit32ec159844d7b76f199b07412dd054ad842bdd58 (patch)
tree3765e136371dcbbd00e1808c92914fec72a90bd0 /include
parentce22c5bbeed179161647f2bc707751761e6fe4bf (diff)
downloadu-boot-imx-32ec159844d7b76f199b07412dd054ad842bdd58.zip
u-boot-imx-32ec159844d7b76f199b07412dd054ad842bdd58.tar.gz
u-boot-imx-32ec159844d7b76f199b07412dd054ad842bdd58.tar.bz2
dm: gpio: Add dm_gpio_lookup_name() to look up a GPIO name
Provide a driver-model function to look up a GPIO name. Make the standard function use it. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/gpio.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index de91e57..b1cf95c 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -322,6 +322,19 @@ struct gpio_dev_priv {
const char *gpio_get_bank_info(struct udevice *dev, int *offset_count);
/**
+ * dm_gpio_lookup_name() - Look up a named GPIO and return its description
+ *
+ * The name of a GPIO is typically its bank name followed by a number from 0.
+ * For example A0 is the first GPIO in bank A. Each bank is a separate driver
+ * model device.
+ *
+ * @name: Name to look up
+ * @desc: Returns description, on success
+ * @return 0 if OK, -ve on error
+ */
+int dm_gpio_lookup_name(const char *name, struct gpio_desc *desc);
+
+/**
* gpio_lookup_name - Look up a GPIO name and return its details
*
* This is used to convert a named GPIO into a device, offset and GPIO