spkr.c (60038) | spkr.c (61994) |
---|---|
1/* 2 * spkr.c -- device driver for console speaker 3 * 4 * v1.4 by Eric S. Raymond (esr@snark.thyrsus.com) Aug 1993 5 * modified for FreeBSD by Andrew A. Chernov <ache@astral.msk.su> 6 * | 1/* 2 * spkr.c -- device driver for console speaker 3 * 4 * v1.4 by Eric S. Raymond (esr@snark.thyrsus.com) Aug 1993 5 * modified for FreeBSD by Andrew A. Chernov <ache@astral.msk.su> 6 * |
7 * $FreeBSD: head/sys/dev/speaker/spkr.c 60038 2000-05-05 09:05:39Z phk $ | 7 * $FreeBSD: head/sys/dev/speaker/spkr.c 61994 2000-06-23 07:44:33Z msmith $ |
8 */ 9 10#include <sys/param.h> 11#include <sys/systm.h> | 8 */ 9 10#include <sys/param.h> 11#include <sys/systm.h> |
12#include <sys/bus.h> |
|
12#include <sys/kernel.h> | 13#include <sys/kernel.h> |
14#include <sys/module.h> |
|
13#include <sys/uio.h> 14#include <sys/conf.h> 15#include <sys/ctype.h> 16#include <sys/malloc.h> | 15#include <sys/uio.h> 16#include <sys/conf.h> 17#include <sys/ctype.h> 18#include <sys/malloc.h> |
19#include <isa/isavar.h> |
|
17#include <i386/isa/isa.h> 18#include <i386/isa/timerreg.h> 19#include <machine/clock.h> 20#include <machine/speaker.h> 21 22static d_open_t spkropen; 23static d_close_t spkrclose; 24static d_write_t spkrwrite; --- 564 unchanged lines hidden (view full) --- 589static void 590spkr_drvinit(void *unused) 591{ 592 make_dev(&spkr_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "speaker"); 593} 594 595SYSINIT(spkrdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,spkr_drvinit,NULL) 596 | 20#include <i386/isa/isa.h> 21#include <i386/isa/timerreg.h> 22#include <machine/clock.h> 23#include <machine/speaker.h> 24 25static d_open_t spkropen; 26static d_close_t spkrclose; 27static d_write_t spkrwrite; --- 564 unchanged lines hidden (view full) --- 592static void 593spkr_drvinit(void *unused) 594{ 595 make_dev(&spkr_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "speaker"); 596} 597 598SYSINIT(spkrdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,spkr_drvinit,NULL) 599 |
600/* 601 * Install placeholder to claim the resources owned by the 602 * AT tone generator. 603 */ 604static struct isa_pnp_id atspeaker_ids[] = { 605 { 0x0008d041 /* PNP0800 */, "AT speaker" }, 606 { 0 } 607}; |
|
597 | 608 |
609static int 610atspeaker_probe(device_t dev) 611{ 612 return(ISA_PNP_PROBE(device_get_parent(dev), dev, atspeaker_ids)); 613} 614 615static int 616atspeaker_attach(device_t dev) 617{ 618 return(0); 619} 620 621static device_method_t atspeaker_methods[] = { 622 /* Device interface */ 623 DEVMETHOD(device_probe, atspeaker_probe), 624 DEVMETHOD(device_attach, atspeaker_attach), 625 DEVMETHOD(device_detach, bus_generic_detach), 626 DEVMETHOD(device_shutdown, bus_generic_shutdown), 627 DEVMETHOD(device_suspend, bus_generic_suspend), 628 DEVMETHOD(device_resume, bus_generic_resume), 629 { 0, 0 } 630}; 631 632static driver_t atspeaker_driver = { 633 "atspeaker", 634 atspeaker_methods, 635 1, /* no softc */ 636}; 637 638static devclass_t atspeaker_devclass; 639 640DRIVER_MODULE(atspeaker, isa, atspeaker_driver, atspeaker_devclass, 0, 0); 641 |
|
598/* spkr.c ends here */ | 642/* spkr.c ends here */ |