Lines Matching defs:dev
49 #include <dev/ofw/ofw_bus.h>
50 #include <dev/ofw/ofw_bus_subr.h>
69 device_t dev;
74 static int mv_rtc_probe(device_t dev);
75 static int mv_rtc_attach(device_t dev);
76 static int mv_rtc_detach(device_t dev);
78 static int mv_rtc_gettime(device_t dev, struct timespec *ts);
79 static int mv_rtc_settime(device_t dev, struct timespec *ts);
107 mv_rtc_probe(device_t dev)
110 if (!ofw_bus_status_okay(dev))
113 if (!ofw_bus_is_compatible(dev, "marvell,armada-380-rtc"))
116 device_set_desc(dev, "Marvell Integrated RTC");
122 mv_rtc_attach(device_t dev)
127 unit = device_get_unit(dev);
129 sc = device_get_softc(dev);
130 sc->dev = dev;
132 clock_register(dev, RTC_RES_US);
134 mtx_init(&sc->mutex, device_get_nameunit(dev), NULL, MTX_DEF);
136 ret = bus_alloc_resources(dev, res_spec, &sc->res);
138 device_printf(dev, "could not allocate resources\n");
147 mv_rtc_detach(device_t dev)
151 sc = device_get_softc(dev);
155 bus_release_resources(dev, res_spec, &sc->res);
161 mv_rtc_gettime(device_t dev, struct timespec *ts)
166 sc = device_get_softc(dev);
188 mv_rtc_settime(device_t dev, struct timespec *ts)
192 sc = device_get_softc(dev);