Lines Matching refs:dev
31 __FBSDID("$FreeBSD: releng/11.0/sys/dev/atkbdc/atkbdc_ebus.c 300173 2016-05-18 23:39:31Z gonzo $");
43 #include <dev/ofw/ofw_bus.h>
50 #include <dev/kbd/kbdreg.h>
51 #include <dev/atkbdc/atkbdreg.h>
52 #include <dev/atkbdc/atkbdc_subr.h>
53 #include <dev/atkbdc/atkbdcreg.h>
54 #include <dev/atkbdc/psm.h>
91 atkbdc_ebus_probe(device_t dev)
97 if (strcmp(ofw_bus_get_name(dev), "8042") != 0)
117 OF_finddevice("keyboard") != ofw_bus_get_node(dev)) {
118 device_disable(dev);
122 device_set_desc(dev, "Keyboard controller (i8042)");
133 if (bus_get_resource(dev, SYS_RES_MEMORY, rid, &start, &count) != 0) {
134 device_printf(dev,
138 port0 = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, start, start, 1,
141 device_printf(dev,
147 if (bus_get_resource(dev, SYS_RES_MEMORY, rid, &start, &count) != 0) {
148 device_printf(dev, "cannot determine status port resource\n");
153 port1 = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, start, start, 1,
156 device_printf(dev, "cannot allocate status port resource\n");
161 error = atkbdc_probe_unit(device_get_unit(dev), port0, port1);
163 device_printf(dev, "atkbdc_porbe_unit failed\n");
165 bus_release_resource(dev, SYS_RES_MEMORY, 1, port1);
167 bus_release_resource(dev, SYS_RES_MEMORY, 0, port0);
173 atkbdc_ebus_attach(device_t dev)
183 unit = device_get_unit(dev);
184 sc = *(atkbdc_softc_t **)device_get_softc(dev);
196 device_set_softc(dev, sc);
200 if (bus_get_resource(dev, SYS_RES_MEMORY, rid, &start, &count) != 0) {
201 device_printf(dev,
206 sc->port0 = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, start, start,
209 device_printf(dev,
215 if (bus_get_resource(dev, SYS_RES_MEMORY, rid, &start, &count) != 0) {
216 device_printf(dev, "cannot determine status port resource\n");
221 sc->port1 = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, start, start,
224 device_printf(dev, "cannot allocate status port resource\n");
231 device_printf(dev, "atkbdc_attach_unit failed\n");
237 for (child = OF_child(ofw_bus_get_node(dev)); child != 0;
242 device_printf(dev,
251 device_printf(dev, "<%s>: malloc failed\n", cname);
262 device_printf(dev, "<%s>: unknown device\n", cname);
267 intr = bus_get_resource_start(dev, SYS_RES_IRQ, adi->rid);
269 device_printf(dev,
279 if ((cdev = device_add_child(dev, dname, -1)) == NULL) {
280 device_printf(dev, "<%s>: device_add_child failed\n",
291 error = bus_generic_attach(dev);
293 device_printf(dev, "bus_generic_attach failed\n");
300 bus_release_resource(dev, SYS_RES_MEMORY, 1, sc->port1);
302 bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->port0);