X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=include%2Fasm-generic%2Fgpio.h;h=519bb0be27acbfb3b0fb9d580bd5f72a406b5e7f;hb=b14d547245bf47d861b5a9cc5327d98b89e5d0af;hp=3b96b8209a10b09d2cdcdf1f559c5fa2787831d7;hpb=6a608f20b987122a658e26978d76d2753654f5f2;p=u-boot diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index 3b96b8209a..519bb0be27 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h @@ -115,7 +115,7 @@ struct gpio_desc { unsigned long flags; #define GPIOD_REQUESTED (1 << 0) /* Requested/claimed */ #define GPIOD_IS_OUT (1 << 1) /* GPIO is an output */ -#define GPIOD_IS_IN (1 << 2) /* GPIO is an output */ +#define GPIOD_IS_IN (1 << 2) /* GPIO is an input */ #define GPIOD_ACTIVE_LOW (1 << 3) /* value has active low */ #define GPIOD_IS_OUT_ACTIVE (1 << 4) /* set output active */ @@ -336,15 +336,24 @@ int gpio_lookup_name(const char *name, struct udevice **devp, unsigned int *offsetp, unsigned int *gpiop); /** - * get_gpios() - Turn the values of a list of GPIOs into an integer + * gpio_get_values_as_int() - Turn the values of a list of GPIOs into an int * * This puts the value of the first GPIO into bit 0, the second into bit 1, * etc. then returns the resulting integer. * * @gpio_list: List of GPIOs to collect - * @return resulting integer value + * @return resulting integer value, or -ve on error */ -unsigned gpio_get_values_as_int(const int *gpio_list); +int gpio_get_values_as_int(const int *gpio_list); + +/** + * gpio_claim_vector() - claim a number of GPIOs for input + * + * @gpio_num_array: array of gpios to claim, terminated by -1 + * @fmt: format string for GPIO names, e.g. "board_id%d" + * @return 0 if OK, -ve on error + */ +int gpio_claim_vector(const int *gpio_num_array, const char *fmt); /** * gpio_request_by_name() - Locate and request a GPIO by name