Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/gpio/gpiobusvar.h
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | #define GPIOBUS_LOCK_INIT(_sc) mtx_init(&_sc->sc_mtx, \ | ||||
device_get_nameunit(_sc->sc_dev), "gpiobus", MTX_DEF) | device_get_nameunit(_sc->sc_dev), "gpiobus", MTX_DEF) | ||||
#define GPIOBUS_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx) | #define GPIOBUS_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx) | ||||
#define GPIOBUS_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED) | #define GPIOBUS_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED) | ||||
#define GPIOBUS_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED) | #define GPIOBUS_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED) | ||||
#define GPIOBUS_WAIT 1 | #define GPIOBUS_WAIT 1 | ||||
#define GPIOBUS_DONTWAIT 2 | #define GPIOBUS_DONTWAIT 2 | ||||
struct gpiobus_pin_data | |||||
{ | |||||
int mapped; /* pin is mapped/reserved. */ | |||||
char *name; /* pin name. */ | |||||
}; | |||||
struct gpiobus_softc | struct gpiobus_softc | ||||
{ | { | ||||
struct mtx sc_mtx; /* bus mutex */ | struct mtx sc_mtx; /* bus mutex */ | ||||
struct rman sc_intr_rman; /* isr resources */ | struct rman sc_intr_rman; /* isr resources */ | ||||
device_t sc_busdev; /* bus device */ | device_t sc_busdev; /* bus device */ | ||||
device_t sc_owner; /* bus owner */ | device_t sc_owner; /* bus owner */ | ||||
device_t sc_dev; /* driver device */ | device_t sc_dev; /* driver device */ | ||||
int sc_npins; /* total pins on bus */ | int sc_npins; /* total pins on bus */ | ||||
int *sc_pins_mapped; /* mark mapped pins */ | struct gpiobus_pin_data *sc_pins; /* pin data */ | ||||
}; | }; | ||||
struct gpiobus_pin | struct gpiobus_pin | ||||
{ | { | ||||
device_t dev; /* gpio device */ | device_t dev; /* gpio device */ | ||||
uint32_t flags; /* pin flags */ | uint32_t flags; /* pin flags */ | ||||
uint32_t pin; /* pin number */ | uint32_t pin; /* pin number */ | ||||
}; | }; | ||||
Show All 38 Lines |