Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/gpio/gpioths.c
Show First 20 Lines • Show All 66 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[] = { | ||||
{"dht11", true}, | {"dht11", true}, | ||||
{NULL, false} | {NULL, false} | ||||
}; | }; | ||||
OFWBUS_PNP_INFO(compat_data); | |||||
SIMPLEBUS_PNP_INFO(compat_data); | |||||
#endif /* FDT */ | #endif /* FDT */ | ||||
#define PIN_IDX 0 /* Use the first/only configured pin. */ | #define PIN_IDX 0 /* Use the first/only configured pin. */ | ||||
#define GPIOTHS_POLLTIME 5 /* in seconds */ | #define GPIOTHS_POLLTIME 5 /* in seconds */ | ||||
#define GPIOTHS_DHT_STARTCYCLE 20000 /* 20ms = 20000us */ | #define GPIOTHS_DHT_STARTCYCLE 20000 /* 20ms = 20000us */ | ||||
#define GPIOTHS_DHT_TIMEOUT 1000 /* 1ms = 1000us */ | #define GPIOTHS_DHT_TIMEOUT 1000 /* 1ms = 1000us */ | ||||
▲ Show 20 Lines • Show All 321 Lines • ▼ Show 20 Lines | |||||
}; | }; | ||||
static devclass_t gpioths_devclass; | static devclass_t gpioths_devclass; | ||||
DEFINE_CLASS_0(gpioths, gpioths_driver, gpioths_methods, sizeof(struct gpioths_softc)); | DEFINE_CLASS_0(gpioths, gpioths_driver, gpioths_methods, sizeof(struct gpioths_softc)); | ||||
#ifdef FDT | #ifdef FDT | ||||
DRIVER_MODULE(gpioths, simplebus, gpioths_driver, gpioths_devclass, 0, 0); | DRIVER_MODULE(gpioths, simplebus, gpioths_driver, gpioths_devclass, 0, 0); | ||||
SIMPLEBUS_PNP_INFO(compat_data); | |||||
#endif | #endif | ||||
DRIVER_MODULE(gpioths, gpiobus, gpioths_driver, gpioths_devclass, 0, 0); | DRIVER_MODULE(gpioths, gpiobus, gpioths_driver, gpioths_devclass, 0, 0); | ||||
#ifdef FDT | |||||
OFWBUS_PNP_INFO(compat_data); | |||||
#endif | |||||
MODULE_DEPEND(gpioths, gpiobus, 1, 1, 1); | MODULE_DEPEND(gpioths, gpiobus, 1, 1, 1); |