summaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2019-07-12 07:10:19 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-07-12 07:10:19 +0200
commitf9dfe479ebacbb3efacef4525682546713b11597 (patch)
tree64b26ae51c86b9b1419d8a62baf5d2f5948f3f51 /drivers/gpio
parentac5e1f63aafb73a6ea2356822029ef391b6234d2 (diff)
parent9f30aa3f143eda22ba3cf9e36c05213239a2fe83 (diff)
downloadbarebox-f9dfe479ebacbb3efacef4525682546713b11597.tar.gz
barebox-f9dfe479ebacbb3efacef4525682546713b11597.tar.xz
Merge branch 'for-next/stm32'
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpiolib.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 4c7aee4a0b..f96009896a 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -475,6 +475,13 @@ int gpio_get_num(struct device_d *dev, int gpio)
return -EPROBE_DEFER;
}
+struct gpio_chip *gpio_get_chip(int gpio)
+{
+ struct gpio_info *gi = gpio_to_desc(gpio);
+
+ return gi ? gi->chip : NULL;
+}
+
#ifdef CONFIG_CMD_GPIO
static int do_gpiolib(int argc, char *argv[])
{