Date: Thu, 26 May 2016 22:35:52 +0000 (UTC) From: Ian Lepore <ian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300787 - head/sys/dev/gpio Message-ID: <201605262235.u4QMZq7r054559@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ian Date: Thu May 26 22:35:52 2016 New Revision: 300787 URL: https://svnweb.freebsd.org/changeset/base/300787 Log: Add a convenience function to get a gpio pin's capabilties. Modified: head/sys/dev/gpio/gpiobusvar.h head/sys/dev/gpio/ofw_gpiobus.c Modified: head/sys/dev/gpio/gpiobusvar.h ============================================================================== --- head/sys/dev/gpio/gpiobusvar.h Thu May 26 22:34:25 2016 (r300786) +++ head/sys/dev/gpio/gpiobusvar.h Thu May 26 22:35:52 2016 (r300787) @@ -123,6 +123,7 @@ int gpio_pin_get_by_ofw_idx(device_t con int gpio_pin_get_by_ofw_property(device_t consumer, phandle_t node, char *name, gpio_pin_t *gpio); void gpio_pin_release(gpio_pin_t gpio); +int gpio_pin_getcaps(gpio_pin_t pin, uint32_t *caps); int gpio_pin_is_active(gpio_pin_t pin, bool *active); int gpio_pin_set_active(gpio_pin_t pin, bool active); int gpio_pin_setflags(gpio_pin_t pin, uint32_t flags); Modified: head/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- head/sys/dev/gpio/ofw_gpiobus.c Thu May 26 22:34:25 2016 (r300786) +++ head/sys/dev/gpio/ofw_gpiobus.c Thu May 26 22:35:52 2016 (r300787) @@ -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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605262235.u4QMZq7r054559>