diff options
| author | Mike Smith <msmith@FreeBSD.org> | 2000-06-23 07:44:33 +0000 |
|---|---|---|
| committer | Mike Smith <msmith@FreeBSD.org> | 2000-06-23 07:44:33 +0000 |
| commit | 2a50a6d730b9ab974049dd0869b9426235ff47a3 (patch) | |
| tree | 3ca97d9832e513a9d5d4e2b02091599ea1f3e175 /sys/dev/speaker | |
| parent | 04de761e363346cd6161d24b9548f0a4388f5b54 (diff) | |
Notes
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 0f7ed61ceee6..e6f0e9543acc 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 */ |
