diff options
author | peter <peter@FreeBSD.org> | 1999-12-06 18:26:33 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1999-12-06 18:26:33 +0000 |
commit | 7de5d2d4188cf51ce23905b7e5c99cd44523a0e4 (patch) | |
tree | 3f6b25bd5395886e713aad1c34be32f2679ab6b1 /sys | |
parent | 09d56a3f8fb30923853952ed8a777819e12d5b22 (diff) | |
download | FreeBSD-src-7de5d2d4188cf51ce23905b7e5c99cd44523a0e4.zip FreeBSD-src-7de5d2d4188cf51ce23905b7e5c99cd44523a0e4.tar.gz |
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)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/sound/isa/ad1816.c | 5 | ||||
-rw-r--r-- | sys/dev/sound/isa/es1888.c | 4 | ||||
-rw-r--r-- | sys/dev/sound/isa/gusc.c | 7 | ||||
-rw-r--r-- | sys/dev/sound/isa/mss.c | 17 | ||||
-rw-r--r-- | sys/dev/sound/isa/sb.c | 8 | ||||
-rw-r--r-- | sys/dev/sound/isa/sb16.c | 8 | ||||
-rw-r--r-- | sys/dev/sound/isa/sb8.c | 8 | ||||
-rw-r--r-- | sys/dev/sound/isa/sbc.c | 18 | ||||
-rw-r--r-- | sys/dev/sound/pci/aureal.c | 5 | ||||
-rw-r--r-- | sys/dev/sound/pci/csa.c | 5 | ||||
-rw-r--r-- | sys/dev/sound/pci/csapcm.c | 9 | ||||
-rw-r--r-- | sys/dev/sound/pci/es137x.c | 5 | ||||
-rw-r--r-- | sys/dev/sound/pci/t4dwave.c | 4 | ||||
-rw-r--r-- | sys/dev/sound/pcm/sound.c | 11 | ||||
-rw-r--r-- | 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 5c1cf55..81b22e1 100644 --- a/sys/dev/sound/isa/ad1816.c +++ b/sys/dev/sound/isa/ad1816.c @@ -29,9 +29,6 @@ */ #include <dev/sound/pcm/sound.h> - -#if NPCM > 0 && NPNP > 0 - #include <dev/sound/isa/ad1816.h> 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 8fab6d7..ac166b0 100644 --- a/sys/dev/sound/isa/es1888.c +++ b/sys/dev/sound/isa/es1888.c @@ -29,8 +29,6 @@ #include <dev/sound/pcm/sound.h> #include <dev/sound/isa/sb.h> -#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 b6de776..bde185b 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 <sys/param.h> #include <sys/systm.h> @@ -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 bea3fcc..d1dceb5 100644 --- a/sys/dev/sound/isa/mss.c +++ b/sys/dev/sound/isa/mss.c @@ -30,8 +30,6 @@ #include <dev/sound/pcm/sound.h> -#if NPCM > 0 - /* board-specific include files */ #include <dev/sound/isa/mss.h> #include <dev/sound/chip.h> @@ -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 36f0c4b..bf4949a 100644 --- a/sys/dev/sound/isa/sb.c +++ b/sys/dev/sound/isa/sb.c @@ -32,7 +32,6 @@ */ #include <dev/sound/pcm/sound.h> -#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 36f0c4b..bf4949a 100644 --- a/sys/dev/sound/isa/sb16.c +++ b/sys/dev/sound/isa/sb16.c @@ -32,7 +32,6 @@ */ #include <dev/sound/pcm/sound.h> -#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 36f0c4b..bf4949a 100644 --- a/sys/dev/sound/isa/sb8.c +++ b/sys/dev/sound/isa/sb8.c @@ -32,7 +32,6 @@ */ #include <dev/sound/pcm/sound.h> -#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 3ebd694..67a367c 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 <sys/param.h> #include <sys/systm.h> @@ -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 cbbe18f..5c8e122 100644 --- a/sys/dev/sound/pci/aureal.c +++ b/sys/dev/sound/pci/aureal.c @@ -36,8 +36,6 @@ #include <pci/pcireg.h> #include <pci/pcivar.h> -#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 eebeda6..61dcd38 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 <sys/param.h> @@ -49,8 +48,6 @@ #include <pci/pcivar.h> #endif /* NPCI > 0 */ -#if NCSA > 0 - #include <dev/sound/pci/csaimg.h> /* 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 964011d..b8d3974 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 <sys/soundcard.h> #include <dev/sound/pcm/sound.h> #include <dev/sound/pcm/ac97.h> @@ -41,8 +36,6 @@ #include <pci/pcireg.h> #include <pci/pcivar.h> -#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 8f14960..c413ffe 100644 --- a/sys/dev/sound/pci/es137x.c +++ b/sys/dev/sound/pci/es137x.c @@ -62,8 +62,6 @@ #include <sys/sysctl.h> -#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 c3e6b41..9309962 100644 --- a/sys/dev/sound/pci/t4dwave.c +++ b/sys/dev/sound/pci/t4dwave.c @@ -36,8 +36,6 @@ #include <pci/pcireg.h> #include <pci/pcivar.h> -#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 894f56a..b464ebd 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 <dev/sound/pcm/sound.h> -#ifdef DEVFS -#include <sys/devfsext.h> -#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 2b0adcd..97cbd0d 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. * |