Add a convenience function to get a gpio pin's capabilties.
This commit is contained in:
parent
a8f815c9b3
commit
d2d471b50a
@ -123,6 +123,7 @@ int gpio_pin_get_by_ofw_idx(device_t consumer, phandle_t node,
|
||||
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);
|
||||
|
@ -154,6 +154,15 @@ gpio_pin_release(gpio_pin_t gpio)
|
||||
free(gpio, M_DEVBUF);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user