Lines Matching refs:dev
42 #include <dev/clk/clk.h>
44 #include <dev/iicbus/iicbus.h>
45 #include <dev/iicbus/iiconf.h>
47 #include <dev/ofw/ofw_bus.h>
48 #include <dev/ofw/ofw_bus_subr.h>
67 iicoc_get_node(device_t bus, device_t dev)
75 iicoc_attach(device_t dev)
83 sc = device_get_softc(dev);
84 sc->dev = dev;
88 error = bus_alloc_resources(dev, iicoc_spec, &sc->mem_res);
90 device_printf(dev, "Could not allocate bus resource.\n");
94 node = ofw_bus_get_node(dev);
99 error = clk_get_by_ofw_index(dev, 0, 0, &clock);
101 device_printf(dev, "Couldn't get clock\n");
106 device_printf(dev, "Couldn't enable clock\n");
111 device_printf(dev, "Couldn't get clock frequency\n");
115 device_printf(dev, "Unsupported clock frequency\n");
120 iicoc_init(dev);
122 sc->iicbus = device_add_child(dev, "iicbus", -1);
124 device_printf(dev, "Could not allocate iicbus instance.\n");
130 config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev);
138 bus_release_resources(dev, iicoc_spec, &sc->mem_res);
144 iicoc_probe(device_t dev)
147 if (!ofw_bus_status_okay(dev))
150 if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0)
153 device_set_desc(dev, "OpenCores I2C master controller");