Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ow/owc_gpiobus.c
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
#ifdef FDT | #ifdef FDT | ||||
#include <dev/ofw/ofw_bus.h> | #include <dev/ofw/ofw_bus.h> | ||||
#include <dev/ofw/ofw_bus_subr.h> | #include <dev/ofw/ofw_bus_subr.h> | ||||
static struct ofw_compat_data compat_data[] = { | static struct ofw_compat_data compat_data[] = { | ||||
{"w1-gpio", true}, | {"w1-gpio", true}, | ||||
{NULL, false} | {NULL, false} | ||||
}; | }; | ||||
OFWBUS_PNP_INFO(compat_data); | |||||
SIMPLEBUS_PNP_INFO(compat_data); | |||||
#endif /* FDT */ | #endif /* FDT */ | ||||
#define OW_PIN 0 | #define OW_PIN 0 | ||||
#define OWC_GPIOBUS_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) | #define OWC_GPIOBUS_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) | ||||
#define OWC_GPIOBUS_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) | #define OWC_GPIOBUS_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) | ||||
#define OWC_GPIOBUS_LOCK_INIT(_sc) \ | #define OWC_GPIOBUS_LOCK_INIT(_sc) \ | ||||
mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->sc_dev), \ | mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->sc_dev), \ | ||||
▲ Show 20 Lines • Show All 327 Lines • ▼ Show 20 Lines | |||||
static driver_t owc_gpiobus_driver = { | static driver_t owc_gpiobus_driver = { | ||||
"owc", | "owc", | ||||
owc_gpiobus_methods, | owc_gpiobus_methods, | ||||
sizeof(struct owc_gpiobus_softc), | sizeof(struct owc_gpiobus_softc), | ||||
}; | }; | ||||
#ifdef FDT | #ifdef FDT | ||||
DRIVER_MODULE(owc_gpiobus, simplebus, owc_gpiobus_driver, owc_gpiobus_devclass, 0, 0); | DRIVER_MODULE(owc_gpiobus, simplebus, owc_gpiobus_driver, owc_gpiobus_devclass, 0, 0); | ||||
SIMPLEBUS_PNP_INFO(compat_data); | |||||
#endif | #endif | ||||
DRIVER_MODULE(owc_gpiobus, gpiobus, owc_gpiobus_driver, owc_gpiobus_devclass, 0, 0); | DRIVER_MODULE(owc_gpiobus, gpiobus, owc_gpiobus_driver, owc_gpiobus_devclass, 0, 0); | ||||
#ifdef FDT | |||||
OFWBUS_PNP_INFO(compat_data); | |||||
#endif | |||||
MODULE_DEPEND(owc_gpiobus, ow, 1, 1, 1); | MODULE_DEPEND(owc_gpiobus, ow, 1, 1, 1); | ||||
MODULE_DEPEND(owc_gpiobus, gpiobus, 1, 1, 1); | MODULE_DEPEND(owc_gpiobus, gpiobus, 1, 1, 1); | ||||
MODULE_VERSION(owc_gpiobus, 1); | MODULE_VERSION(owc_gpiobus, 1); |