Lines Matching refs:dev
32 __FBSDID("$FreeBSD: releng/11.0/sys/dev/altera/avgen/altera_avgen_fdt.c 299747 2016-05-14 18:44:30Z gonzo $");
53 #include <dev/fdt/fdt_common.h>
54 #include <dev/ofw/openfirm.h>
55 #include <dev/ofw/ofw_bus.h>
56 #include <dev/ofw/ofw_bus_subr.h>
58 #include <dev/altera/avgen/altera_avgen.h>
61 altera_avgen_fdt_probe(device_t dev)
64 if (!ofw_bus_status_okay(dev))
67 if (ofw_bus_is_compatible(dev, "sri-cambridge,avgen")) {
68 device_set_desc(dev, "Generic Altera Avalon device attachment");
75 altera_avgen_fdt_attach(device_t dev)
84 sc = device_get_softc(dev);
85 sc->avg_dev = dev;
86 sc->avg_unit = device_get_unit(dev);
90 * expose the device via /dev.
97 node = ofw_bus_get_node(dev);
111 sc->avg_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
114 device_printf(dev, "couldn't map memory\n");
120 bus_release_resource(dev, SYS_RES_MEMORY, sc->avg_rid,
132 altera_avgen_fdt_detach(device_t dev)
136 sc = device_get_softc(dev);
138 bus_release_resource(dev, SYS_RES_MEMORY, sc->avg_rid, sc->avg_res);