Lines Matching +full:dev +full:- +full:a +full:- +full:active +full:- +full:pins
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
40 #include <dev/ofw/ofw_bus_subr.h>
51 &((struct ofw_gpiobus_devinfo *)device_get_ivars(d))->opd_dinfo
56 #define GPIOBUS_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx)
57 #define GPIOBUS_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx)
58 #define GPIOBUS_LOCK_INIT(_sc) mtx_init(&_sc->sc_mtx, \
59 device_get_nameunit(_sc->sc_dev), "gpiobus", MTX_DEF)
60 #define GPIOBUS_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx)
61 #define GPIOBUS_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED)
62 #define GPIOBUS_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED)
67 /* Use default interrupt mode - for gpio_alloc_intr_resource */
92 int sc_npins; /* total pins on bus */
98 device_t dev; /* gpio device */ member
107 uint32_t npins; /* pins total */
108 uint32_t *pins; /* pins map */ member
120 GPIOBUS_ACCESSOR(pins, PINS, const uint32_t *)
131 gpio_map_gpios(device_t bus, phandle_t dev, phandle_t gparent, int gcells, in gpio_map_gpios() argument
134 return (GPIO_MAP_GPIOS(bus, dev, gparent, gcells, gpios, pin, flags)); in gpio_map_gpios()
142 /* Acquire a pin by parsing FDT data. */
153 /* Acquire a pin by bus and pin number. */
156 /* Acquire a pin by child and index (used by direct children of gpiobus). */
159 /* Acquire a pin from an existing gpio_pin_t. */
161 /* Release a pin acquired via any gpio_pin_get_xxx() function. */
164 /* Work with gpio pins acquired using the functions above. */
166 int gpio_pin_is_active(gpio_pin_t pin, bool *active);
167 int gpio_pin_set_active(gpio_pin_t pin, bool active);