]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - include/asm-generic/gpio.h
dm: gpio: Add dm_gpio_lookup_name() to look up a GPIO name
[karo-tx-uboot.git] / include / asm-generic / gpio.h
index cf4b28bdc712ed9ded6e599898880b17a0eba6b9..cce99ccdc431527404f9a2ba989de3805a0bf1e0 100644 (file)
@@ -333,6 +333,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
  *