Lines Matching +full:irq +full:- +full:start
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
53 int type, int *rid, rman_res_t start, rman_res_t end,
99 rman_res_t start; in atkbdc_isa_probe() local
121 * (0x60 and 0x64). Some brain-damaged ACPI BIOS has reversed in atkbdc_isa_probe()
129 if (bus_get_resource(dev, SYS_RES_IOPORT, rid, &start, &count) != 0) in atkbdc_isa_probe()
131 if (start == IO_KBD + KBD_STATUS_PORT) { in atkbdc_isa_probe()
132 start = IO_KBD; in atkbdc_isa_probe()
135 if (count > 1) /* adjust the count and/or start port */ in atkbdc_isa_probe()
136 bus_set_resource(dev, SYS_RES_IOPORT, rid, start, 1); in atkbdc_isa_probe()
143 start + KBD_STATUS_PORT, 1); in atkbdc_isa_probe()
156 * on the fact that reading from non-existing in/out port returns in atkbdc_isa_probe()
199 * as the low-level console needs to have access to the in atkbdc_isa_attach()
210 sc->retry = 5000; in atkbdc_isa_attach()
211 sc->port0 = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, in atkbdc_isa_attach()
213 if (sc->port0 == NULL) in atkbdc_isa_attach()
216 sc->port1 = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, in atkbdc_isa_attach()
218 if (sc->port1 == NULL) { in atkbdc_isa_attach()
219 bus_release_resource(dev, SYS_RES_IOPORT, 0, sc->port0); in atkbdc_isa_attach()
225 * the hint for the IRQ is on the child atkbd device, not the in atkbdc_isa_attach()
229 sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); in atkbdc_isa_attach()
231 error = atkbdc_attach_unit(unit, sc, sc->port0, sc->port1); in atkbdc_isa_attach()
233 bus_release_resource(dev, SYS_RES_IOPORT, 0, sc->port0); in atkbdc_isa_attach()
234 bus_release_resource(dev, SYS_RES_IOPORT, 1, sc->port1); in atkbdc_isa_attach()
235 if (sc->irq != NULL) in atkbdc_isa_attach()
236 bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq); in atkbdc_isa_attach()
267 resource_list_init(&ivar->resources); in atkbdc_isa_add_child()
268 ivar->rid = order; in atkbdc_isa_add_child()
272 * to device hints for IRQ. We always populate the resource in atkbdc_isa_add_child()
277 if (sc->irq == NULL) { in atkbdc_isa_add_child()
278 if (resource_int_value(name, unit, "irq", &t) != 0) in atkbdc_isa_add_child()
279 t = -1; in atkbdc_isa_add_child()
281 t = rman_get_start(sc->irq); in atkbdc_isa_add_child()
283 resource_list_add(&ivar->resources, SYS_RES_IRQ, in atkbdc_isa_add_child()
284 ivar->rid, t, t, 1); in atkbdc_isa_add_child()
297 rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) in atkbdc_isa_alloc_resource() argument
302 if (type == SYS_RES_IRQ && *rid == KBDC_RID_KBD && sc->irq != NULL) in atkbdc_isa_alloc_resource()
303 return (sc->irq); in atkbdc_isa_alloc_resource()
304 return (bus_generic_rl_alloc_resource(dev, child, type, rid, start, in atkbdc_isa_alloc_resource()
314 if (r == sc->irq) in atkbdc_isa_release_resource()