summaryrefslogtreecommitdiffstats
path: root/include/gpio.h
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2019-11-22 09:41:24 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2019-11-27 12:07:07 +0100
commit17a517c0fcf21cbd1882108c18fa845930927563 (patch)
treee51784330e1f1318709eba4a573493c2cef1c8d5 /include/gpio.h
parent6441dfa8307a564f797b868a74205fe9c2f42eb0 (diff)
downloadbarebox-17a517c0fcf21cbd1882108c18fa845930927563.tar.gz
barebox-17a517c0fcf21cbd1882108c18fa845930927563.tar.xz
gpio: Introduce GPIO names
This introduces GPIO names. So far we only have labels which are given by the requester. In contrast names are given by the provider and do not change depending on whoever requests a GPIO. The gpio commands now also accept to reference a GPIO by name. The printing of the gpioinfo command is adjusted to nicely print both the label and the name. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/gpio.h')
-rw-r--r--include/gpio.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/gpio.h b/include/gpio.h
index 4d5f2c25c7..0c0c0337e0 100644
--- a/include/gpio.h
+++ b/include/gpio.h
@@ -114,6 +114,11 @@ static inline int gpio_request(unsigned gpio, const char *label)
return 0;
}
+static inline int gpio_find_by_name(const char *name)
+{
+ return -ENOSYS;
+}
+
static inline int gpio_find_by_label(const char *label)
{
return -ENOSYS;
@@ -141,6 +146,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_name(const char *name);
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);