From c2af6f650c4eb0f16a2f41bc527c7d2a85b45039 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Mon, 6 Dec 1999 18:26:33 +0000 Subject: [PATCH] Update for pnp adjustments regarding NPNP. Also, optimize out a mess of #if's that were duplicating work already done by config(8). For example, if a file is marked as "dev/sound/pci/foo.c optional pcm pci" then it's only added if pcm *and* pci are present, so #if NPCM > 0 and #if NPCI > 0 are totally redundant. A bit more work is still needed. Discussed with: cg (a few weeks ago) --- sys/dev/sound/isa/ad1816.c | 5 ----- sys/dev/sound/isa/es1888.c | 4 ---- sys/dev/sound/isa/gusc.c | 7 ------- sys/dev/sound/isa/mss.c | 17 ----------------- sys/dev/sound/isa/sb.c | 8 -------- sys/dev/sound/isa/sb16.c | 8 -------- sys/dev/sound/isa/sb8.c | 8 -------- sys/dev/sound/isa/sbc.c | 18 ++++++------------ sys/dev/sound/pci/aureal.c | 5 ----- sys/dev/sound/pci/csa.c | 5 ----- sys/dev/sound/pci/csapcm.c | 9 --------- sys/dev/sound/pci/es137x.c | 5 ----- sys/dev/sound/pci/t4dwave.c | 4 ---- sys/dev/sound/pcm/sound.c | 11 ----------- sys/dev/sound/pcm/sound.h | 4 ---- 15 files changed, 6 insertions(+), 112 deletions(-) diff --git a/sys/dev/sound/isa/ad1816.c b/sys/dev/sound/isa/ad1816.c index 5c1cf55b8af..81b22e1fd94 100644 --- a/sys/dev/sound/isa/ad1816.c +++ b/sys/dev/sound/isa/ad1816.c @@ -29,9 +29,6 @@ */ #include - -#if NPCM > 0 && NPNP > 0 - #include struct ad1816_info; @@ -621,5 +618,3 @@ static driver_t ad1816_driver = { }; DRIVER_MODULE(ad1816, isa, ad1816_driver, pcm_devclass, 0, 0); - -#endif diff --git a/sys/dev/sound/isa/es1888.c b/sys/dev/sound/isa/es1888.c index 8fab6d7e8ce..ac166b0c3e9 100644 --- a/sys/dev/sound/isa/es1888.c +++ b/sys/dev/sound/isa/es1888.c @@ -29,8 +29,6 @@ #include #include -#if NPCM > 0 - static int es1888_dspready(u_int32_t port) { @@ -171,5 +169,3 @@ static driver_t es1888_driver = { static devclass_t pcm_devclass; DRIVER_MODULE(es1888, isa, es1888_driver, pcm_devclass, 0, 0); - -#endif /* NPCM > 0 */ diff --git a/sys/dev/sound/isa/gusc.c b/sys/dev/sound/isa/gusc.c index b6de776c504..bde185b4a6a 100644 --- a/sys/dev/sound/isa/gusc.c +++ b/sys/dev/sound/isa/gusc.c @@ -29,7 +29,6 @@ #include "gusc.h" #include "isa.h" -#include "pnp.h" #include #include @@ -55,8 +54,6 @@ #endif #endif /* NISA > 0 */ -#if NGUSC > 0 - #define LOGICALID_NOPNP 0 #define LOGICALID_PCM 0x0000561e #define LOGICALID_OPL 0x0300561e @@ -121,7 +118,6 @@ gusc_probe(device_t dev) if (vend_id == 0) return gusisa_probe(dev); -#if NPNP > 0 logical_id = isa_get_logicalid(dev); s = NULL; @@ -166,7 +162,6 @@ gusc_probe(device_t dev) device_set_desc(dev, s); return (0); } -#endif /* NPNP > 0 */ return (ENXIO); } @@ -682,5 +677,3 @@ static driver_t gusc_driver = { */ DRIVER_MODULE(gusc, isa, gusc_driver, gusc_devclass, 0, 0); #endif /* NISA > 0 */ - -#endif /* NGUSC > 0 */ diff --git a/sys/dev/sound/isa/mss.c b/sys/dev/sound/isa/mss.c index bea3fcc569f..d1dceb57888 100644 --- a/sys/dev/sound/isa/mss.c +++ b/sys/dev/sound/isa/mss.c @@ -30,8 +30,6 @@ #include -#if NPCM > 0 - /* board-specific include files */ #include #include @@ -98,12 +96,10 @@ static void ad_write_cnt(struct mss_info *mss, int reg, u_short data); static void conf_wr(struct mss_info *mss, u_char reg, u_char data); static u_char conf_rd(struct mss_info *mss, u_char reg); -#if NPNP > 0 static int pnpmss_probe(device_t dev); static int pnpmss_attach(device_t dev); static driver_intr_t opti931_intr; -#endif static int mssmix_init(snd_mixer *m); static int mssmix_set(snd_mixer *m, unsigned dev, unsigned left, unsigned right); @@ -248,7 +244,6 @@ opti_rd(struct mss_info *mss, u_char reg) return port_rd(mss->conf_base, mss->opti_offset + 1); } -#if NPNP > 0 || NGUSC > 0 static void gus_wr(struct mss_info *mss, u_char reg, u_char value) { @@ -262,7 +257,6 @@ gus_rd(struct mss_info *mss, u_char reg) port_wr(mss->conf_base, 3, reg); return port_rd(mss->conf_base, 5); } -#endif /* NPNP > 0 || NGUSC > 0 */ static void mss_release_resources(struct mss_info *mss, device_t dev) @@ -403,7 +397,6 @@ mss_init(struct mss_info *mss, device_t dev) mss->bd_flags |= BD_F_MCE_BIT; switch(mss->bd_id) { -#if NPNP > 0 case MD_OPTI931: /* * The MED3931 v.1.0 allocates 3 bytes for the config @@ -421,9 +414,7 @@ mss_init(struct mss_info *mss, device_t dev) opti_wr(mss, 6, 2); /* MCIR6: mss enable, sb disable */ opti_wr(mss, 5, 0x28); /* MCIR5: codec in exp. mode,fifo */ break; -#endif /* NPNP > 0 */ -#if NPNP > 0 || NGUSC > 0 case MD_GUSPNP: case MD_GUSMAX: gus_wr(mss, 0x4c /* _URSTI */, 0);/* Pull reset */ @@ -465,7 +456,6 @@ mss_init(struct mss_info *mss, device_t dev) gus_wr(mss, 0x5b, tmp | 1); BVDDB(printf("GUS: silicon rev %c\n", 'A' + ((tmp & 0xf) >> 4))); break; -#endif /* NPNP > 0 || NGUSC > 0 */ case MD_YM0020: conf_wr(mss, OPL3SAx_DMACONF, 0xa9); /* dma-b rec, dma-a play */ @@ -893,11 +883,9 @@ mss_doattach(device_t dev, struct mss_info *mss) } mixer_init(d, (mss->bd_id == MD_YM0020)? &yamaha_mixer : &mss_mixer, mss); switch (mss->bd_id) { - #if NPNP > 0 case MD_OPTI931: bus_setup_intr(dev, mss->irq, INTR_TYPE_TTY, opti931_intr, mss, &ih); break; - #endif default: bus_setup_intr(dev, mss->irq, INTR_TYPE_TTY, mss_intr, mss, &ih); } @@ -1345,7 +1333,6 @@ mss_trigger(struct mss_chinfo *ch, int go) return 0; } -#if NPNP > 0 static int pnpmss_probe(device_t dev) { @@ -1548,8 +1535,6 @@ opti931_intr(void *arg) DEB(printf("xxx too many loops\n");) } -#endif /* NPNP > 0 */ - #if NGUSC > 0 static int @@ -1823,5 +1808,3 @@ msschan_getcaps(void *data) break; } } - -#endif /* NPCM > 0 */ diff --git a/sys/dev/sound/isa/sb.c b/sys/dev/sound/isa/sb.c index 36f0c4b7d68..bf4949aa65c 100644 --- a/sys/dev/sound/isa/sb.c +++ b/sys/dev/sound/isa/sb.c @@ -32,7 +32,6 @@ */ #include -#if NPCM > 0 #include "sbc.h" @@ -1253,7 +1252,6 @@ sbmix_setrecsrc(snd_mixer *m, u_int32_t src) return src; } -#if NPNP > 0 static int sbpnp_probe(device_t dev) { @@ -1329,8 +1327,6 @@ static driver_t sbpnp_driver = { DRIVER_MODULE(sbpnp, isa, sbpnp_driver, pcm_devclass, 0, 0); -#endif /* NPNP > 0 */ - #if NSBC > 0 #define DESCSTR " PCM Audio" static int @@ -1391,7 +1387,3 @@ static driver_t sbsbc_driver = { DRIVER_MODULE(sbsbc, sbc, sbsbc_driver, pcm_devclass, 0, 0); #endif /* NSBC > 0 */ - -#endif /* NPCM > 0 */ - - diff --git a/sys/dev/sound/isa/sb16.c b/sys/dev/sound/isa/sb16.c index 36f0c4b7d68..bf4949aa65c 100644 --- a/sys/dev/sound/isa/sb16.c +++ b/sys/dev/sound/isa/sb16.c @@ -32,7 +32,6 @@ */ #include -#if NPCM > 0 #include "sbc.h" @@ -1253,7 +1252,6 @@ sbmix_setrecsrc(snd_mixer *m, u_int32_t src) return src; } -#if NPNP > 0 static int sbpnp_probe(device_t dev) { @@ -1329,8 +1327,6 @@ static driver_t sbpnp_driver = { DRIVER_MODULE(sbpnp, isa, sbpnp_driver, pcm_devclass, 0, 0); -#endif /* NPNP > 0 */ - #if NSBC > 0 #define DESCSTR " PCM Audio" static int @@ -1391,7 +1387,3 @@ static driver_t sbsbc_driver = { DRIVER_MODULE(sbsbc, sbc, sbsbc_driver, pcm_devclass, 0, 0); #endif /* NSBC > 0 */ - -#endif /* NPCM > 0 */ - - diff --git a/sys/dev/sound/isa/sb8.c b/sys/dev/sound/isa/sb8.c index 36f0c4b7d68..bf4949aa65c 100644 --- a/sys/dev/sound/isa/sb8.c +++ b/sys/dev/sound/isa/sb8.c @@ -32,7 +32,6 @@ */ #include -#if NPCM > 0 #include "sbc.h" @@ -1253,7 +1252,6 @@ sbmix_setrecsrc(snd_mixer *m, u_int32_t src) return src; } -#if NPNP > 0 static int sbpnp_probe(device_t dev) { @@ -1329,8 +1327,6 @@ static driver_t sbpnp_driver = { DRIVER_MODULE(sbpnp, isa, sbpnp_driver, pcm_devclass, 0, 0); -#endif /* NPNP > 0 */ - #if NSBC > 0 #define DESCSTR " PCM Audio" static int @@ -1391,7 +1387,3 @@ static driver_t sbsbc_driver = { DRIVER_MODULE(sbsbc, sbc, sbsbc_driver, pcm_devclass, 0, 0); #endif /* NSBC > 0 */ - -#endif /* NPCM > 0 */ - - diff --git a/sys/dev/sound/isa/sbc.c b/sys/dev/sound/isa/sbc.c index 3ebd6945582..67a367c3cf4 100644 --- a/sys/dev/sound/isa/sbc.c +++ b/sys/dev/sound/isa/sbc.c @@ -26,9 +26,7 @@ * $FreeBSD$ */ -#include "sbc.h" #include "isa.h" -#include "pnp.h" #include #include @@ -50,8 +48,6 @@ #endif #endif /* NISA > 0 */ -#if NSBC > 0 - /* Here is the parameter structure per a device. */ struct sbc_softc { device_t dev; /* device */ @@ -68,10 +64,10 @@ struct sbc_softc { typedef struct sbc_softc *sc_p; -#if NISA > 0 && NPNP > 0 +#if NISA > 0 static int sbc_probe(device_t dev); static int sbc_attach(device_t dev); -#endif /* NISA > 0 && NPNP > 0 */ +#endif /* NISA > 0 */ static struct resource *sbc_alloc_resource(device_t bus, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags); static int sbc_release_resource(device_t bus, device_t child, int type, int rid, @@ -82,7 +78,7 @@ static int release_resource(sc_p scp); static devclass_t sbc_devclass; -#if NISA > 0 && NPNP > 0 +#if NISA > 0 static struct isa_pnp_id sbc_ids[] = { #if notdef {0x0000630e, "CS423x"}, @@ -169,7 +165,7 @@ sbc_attach(device_t dev) return (0); } -#endif /* NISA > 0 && NPNP > 0 */ +#endif /* NISA > 0 */ static struct resource * sbc_alloc_resource(device_t bus, device_t child, int type, int *rid, @@ -303,7 +299,7 @@ release_resource(sc_p scp) return (0); } -#if NISA > 0 && NPNP > 0 +#if NISA > 0 static device_method_t sbc_methods[] = { /* Device interface */ DEVMETHOD(device_probe, sbc_probe), @@ -335,6 +331,4 @@ static driver_t sbc_driver = { * sbc can be attached to an isa bus. */ DRIVER_MODULE(sbc, isa, sbc_driver, sbc_devclass, 0, 0); -#endif /* NISA > 0 && NPNP > 0 */ - -#endif /* NSBC > 0 */ +#endif /* NISA > 0 */ diff --git a/sys/dev/sound/pci/aureal.c b/sys/dev/sound/pci/aureal.c index cbbe18f7151..5c8e122f41d 100644 --- a/sys/dev/sound/pci/aureal.c +++ b/sys/dev/sound/pci/aureal.c @@ -36,8 +36,6 @@ #include #include -#if NPCI != 0 - /* PCI IDs of supported chips */ #define AU8820_PCI_ID 0x000112eb @@ -688,6 +686,3 @@ static driver_t au_driver = { static devclass_t pcm_devclass; DRIVER_MODULE(au, pci, au_driver, pcm_devclass, 0, 0); - -#endif /* NPCI != 0 */ - diff --git a/sys/dev/sound/pci/csa.c b/sys/dev/sound/pci/csa.c index eebeda6ad5b..61dcd385710 100644 --- a/sys/dev/sound/pci/csa.c +++ b/sys/dev/sound/pci/csa.c @@ -26,7 +26,6 @@ * $FreeBSD$ */ -#include "csa.h" #include "pci.h" #include @@ -49,8 +48,6 @@ #include #endif /* NPCI > 0 */ -#if NCSA > 0 - #include /* Here is the parameter structure per a device. */ @@ -792,5 +789,3 @@ static driver_t csa_driver = { */ DRIVER_MODULE(csa, pci, csa_driver, csa_devclass, 0, 0); #endif /* NPCI > 0 */ - -#endif /* NCSA > 0 */ diff --git a/sys/dev/sound/pci/csapcm.c b/sys/dev/sound/pci/csapcm.c index 964011d9044..b8d39742aeb 100644 --- a/sys/dev/sound/pci/csapcm.c +++ b/sys/dev/sound/pci/csapcm.c @@ -26,11 +26,6 @@ * $FreeBSD$ */ -#include "opt_devfs.h" -#include "pci.h" -#include "csa.h" -#include "pcm.h" - #include #include #include @@ -41,8 +36,6 @@ #include #include -#if NCSA > 0 - /* device private data */ struct csa_info; @@ -847,5 +840,3 @@ static driver_t pcmcsa_driver = { static devclass_t pcm_devclass; DRIVER_MODULE(pcmcsa, csa, pcmcsa_driver, pcm_devclass, 0, 0); - -#endif /* NCSA > 0 */ diff --git a/sys/dev/sound/pci/es137x.c b/sys/dev/sound/pci/es137x.c index 8f149606600..c413ffe8791 100644 --- a/sys/dev/sound/pci/es137x.c +++ b/sys/dev/sound/pci/es137x.c @@ -62,8 +62,6 @@ #include -#if NPCI != 0 - static int debug = 0; SYSCTL_INT(_debug, OID_AUTO, es_debug, CTLFLAG_RW, &debug, 0, ""); @@ -911,6 +909,3 @@ static driver_t es_driver = { static devclass_t pcm_devclass; DRIVER_MODULE(es, pci, es_driver, pcm_devclass, 0, 0); - - -#endif /* NPCI != 0 */ diff --git a/sys/dev/sound/pci/t4dwave.c b/sys/dev/sound/pci/t4dwave.c index c3e6b413d63..93099628925 100644 --- a/sys/dev/sound/pci/t4dwave.c +++ b/sys/dev/sound/pci/t4dwave.c @@ -36,8 +36,6 @@ #include #include -#if NPCI != 0 - /* -------------------------------------------------------------------- */ struct tr_info; @@ -684,5 +682,3 @@ static driver_t tr_driver = { static devclass_t pcm_devclass; DRIVER_MODULE(tr, pci, tr_driver, pcm_devclass, 0, 0); - -#endif /* NPCI != 0 */ diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 894f56aec11..b464ebd8b3f 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -27,16 +27,7 @@ * $FreeBSD$ */ -#include "opt_devfs.h" - #include -#ifdef DEVFS -#include -#endif /* DEVFS */ - -#if NPCM > 0 /* from "pcm.h" via disgusting #include in snd/sound.h */ - -extern struct isa_driver pcmdriver; static int status_isopen = 0; static int status_init(char *buf, int size); @@ -444,5 +435,3 @@ status_read(struct uio *buf) bufptr += l; return (l > 0)? uiomove(status_buf + bufptr - l, l, buf) : 0; } - -#endif /* NPCM > 0 */ diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index 2b0adcd7448..97cbd0d7cfa 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -119,10 +119,6 @@ struct isa_device { int dummy; }; int fkchan_setup(pcm_channel *c); -#ifdef KERNEL -#include "pnp.h" -#endif /* KERNEL */ - /* * Minor numbers for the sound driver. *