X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=include%2Fasm-generic%2Fgpio.h;h=0af599f86df5bee53efa1745a833d386df6665a6;hb=8a36287a019f5d7532a8a1a7da6aa96e490dbb8a;hp=de91e57efcd672a4e61e06434a6d0c042a3c0b07;hpb=d9a607f2bd4315c9e370aa358ea9168d615a48fc;p=oweals%2Fu-boot.git diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index de91e57efc..0af599f86d 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h @@ -321,6 +321,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 * @@ -420,6 +433,18 @@ int gpio_request_list_by_name(struct udevice *dev, const char *list_name, struct gpio_desc *desc_list, int max_count, 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 *