aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/gpio/ofw_gpiobus.c
diff options
context:
space:
mode:
authorIan Lepore <ian@FreeBSD.org>2016-05-26 22:35:52 +0000
committerIan Lepore <ian@FreeBSD.org>2016-05-26 22:35:52 +0000
commit5030d499e7877a362c5d70bee530d99cc5b7c359 (patch)
tree694fd5d8a1071919528dfc53671085f0a1ead465 /sys/dev/gpio/ofw_gpiobus.c
parente3f2d7af0e7e35d142992a201b3320df3cecf577 (diff)
downloadsrc-5030d499e7877a362c5d70bee530d99cc5b7c359.tar.gz
src-5030d499e7877a362c5d70bee530d99cc5b7c359.zip
Add a convenience function to get a gpio pin's capabilties.
Notes
Notes: svn path=/head/; revision=300787
Diffstat (limited to 'sys/dev/gpio/ofw_gpiobus.c')
-rw-r--r--sys/dev/gpio/ofw_gpiobus.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/dev/gpio/ofw_gpiobus.c b/sys/dev/gpio/ofw_gpiobus.c
index c1495a98ae8f..96775dc0eb00 100644
--- a/sys/dev/gpio/ofw_gpiobus.c
+++ b/sys/dev/gpio/ofw_gpiobus.c
@@ -155,6 +155,15 @@ gpio_pin_release(gpio_pin_t gpio)
}
int
+gpio_pin_getcaps(gpio_pin_t pin, uint32_t *caps)
+{
+
+ KASSERT(pin != NULL, ("GPIO pin is NULL."));
+ KASSERT(pin->dev != NULL, ("GPIO pin device is NULL."));
+ return (GPIO_PIN_GETCAPS(pin->dev, pin->pin, caps));
+}
+
+int
gpio_pin_is_active(gpio_pin_t pin, bool *active)
{
int rv;