diff options
author | Andrey Smirnov <andrew.smirnov@gmail.com> | 2018-10-26 18:31:53 -0700 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-10-29 09:10:38 +0100 |
commit | 183502af192962b0187d6f2ddc6e6a68b38869d0 (patch) | |
tree | 8e11ea7b5c47d0767d83cbec53d9cdcaf25ae295 /include/gpio.h | |
parent | 05a4b7d4b1b56af927d703e3667e1c7868bab1d4 (diff) | |
download | barebox-183502af192962b0187d6f2ddc6e6a68b38869d0.tar.gz barebox-183502af192962b0187d6f2ddc6e6a68b38869d0.tar.xz |
gpiolib: Introduce gpio_find_by_label()
Introduce gpio_find_by_label() in order to allow manipulating GPIOs by
the labels assigned to them via DT or board/driver code.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/gpio.h')
-rw-r--r-- | include/gpio.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/gpio.h b/include/gpio.h index e42fa23383..38d6ba2df9 100644 --- a/include/gpio.h +++ b/include/gpio.h @@ -92,6 +92,11 @@ static inline int gpio_request(unsigned gpio, const char *label) return 0; } +static inline int gpio_find_by_label(const char *label) +{ + return -ENOSYS; +} + static inline void gpio_free(unsigned gpio) { } @@ -114,6 +119,7 @@ static inline void gpio_free_array(const struct gpio *array, size_t num) } #else int gpio_request(unsigned gpio, const char *label); +int gpio_find_by_label(const char *label); void gpio_free(unsigned gpio); int gpio_request_one(unsigned gpio, unsigned long flags, const char *label); int gpio_request_array(const struct gpio *array, size_t num); |