diff options
| author | Tom Rini <[email protected]> | 2022-04-10 11:19:14 -0400 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2022-04-10 11:19:14 -0400 |
| commit | 22b7d140fa17a15e85b87cd7258fa4ff190a11a3 (patch) | |
| tree | c8eb4bb3e20292dc879416ff5b9a5108b8730d04 /include | |
| parent | d46e86d25c2a504b3e2e4ab17d70b2f0be440f34 (diff) | |
| parent | c170fe0a77738df1344a805acfe53133e5d15e43 (diff) | |
Merge branch '2022-04-08-gpio-updates'
- Add PCA957X GPIO support, enable GPIO hogging in SPL, add
gpio_request_by_line_name() for later use and add some pytests for
'gpio'
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-generic/gpio.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index adc19e9765d..81f63f06f15 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h @@ -579,6 +579,25 @@ int gpio_claim_vector(const int *gpio_num_array, const char *fmt); int gpio_request_by_name(struct udevice *dev, const char *list_name, int index, struct gpio_desc *desc, int flags); +/* gpio_request_by_line_name - Locate and request a GPIO by line name + * + * Request a GPIO using the offset of the provided line name in the + * gpio-line-names property found in the OF node of the GPIO udevice. + * + * This allows boards to implement common behaviours using GPIOs while not + * requiring specific GPIO offsets be used. + * + * @dev: An instance of a GPIO controller udevice + * @line_name: The name of the GPIO (e.g. "bmc-secure-boot") + * @desc: A GPIO descriptor that is populated with the requested GPIO + * upon return + * @flags: The GPIO settings apply to the request + * @return 0 if the named line was found and requested successfully, or a + * negative error code if the GPIO cannot be found or the request failed. + */ +int gpio_request_by_line_name(struct udevice *dev, const char *line_name, + struct gpio_desc *desc, int flags); + /** * gpio_request_list_by_name() - Request a list of GPIOs * |
