diff options
author | msmith <msmith@FreeBSD.org> | 2000-06-23 07:44:33 +0000 |
---|---|---|
committer | msmith <msmith@FreeBSD.org> | 2000-06-23 07:44:33 +0000 |
commit | dd93fd16a6696fe0c9c1b69539b2ac899c04978e (patch) | |
tree | ced3f143f58f67f9f3e1a80e95d8b0ab2df4a6ae /sys/dev/speaker | |
parent | 9d946aa74ddb86df33489ee80770826d8dc37705 (diff) | |
download | FreeBSD-src-dd93fd16a6696fe0c9c1b69539b2ac899c04978e.zip FreeBSD-src-dd93fd16a6696fe0c9c1b69539b2ac899c04978e.tar.gz |
Add PnP probe methods to some common AT hardware drivers. In each case,
the PnP probe is merely a stub as we make assumptions about some of this
hardware before we have probed it.
Since these devices (with the exception of the speaker) are 'standard',
suppress output in the !bootverbose case to clean up the probe messages
somewhat.
Diffstat (limited to 'sys/dev/speaker')
-rw-r--r-- | sys/dev/speaker/spkr.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/sys/dev/speaker/spkr.c b/sys/dev/speaker/spkr.c index 0f7ed61..e6f0e95 100644 --- a/sys/dev/speaker/spkr.c +++ b/sys/dev/speaker/spkr.c @@ -9,11 +9,14 @@ #include <sys/param.h> #include <sys/systm.h> +#include <sys/bus.h> #include <sys/kernel.h> +#include <sys/module.h> #include <sys/uio.h> #include <sys/conf.h> #include <sys/ctype.h> #include <sys/malloc.h> +#include <isa/isavar.h> #include <i386/isa/isa.h> #include <i386/isa/timerreg.h> #include <machine/clock.h> @@ -594,5 +597,46 @@ spkr_drvinit(void *unused) SYSINIT(spkrdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,spkr_drvinit,NULL) +/* + * Install placeholder to claim the resources owned by the + * AT tone generator. + */ +static struct isa_pnp_id atspeaker_ids[] = { + { 0x0008d041 /* PNP0800 */, "AT speaker" }, + { 0 } +}; + +static int +atspeaker_probe(device_t dev) +{ + return(ISA_PNP_PROBE(device_get_parent(dev), dev, atspeaker_ids)); +} + +static int +atspeaker_attach(device_t dev) +{ + return(0); +} + +static device_method_t atspeaker_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, atspeaker_probe), + DEVMETHOD(device_attach, atspeaker_attach), + DEVMETHOD(device_detach, bus_generic_detach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + { 0, 0 } +}; + +static driver_t atspeaker_driver = { + "atspeaker", + atspeaker_methods, + 1, /* no softc */ +}; + +static devclass_t atspeaker_devclass; + +DRIVER_MODULE(atspeaker, isa, atspeaker_driver, atspeaker_devclass, 0, 0); /* spkr.c ends here */ |