Lines Matching refs:dev
47 #include <dev/ofw/ofw_bus_subr.h>
54 static int rtc_attach(device_t dev);
55 static int rtc_probe(device_t dev);
78 rtc_probe(device_t dev)
81 if (!ofw_bus_is_compatible(dev, "dallas,ds1553"))
84 device_set_desc(dev, "Dallas Semiconductor DS1553 RTC");
89 rtc_attach(device_t dev)
95 sc = device_get_softc(dev);
100 sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->rid,
103 device_printf(dev, "cannot allocate resources\n");
111 if ((error = ds1553_attach(dev)) != 0) {
112 device_printf(dev, "cannot attach time of day clock\n");
113 bus_release_resource(dev, SYS_RES_MEMORY, sc->rid, sc->res);
118 clock_register(dev, 1000000);
121 ds1553_gettime(dev, &ts);
122 device_printf(dev, "current time: %ld.%09ld\n",