diff options
| author | xtraeme <xtraeme@NetBSD.org> | 2007-09-09 05:26:18 +0000 |
|---|---|---|
| committer | xtraeme <xtraeme@NetBSD.org> | 2007-09-09 05:26:18 +0000 |
| commit | 2db2debe7eaff873c74f0e4a809a6a0d89262b52 (patch) | |
| tree | 20b96d5c483019f9c87ccbcfd9c417025e9a3928 /sys/dev/isa | |
| parent | ba6e78a9421b13ca92e2cbfd6439837bda1acc3d (diff) | |
Add the detach method and don't bother with gpio in the LKM for now.
Diffstat (limited to 'sys/dev/isa')
| -rw-r--r-- | sys/dev/isa/nsclpcsio_isa.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/sys/dev/isa/nsclpcsio_isa.c b/sys/dev/isa/nsclpcsio_isa.c index a31b033f16d..0b5c151d3b1 100644 --- a/sys/dev/isa/nsclpcsio_isa.c +++ b/sys/dev/isa/nsclpcsio_isa.c @@ -1,4 +1,4 @@ -/* $NetBSD: nsclpcsio_isa.c,v 1.18 2007/09/02 00:54:50 xtraeme Exp $ */ +/* $NetBSD: nsclpcsio_isa.c,v 1.19 2007/09/09 05:26:18 xtraeme Exp $ */ /* * Copyright (c) 2002 @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: nsclpcsio_isa.c,v 1.18 2007/09/02 00:54:50 xtraeme Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nsclpcsio_isa.c,v 1.19 2007/09/09 05:26:18 xtraeme Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -36,9 +36,17 @@ __KERNEL_RCSID(0, "$NetBSD: nsclpcsio_isa.c,v 1.18 2007/09/02 00:54:50 xtraeme E #include <sys/gpio.h> #include <machine/bus.h> +/* Don't use gpio for now in the LKM */ +#ifdef _LKM +#undef NGPIO +#endif + #include <dev/isa/isareg.h> #include <dev/isa/isavar.h> + +#ifndef _LKM #include "gpio.h" +#endif #if NGPIO > 0 #include <dev/gpio/gpiovar.h> #endif @@ -46,6 +54,7 @@ __KERNEL_RCSID(0, "$NetBSD: nsclpcsio_isa.c,v 1.18 2007/09/02 00:54:50 xtraeme E static int nsclpcsio_isa_match(struct device *, struct cfdata *, void *); static void nsclpcsio_isa_attach(struct device *, struct device *, void *); +static int nsclpcsio_isa_detach(struct device *, int); #define GPIO_NPINS 29 #define SIO_GPIO_CONF_OUTPUTEN (1 << 0) @@ -76,7 +85,7 @@ struct nsclpcsio_softc { (sc)->sc_gpio_ioh, (reg), (val)) CFATTACH_DECL(nsclpcsio_isa, sizeof(struct nsclpcsio_softc), - nsclpcsio_isa_match, nsclpcsio_isa_attach, NULL, NULL); + nsclpcsio_isa_match, nsclpcsio_isa_attach, nsclpcsio_isa_detach, NULL); static u_int8_t nsread(bus_space_tag_t, bus_space_handle_t, int); static void nswrite(bus_space_tag_t, bus_space_handle_t, int, u_int8_t); @@ -296,6 +305,16 @@ nsclpcsio_isa_attach(struct device *parent, struct device *self, return; } +static int +nsclpcsio_isa_detach(struct device *self, int flags) +{ + struct nsclpcsio_softc *sc = device_private(self); + + sysmon_envsys_unregister(&sc->sc_sysmon); + bus_space_unmap(sc->sc_iot, sc->sc_ioh, 2); + return 0; +} + static void tms_update(sc, chan) struct nsclpcsio_softc *sc; |
