Change the MI audio driver so it attaches to the MD driver in the
normal way. This requires adding a line to the config files to get audio to work again.
This commit is contained in:
parent
f78dfdfe6e
commit
332ad95e76
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: ALPHA,v 1.57 1997/07/13 21:24:15 hpeyerl Exp $
|
||||
# $NetBSD: ALPHA,v 1.58 1997/08/19 23:49:33 augustss Exp $
|
||||
#
|
||||
# Alpha kernel with all the options you'd want, and more.
|
||||
|
||||
|
@ -190,6 +190,7 @@ vga* at isa? # ISA (EISA: XXX) VGA
|
|||
awdc0 at isa? port 0x1f0 irq 14 # ST506/ESDI/IDE controllers
|
||||
awdc1 at isa? port 0x170 irq 15
|
||||
#wss* at isa? port 0x530 irq 9 drq 0 # Windows Sound System
|
||||
#audio* at wss?
|
||||
aha* at isa? port 0x330 irq ? drq ? # Adaptec 154[02] SCSI
|
||||
aha* at isa? port 0x334 irq ? drq ? # Adaptec 154[02] SCSI
|
||||
bha* at isa? port 0x330 irq ? drq ? # BusLogic [57]4X SCSI (unt.)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: BUNNY,v 1.16 1997/04/06 23:03:04 cgd Exp $
|
||||
# $NetBSD: BUNNY,v 1.17 1997/08/19 23:49:34 augustss Exp $
|
||||
#
|
||||
# Kernel for bunnahabhain.pdl.cs.cmu.edu.
|
||||
#
|
||||
|
@ -83,6 +83,7 @@ com* at isa? port 0x3f8 irq 4 # standard serial ports
|
|||
com* at isa? port 0x2f8 irq 3
|
||||
lpt* at isa? port 0x3bc irq 7 # standard parallel port
|
||||
#wss* at isa? port 0x530 irq 9 drq 0 # Windows Sound System
|
||||
#audio* at wss?
|
||||
|
||||
# SCSI bus support
|
||||
scsibus* at ncr?
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: GENERIC,v 1.61 1997/07/31 22:22:08 matt Exp $
|
||||
# $NetBSD: GENERIC,v 1.62 1997/08/19 23:49:35 augustss Exp $
|
||||
#
|
||||
# Generic Alpha kernel. Enough to get booted, etc., but not much more.
|
||||
|
||||
|
@ -154,6 +154,7 @@ vga* at isa? # ISA (EISA: XXX) VGA
|
|||
awdc0 at isa? port 0x1f0 irq 14 # ST506/ESDI/IDE controllers
|
||||
awdc1 at isa? port 0x170 irq 15
|
||||
#wss* at isa? port 0x530 irq 9 drq 0 # Windows Sound System
|
||||
#audio* at wss?
|
||||
aha* at isa? port 0x330 irq ? drq ? # Adaptec 154[02] SCSI
|
||||
aha* at isa? port 0x334 irq ? drq ? # Adaptec 154[02] SCSI
|
||||
bha* at isa? port 0x330 irq ? drq ? # BusLogic [57]4X SCSI (unt.)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: JURA,v 1.15 1997/04/06 23:03:08 cgd Exp $
|
||||
# $NetBSD: JURA,v 1.16 1997/08/19 23:49:36 augustss Exp $
|
||||
#
|
||||
# Kernel for jura.pdl.cs.cmu.edu.
|
||||
#
|
||||
|
@ -60,6 +60,7 @@ com0 at isa? port 0x3f8 irq 4 # standard serial ports
|
|||
com1 at isa? port 0x2f8 irq 3
|
||||
lpt0 at isa? port 0x3bc irq 7 # standard parallel port
|
||||
#wss0 at isa? port 0x530 irq 9 drq 0 # Windows Sound System
|
||||
#audio* at wss?
|
||||
|
||||
jeisa* at ibus?
|
||||
eisa* at jeisa?
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: GENERIC,v 1.81 1997/07/19 00:01:50 is Exp $
|
||||
# $NetBSD: GENERIC,v 1.82 1997/08/19 23:49:37 augustss Exp $
|
||||
|
||||
#
|
||||
# GENERIC AMIGA
|
||||
|
@ -199,6 +199,7 @@ drcom1 at mainbus0 # DraCo serial 1, normally mouse
|
|||
a2kbbc0 at mainbus0 # A2000 battery backed clock
|
||||
a34kbbc0 at mainbus0 # A3000/A4000 battery backed clock
|
||||
aucc* at mainbus0 # Amiga CC audio
|
||||
audio* at aucc?
|
||||
|
||||
# Ethernet cards:
|
||||
le* at zbus0 # A2065, Ameristar, Ariadne
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: aucc.c,v 1.16 1997/07/31 22:33:08 augustss Exp $ */
|
||||
/* $NetBSD: aucc.c,v 1.17 1997/08/19 23:49:40 augustss Exp $ */
|
||||
#undef AUDIO_DEBUG
|
||||
/*
|
||||
* Copyright (c) 1997 Stephan Thesing
|
||||
|
@ -262,9 +262,7 @@ auccattach(parent, self, args)
|
|||
return;
|
||||
}
|
||||
|
||||
if (audio_hardware_attach(&sa_hw_if, sc, &sc->sc_dev) != 0)
|
||||
printf("audio: could not attach to audio pseudo-device driver\n");
|
||||
/* XXX: no way to return error, if init fails */
|
||||
audio_attach_mi(&sa_hw_if, 0, sc, &sc->sc_dev);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -165,6 +165,7 @@ beep0 at mainbus? base 0x00000000
|
|||
|
||||
# Audio device
|
||||
vidcaudio0 at mainbus? base 0x00000000
|
||||
audio* at vidcaudio0
|
||||
|
||||
# IIC bus device
|
||||
iic0 at mainbus?
|
||||
|
|
|
@ -168,6 +168,7 @@ lpt0 at mainbus? base 0x002109e0 irq 0
|
|||
# RC7500 companded audio device
|
||||
#
|
||||
#vidcaudio0 at mainbus? base 0x00000000
|
||||
#audio* at vidcaudio0
|
||||
|
||||
# Crude sound device
|
||||
#beep0 at mainbus? base 0x00000000 irq 31
|
||||
|
|
|
@ -172,6 +172,7 @@ beep0 at mainbus? base 0x00000000
|
|||
|
||||
# Audio device
|
||||
vidcaudio0 at mainbus? base 0x00000000
|
||||
audio* at vidcaudio0
|
||||
|
||||
# IIC bus device
|
||||
iic0 at mainbus?
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: lmcaudio.c,v 1.11 1997/07/31 22:33:11 augustss Exp $ */
|
||||
/* $NetBSD: lmcaudio.c,v 1.12 1997/08/19 23:49:44 augustss Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996, Danny C Tsen.
|
||||
|
@ -108,7 +108,6 @@ void lmcaudio_dummy_routine __P((void *arg));
|
|||
int lmcaudio_stereo __P((int channel, int position));
|
||||
int lmcaudio_rate __P((int rate));
|
||||
void lmcaudio_shutdown __P((void));
|
||||
int lmcaudio_hw_attach __P((struct lmcaudio_softc *sc));
|
||||
|
||||
|
||||
struct cfattach lmcaudio_ca = {
|
||||
|
@ -234,8 +233,7 @@ lmcaudio_attach(parent, self, aux)
|
|||
|
||||
lmcaudio_beep_generate();
|
||||
|
||||
lmcaudio_hw_attach(sc);
|
||||
|
||||
audio_attach_mi(&lmcaudio_hw_if, 0, sc, &sc->device);
|
||||
}
|
||||
|
||||
int nauzero = 0;
|
||||
|
@ -612,13 +610,6 @@ lmcaudio_dummy_routine(arg)
|
|||
{
|
||||
}
|
||||
|
||||
int
|
||||
lmcaudio_hw_attach(sc)
|
||||
struct lmcaudio_softc *sc;
|
||||
{
|
||||
return(audio_hardware_attach(&lmcaudio_hw_if, sc, &sc->device));
|
||||
}
|
||||
|
||||
int
|
||||
lmcaudio_rate(rate)
|
||||
int rate;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: vidcaudio.c,v 1.16 1997/07/31 22:33:13 augustss Exp $ */
|
||||
/* $NetBSD: vidcaudio.c,v 1.17 1997/08/19 23:49:45 augustss Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995 Melvin Tang-Richardson
|
||||
|
@ -107,7 +107,6 @@ void vidcaudio_dummy_routine __P((void *arg));
|
|||
int vidcaudio_stereo __P((int channel, int position));
|
||||
int vidcaudio_rate __P((int rate));
|
||||
void vidcaudio_shutdown __P((void));
|
||||
int vidcaudio_hw_attach __P((struct vidcaudio_softc *sc));
|
||||
|
||||
static int sound_dma_intr;
|
||||
|
||||
|
@ -228,7 +227,7 @@ vidcaudio_attach(parent, self, aux)
|
|||
vidcaudio_dma_program(ag.silence, ag.silence+NBPG-16,
|
||||
vidcaudio_dummy_routine, NULL);
|
||||
|
||||
vidcaudio_hw_attach(sc);
|
||||
audio_attach_mi(&vidcaudio_hw_if, 0, sc, &sc->device);
|
||||
|
||||
printf("\n");
|
||||
|
||||
|
@ -524,11 +523,6 @@ void vidcaudio_dummy_routine ( void *arg )
|
|||
#endif
|
||||
}
|
||||
|
||||
int vidcaudio_hw_attach ( struct vidcaudio_softc *sc )
|
||||
{
|
||||
return ( audio_hardware_attach ( &vidcaudio_hw_if, sc, &sc->device ) );
|
||||
}
|
||||
|
||||
int vidcaudio_rate ( int rate )
|
||||
{
|
||||
WriteWord ( VIDC_BASE, VIDC_SFR | rate );
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: lmcaudio.c,v 1.11 1997/07/31 22:33:11 augustss Exp $ */
|
||||
/* $NetBSD: lmcaudio.c,v 1.12 1997/08/19 23:49:44 augustss Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996, Danny C Tsen.
|
||||
|
@ -108,7 +108,6 @@ void lmcaudio_dummy_routine __P((void *arg));
|
|||
int lmcaudio_stereo __P((int channel, int position));
|
||||
int lmcaudio_rate __P((int rate));
|
||||
void lmcaudio_shutdown __P((void));
|
||||
int lmcaudio_hw_attach __P((struct lmcaudio_softc *sc));
|
||||
|
||||
|
||||
struct cfattach lmcaudio_ca = {
|
||||
|
@ -234,8 +233,7 @@ lmcaudio_attach(parent, self, aux)
|
|||
|
||||
lmcaudio_beep_generate();
|
||||
|
||||
lmcaudio_hw_attach(sc);
|
||||
|
||||
audio_attach_mi(&lmcaudio_hw_if, 0, sc, &sc->device);
|
||||
}
|
||||
|
||||
int nauzero = 0;
|
||||
|
@ -612,13 +610,6 @@ lmcaudio_dummy_routine(arg)
|
|||
{
|
||||
}
|
||||
|
||||
int
|
||||
lmcaudio_hw_attach(sc)
|
||||
struct lmcaudio_softc *sc;
|
||||
{
|
||||
return(audio_hardware_attach(&lmcaudio_hw_if, sc, &sc->device));
|
||||
}
|
||||
|
||||
int
|
||||
lmcaudio_rate(rate)
|
||||
int rate;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: vidcaudio.c,v 1.16 1997/07/31 22:33:13 augustss Exp $ */
|
||||
/* $NetBSD: vidcaudio.c,v 1.17 1997/08/19 23:49:45 augustss Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995 Melvin Tang-Richardson
|
||||
|
@ -107,7 +107,6 @@ void vidcaudio_dummy_routine __P((void *arg));
|
|||
int vidcaudio_stereo __P((int channel, int position));
|
||||
int vidcaudio_rate __P((int rate));
|
||||
void vidcaudio_shutdown __P((void));
|
||||
int vidcaudio_hw_attach __P((struct vidcaudio_softc *sc));
|
||||
|
||||
static int sound_dma_intr;
|
||||
|
||||
|
@ -228,7 +227,7 @@ vidcaudio_attach(parent, self, aux)
|
|||
vidcaudio_dma_program(ag.silence, ag.silence+NBPG-16,
|
||||
vidcaudio_dummy_routine, NULL);
|
||||
|
||||
vidcaudio_hw_attach(sc);
|
||||
audio_attach_mi(&vidcaudio_hw_if, 0, sc, &sc->device);
|
||||
|
||||
printf("\n");
|
||||
|
||||
|
@ -524,11 +523,6 @@ void vidcaudio_dummy_routine ( void *arg )
|
|||
#endif
|
||||
}
|
||||
|
||||
int vidcaudio_hw_attach ( struct vidcaudio_softc *sc )
|
||||
{
|
||||
return ( audio_hardware_attach ( &vidcaudio_hw_if, sc, &sc->device ) );
|
||||
}
|
||||
|
||||
int vidcaudio_rate ( int rate )
|
||||
{
|
||||
WriteWord ( VIDC_BASE, VIDC_SFR | rate );
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: DISKLESS,v 1.44 1997/07/02 02:44:09 cjs Exp $
|
||||
# $NetBSD: DISKLESS,v 1.45 1997/08/19 23:49:46 augustss Exp $
|
||||
#
|
||||
# DISKLESS -- Generic machine setup for diskless boot.
|
||||
# This kernel can be loaded from a bootable floppy (i.e. kernel-copy)
|
||||
|
@ -193,11 +193,16 @@ fpa* at pci? dev ? function ? # DEC DEFPA FDDI cards
|
|||
|
||||
#pss0 at isa? port 0x220 irq 7 drq 6 # Personal Sound System
|
||||
#sp0 at pss0 port 0x530 irq 10 drq 0 # sound port driver
|
||||
#audio* at sp0
|
||||
|
||||
#sb0 at isa? port 0x220 irq 7 drq 1 # SoundBlaster
|
||||
#audio* at sb0
|
||||
#wss0 at isa? port 0x530 irq 10 drq 0 # Windows Sound System
|
||||
#audio* at wss0
|
||||
#pas0 at isa? port 0x220 irq 7 drq 1 # ProAudio Spectrum
|
||||
#audio* at pas0
|
||||
#gus0 at isa? port 0x220 irq 7 drq 1 flags 6 # Gravis Ultra Sound (flags is record drq for full-duplex)
|
||||
#audio* at gus0
|
||||
#spkr0 at pckbd? port 0x61
|
||||
|
||||
# Joystick driver. Probe is a little strange; add only if you have one.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: GENERIC,v 1.91 1997/08/15 21:44:31 perry Exp $
|
||||
# $NetBSD: GENERIC,v 1.92 1997/08/19 23:49:47 augustss Exp $
|
||||
#
|
||||
# GENERIC -- everything that's currently supported
|
||||
#
|
||||
|
@ -211,12 +211,17 @@ fxp* at pci? dev ? function ? # Intel EEPRO 10/100B
|
|||
|
||||
pss0 at isa? port 0x220 irq 7 drq 6 # Personal Sound System
|
||||
sp0 at pss0 port 0x530 irq 10 drq 0 # sound port driver
|
||||
audio* at sp0
|
||||
|
||||
sb0 at isa? port 0x220 irq 7 drq 1 # SoundBlaster
|
||||
sb* at isapnp?
|
||||
audio* at sb?
|
||||
wss0 at isa? port 0x530 irq 10 drq 0 # Windows Sound System
|
||||
audio* at wss0
|
||||
pas0 at isa? port 0x220 irq 7 drq 1 # ProAudio Spectrum
|
||||
audio* at pas0
|
||||
gus0 at isa? port 0x220 irq 7 drq 1 flags 6 # Gravis Ultra Sound (flags is record drq for full-duplex)
|
||||
audio* at gus0
|
||||
#spkr0 at pckbd? port 0x61
|
||||
|
||||
# Joystick driver. Probe is a little strange; add only if you have one.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: HOMEWORLD,v 1.17 1997/07/02 02:44:11 cjs Exp $
|
||||
# $NetBSD: HOMEWORLD,v 1.18 1997/08/19 23:49:48 augustss Exp $
|
||||
#
|
||||
# HOMEWORLD - Mail, CVS, and GNATS server
|
||||
#
|
||||
|
@ -204,11 +204,16 @@ ed0 at isa? port 0x300 irq 9 # NE2000 ethernet
|
|||
|
||||
#pss0 at isa? port 0x220 irq 7 drq 6 # Personal Sound System
|
||||
#sp0 at pss0 port 0x530 irq 10 drq 0 # sound port driver
|
||||
#audio* at sp0
|
||||
|
||||
#sb0 at isa? port 0x220 irq 7 drq 1 # SoundBlaster
|
||||
#audio* at sb0
|
||||
#wss0 at isa? port 0x530 irq 10 drq 0 # Windows Sound System
|
||||
#audio* at wss0
|
||||
#pas0 at isa? port 0x220 irq 7 drq 1 # ProAudio Spectrum
|
||||
#audio* at pas0
|
||||
#gus0 at isa? port 0x220 irq 7 drq 1 flags 6 # Gravis Ultra Sound (flags is record drq for full-duplex)
|
||||
#audio* at gus0
|
||||
#spkr0 at pckbd? port 0x61
|
||||
|
||||
# Joystick driver. Probe is a little strange; add only if you have one.
|
||||
|
@ -218,6 +223,7 @@ ed0 at isa? port 0x300 irq 9 # NE2000 ethernet
|
|||
#isapnp0 at isa?
|
||||
#ep* at isapnp?
|
||||
#sb* at isapnp?
|
||||
#audio* at sb?
|
||||
#joy* at isapnp?
|
||||
|
||||
#include "arch/i386/conf/GENERIC.local"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: INSTALL,v 1.43 1997/08/03 05:30:14 mikel Exp $
|
||||
# $NetBSD: INSTALL,v 1.44 1997/08/19 23:49:49 augustss Exp $
|
||||
#
|
||||
# INSTALL -- an installation kernel config.
|
||||
# This kernel should be derived from GENERIC with ramdisk
|
||||
|
@ -220,12 +220,17 @@ fxp* at pci? dev ? function ? # Intel EEPRO 10/100B
|
|||
|
||||
#pss0 at isa? port 0x220 irq 7 drq 6 # Personal Sound System
|
||||
#sp0 at pss0 port 0x530 irq 10 drq 0 # sound port driver
|
||||
#audio* at sp0
|
||||
|
||||
#sb0 at isa? port 0x220 irq 7 drq 1 # SoundBlaster
|
||||
#sb* at isapnp?
|
||||
#audio* at sb?
|
||||
#wss0 at isa? port 0x530 irq 10 drq 0 # Windows Sound System
|
||||
#audio* at wss0
|
||||
#pas0 at isa? port 0x220 irq 7 drq 1 # ProAudio Spectrum
|
||||
#audio* at pas0
|
||||
#gus0 at isa? port 0x220 irq 7 drq 1 flags 6 # Gravis Ultra Sound (flags is record drq for full-duplex)
|
||||
#audio* at gus0
|
||||
#spkr0 at pckbd? port 0x61
|
||||
|
||||
# Joystick driver. Probe is a little strange; add only if you have one.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: SUN_LAMP,v 1.88 1997/06/25 04:41:20 mellon Exp $
|
||||
# $NetBSD: SUN_LAMP,v 1.89 1997/08/19 23:49:50 augustss Exp $
|
||||
#
|
||||
# SUN_LAMP -- kernel for one of cgd's 486/50 EISA boxes...
|
||||
#
|
||||
|
@ -162,6 +162,7 @@ ed0 at isa? port 0x300 iomem 0xd0000 irq 10 # WD/SMC, 3C503, and NE[12]000
|
|||
#le0 at isa? port 0x320 irq 10 drq 7 # IsoLan, NE2100, and DEPCA
|
||||
|
||||
#sb0 at isa? port 0x220 irq 7 drq 1 # SoundBlaster
|
||||
#audio* at sb0
|
||||
#spkr0 at isa? port 0x61
|
||||
|
||||
pseudo-device loop 1 # network loopback
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: WARPED,v 1.23 1997/07/18 04:14:34 thorpej Exp $
|
||||
# $NetBSD: WARPED,v 1.24 1997/08/19 23:49:50 augustss Exp $
|
||||
#
|
||||
# WARPED - ftp/sup.netbsd.org server machine
|
||||
#
|
||||
|
@ -196,11 +196,16 @@ de* at pci? dev ? function ? # DC21X4X-based ethernet cards
|
|||
|
||||
#pss0 at isa? port 0x220 irq 7 drq 6 # Personal Sound System
|
||||
#sp0 at pss0 port 0x530 irq 10 drq 0 # sound port driver
|
||||
#audio* at sp0
|
||||
|
||||
#sb0 at isa? port 0x220 irq 7 drq 1 # SoundBlaster
|
||||
#audio* at sb0
|
||||
#wss0 at isa? port 0x530 irq 10 drq 0 # Windows Sound System
|
||||
#audio* at wss0
|
||||
#pas0 at isa? port 0x220 irq 7 drq 1 # ProAudio Spectrum
|
||||
#audio* at pas0
|
||||
#gus0 at isa? port 0x220 irq 7 drq 1 flags 6 # Gravis Ultra Sound (flags is record drq for full-duplex)
|
||||
#audio* at gus0
|
||||
#spkr0 at pckbd? port 0x61
|
||||
|
||||
# Joystick driver. Probe is a little strange; add only if you have one.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: GENERIC,v 1.45 1997/07/07 21:54:51 pk Exp $
|
||||
# $NetBSD: GENERIC,v 1.46 1997/08/19 23:49:52 augustss Exp $
|
||||
|
||||
include "arch/sparc/conf/std.sparc"
|
||||
|
||||
|
@ -85,9 +85,12 @@ vmel0 at mainbus0 # sun4
|
|||
iommu0 at mainbus0 # sun4m
|
||||
sbus0 at iommu0 # sun4m
|
||||
|
||||
audio0 at mainbus0 # sun4c
|
||||
audio0 at obio0 # sun4m
|
||||
audio0 at sbus0 slot ? offset ? # sun4m
|
||||
audioamd0 at mainbus0 # sun4c
|
||||
audio* at audioamd0
|
||||
audioamd0 at obio0 # sun4m
|
||||
audio* at audioamd0
|
||||
audioamd0 at sbus0 slot ? offset ? # sun4m
|
||||
audio* at audioamd0
|
||||
|
||||
auxreg0 at mainbus0 # sun4c
|
||||
auxreg0 at obio0 # sun4m
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: files.sparc,v 1.40 1997/07/07 21:53:43 pk Exp $
|
||||
# $NetBSD: files.sparc,v 1.41 1997/08/19 23:49:52 augustss Exp $
|
||||
|
||||
# @(#)files.sparc 8.1 (Berkeley) 7/19/93
|
||||
# sparc-specific configuration info
|
||||
|
@ -94,8 +94,8 @@ device esp: scsi, ncr53c9x
|
|||
attach esp at sbus, dma, obio
|
||||
file arch/sparc/dev/esp.c esp
|
||||
|
||||
device audio
|
||||
attach audio at mainbus, obio, sbus
|
||||
device audioamd
|
||||
attach audioamd at mainbus, obio, sbus
|
||||
file arch/sparc/dev/amd7930.c audio
|
||||
file arch/sparc/sparc/amd7930intr.s audio
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: am7930_sparc.c,v 1.26 1997/07/31 22:33:14 augustss Exp $ */
|
||||
/* $NetBSD: am7930_sparc.c,v 1.27 1997/08/19 23:49:54 augustss Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995 Rolf Grossmann
|
||||
|
@ -112,18 +112,18 @@ static void init_amd __P((volatile struct amd7930 *));
|
|||
void amd7930attach __P((struct device *, struct device *, void *));
|
||||
int amd7930match __P((struct device *, struct cfdata *, void *));
|
||||
|
||||
struct cfattach audio_ca = {
|
||||
struct cfattach audioamd_ca = {
|
||||
sizeof(struct amd7930_softc), amd7930match, amd7930attach
|
||||
};
|
||||
|
||||
struct cfdriver audio_cd = {
|
||||
NULL, "audio", DV_DULL
|
||||
struct cfdriver audioamd_cd = {
|
||||
NULL, "audioamd", DV_DULL
|
||||
};
|
||||
|
||||
struct audio_device amd7930_device = {
|
||||
"amd7930",
|
||||
"x",
|
||||
"audio"
|
||||
"audioamd"
|
||||
};
|
||||
|
||||
/* Write 16 bits of data from variable v to the data port of the audio chip */
|
||||
|
@ -325,8 +325,7 @@ amd7930attach(parent, self, args)
|
|||
|
||||
evcnt_attach(&sc->sc_dev, "intr", &sc->sc_intrcnt);
|
||||
|
||||
if (audio_hardware_attach(&sa_hw_if, sc, &sc->sc_dev) != 0)
|
||||
printf("audio: could not attach to audio pseudo-device driver\n");
|
||||
audio_attach_mi(&sa_hw_if, 0, sc, &sc->sc_dev);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: amd7930.c,v 1.26 1997/07/31 22:33:14 augustss Exp $ */
|
||||
/* $NetBSD: amd7930.c,v 1.27 1997/08/19 23:49:54 augustss Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995 Rolf Grossmann
|
||||
|
@ -112,18 +112,18 @@ static void init_amd __P((volatile struct amd7930 *));
|
|||
void amd7930attach __P((struct device *, struct device *, void *));
|
||||
int amd7930match __P((struct device *, struct cfdata *, void *));
|
||||
|
||||
struct cfattach audio_ca = {
|
||||
struct cfattach audioamd_ca = {
|
||||
sizeof(struct amd7930_softc), amd7930match, amd7930attach
|
||||
};
|
||||
|
||||
struct cfdriver audio_cd = {
|
||||
NULL, "audio", DV_DULL
|
||||
struct cfdriver audioamd_cd = {
|
||||
NULL, "audioamd", DV_DULL
|
||||
};
|
||||
|
||||
struct audio_device amd7930_device = {
|
||||
"amd7930",
|
||||
"x",
|
||||
"audio"
|
||||
"audioamd"
|
||||
};
|
||||
|
||||
/* Write 16 bits of data from variable v to the data port of the audio chip */
|
||||
|
@ -325,8 +325,7 @@ amd7930attach(parent, self, args)
|
|||
|
||||
evcnt_attach(&sc->sc_dev, "intr", &sc->sc_intrcnt);
|
||||
|
||||
if (audio_hardware_attach(&sa_hw_if, sc, &sc->sc_dev) != 0)
|
||||
printf("audio: could not attach to audio pseudo-device driver\n");
|
||||
audio_attach_mi(&sa_hw_if, 0, sc, &sc->sc_dev);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: files,v 1.133 1997/08/03 20:33:58 leo Exp $
|
||||
# $NetBSD: files,v 1.134 1997/08/19 23:49:55 augustss Exp $
|
||||
|
||||
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
|
||||
|
||||
|
@ -14,13 +14,17 @@ define disk
|
|||
define tape
|
||||
define ifnet
|
||||
define tty
|
||||
define audio
|
||||
define audio { }
|
||||
define scsi { [channel = -1] }
|
||||
|
||||
# audio device attributes
|
||||
define mulaw
|
||||
define auconv
|
||||
|
||||
# audio device, attaches to audio hardware driver
|
||||
device audio
|
||||
attach audio at audio
|
||||
|
||||
# net device attributes - we have generic code for arc(net), ether(net),
|
||||
# fddi, and atm.
|
||||
define arc
|
||||
|
|
333
sys/dev/audio.c
333
sys/dev/audio.c
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: audio.c,v 1.66 1997/08/18 23:20:09 augustss Exp $ */
|
||||
/* $NetBSD: audio.c,v 1.67 1997/08/19 23:49:56 augustss Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1991-1993 Regents of the University of California.
|
||||
|
@ -98,9 +98,6 @@ int audiodebug = 0;
|
|||
|
||||
int audio_blk_ms = AUDIO_BLK_MS;
|
||||
|
||||
struct audio_softc **audio_softc;
|
||||
int naudio = 0; /* Current size of audio_softc */
|
||||
|
||||
int audiosetinfo __P((struct audio_softc *, struct audio_info *));
|
||||
int audiogetinfo __P((struct audio_softc *, struct audio_info *));
|
||||
|
||||
|
@ -130,7 +127,6 @@ void audio_calc_blksize __P((struct audio_softc *, int));
|
|||
void audio_fill_silence __P((struct audio_params *, u_char *, int));
|
||||
int audio_silence_copyout __P((struct audio_softc *, int, struct uio *));
|
||||
|
||||
int audio_hardware_attach __P((struct audio_hw_if *, void *, struct device *));
|
||||
void audio_init_ringbuffer __P((struct audio_ringbuffer *));
|
||||
void audio_initbufs __P((struct audio_softc *));
|
||||
void audio_calcwater __P((struct audio_softc *));
|
||||
|
@ -144,10 +140,138 @@ static __inline void audio_pint_silence __P((struct audio_softc *, struct audio_
|
|||
int audio_alloc_ring __P((struct audio_softc *, struct audio_ringbuffer *, int));
|
||||
void audio_free_ring __P((struct audio_softc *, struct audio_ringbuffer *));
|
||||
|
||||
int audioprint __P((void *, const char *));
|
||||
|
||||
#ifdef __BROKEN_INDIRECT_CONFIG
|
||||
int audioprobe __P((struct device *, void *, void *));
|
||||
#else
|
||||
int audioprobe __P((struct device *, struct cfdata *, void *));
|
||||
#endif
|
||||
void audioattach __P((struct device *, struct device *, void *));
|
||||
|
||||
/* The default audio mode: 8 kHz mono ulaw */
|
||||
struct audio_params audio_default =
|
||||
{ 8000, AUDIO_ENCODING_ULAW, 8, 1, 0, 1 };
|
||||
|
||||
struct cfattach audio_ca = {
|
||||
sizeof(struct audio_softc), audioprobe, audioattach
|
||||
};
|
||||
|
||||
struct cfdriver audio_cd = {
|
||||
NULL, "audio", DV_DULL
|
||||
};
|
||||
|
||||
struct audio_attach_args {
|
||||
struct audio_hw_if *ahw;
|
||||
struct midi_hw_if *mhw;
|
||||
void *hdl;
|
||||
};
|
||||
|
||||
int
|
||||
audioprobe(parent, match, aux)
|
||||
struct device *parent;
|
||||
#ifdef __BROKEN_INDIRECT_CONFIG
|
||||
void *match;
|
||||
#else
|
||||
struct cfdata *match;
|
||||
#endif
|
||||
void *aux;
|
||||
{
|
||||
struct audio_attach_args *sa = aux;
|
||||
|
||||
return sa->ahw != 0;
|
||||
}
|
||||
|
||||
void
|
||||
audioattach(parent, self, aux)
|
||||
struct device *parent, *self;
|
||||
void *aux;
|
||||
{
|
||||
struct audio_softc *sc = (void *)self;
|
||||
struct audio_attach_args *sa = aux;
|
||||
struct audio_hw_if *hwp = sa->ahw;
|
||||
void *hdlp = sa->hdl;
|
||||
int error;
|
||||
|
||||
printf("\n");
|
||||
|
||||
#ifdef DIAGNOSTIC
|
||||
if (hwp == 0 ||
|
||||
hwp->open == 0 ||
|
||||
hwp->close == 0 ||
|
||||
hwp->query_encoding == 0 ||
|
||||
hwp->set_params == 0 ||
|
||||
hwp->set_out_port == 0 ||
|
||||
hwp->get_out_port == 0 ||
|
||||
hwp->set_in_port == 0 ||
|
||||
hwp->get_in_port == 0 ||
|
||||
hwp->start_output == 0 ||
|
||||
hwp->start_input == 0 ||
|
||||
hwp->halt_output == 0 ||
|
||||
hwp->halt_input == 0 ||
|
||||
hwp->cont_output == 0 ||
|
||||
hwp->cont_input == 0 ||
|
||||
hwp->getdev == 0 ||
|
||||
hwp->set_port == 0 ||
|
||||
hwp->get_port == 0 ||
|
||||
hwp->query_devinfo == 0 ||
|
||||
hwp->get_props == 0) {
|
||||
printf("audio: missing method\n");
|
||||
sc->hw_if = 0;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
sc->hw_if = hwp;
|
||||
sc->hw_hdl = hdlp;
|
||||
sc->sc_dev = parent;
|
||||
|
||||
error = audio_alloc_ring(sc, &sc->sc_pr, AU_RING_SIZE);
|
||||
if (error) {
|
||||
sc->hw_if = 0;
|
||||
return;
|
||||
}
|
||||
error = audio_alloc_ring(sc, &sc->sc_rr, AU_RING_SIZE);
|
||||
if (error) {
|
||||
audio_free_ring(sc, &sc->sc_pr);
|
||||
sc->hw_if = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set default softc params
|
||||
*/
|
||||
sc->sc_pparams = audio_default;
|
||||
sc->sc_rparams = audio_default;
|
||||
|
||||
/* Set up some default values */
|
||||
sc->sc_blkset = 0;
|
||||
audio_calc_blksize(sc, AUMODE_RECORD);
|
||||
audio_calc_blksize(sc, AUMODE_PLAY);
|
||||
audio_init_ringbuffer(&sc->sc_rr);
|
||||
audio_init_ringbuffer(&sc->sc_pr);
|
||||
audio_calcwater(sc);
|
||||
}
|
||||
|
||||
/*
|
||||
* Called from hardware driver. This is where the MI audio driver gets
|
||||
* probed/attached to the hardare driver.
|
||||
*/
|
||||
void
|
||||
audio_attach_mi(ahwp, mhwp, hdlp, dev)
|
||||
struct audio_hw_if *ahwp;
|
||||
struct midi_hw_if *mhwp;
|
||||
void *hdlp;
|
||||
struct device *dev;
|
||||
{
|
||||
struct audio_attach_args arg;
|
||||
|
||||
arg.ahw = ahwp;
|
||||
arg.mhw = mhwp;
|
||||
arg.hdl = hdlp;
|
||||
(void)config_found(dev, &arg, 0);
|
||||
}
|
||||
|
||||
#ifdef AUDIO_DEBUG
|
||||
void audio_printsc __P((struct audio_softc *));
|
||||
void audio_print_params __P((char *, struct audio_params *));
|
||||
|
@ -213,136 +337,6 @@ audio_free_ring(sc, r)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Called from hardware driver.
|
||||
*/
|
||||
int
|
||||
audio_hardware_attach(hwp, hdlp, dev)
|
||||
struct audio_hw_if *hwp;
|
||||
void *hdlp;
|
||||
struct device *dev;
|
||||
{
|
||||
struct audio_softc *sc;
|
||||
int error;
|
||||
int n;
|
||||
|
||||
/* Find a free slot. */
|
||||
for(n = 0; n < naudio && audio_softc[n]; n++)
|
||||
;
|
||||
if (n >= naudio) {
|
||||
/* No free slots, allocate one */
|
||||
struct audio_softc **new;
|
||||
|
||||
naudio++;
|
||||
new = malloc(naudio * sizeof(struct audio_softc *),
|
||||
M_DEVBUF, M_WAITOK);
|
||||
if (audio_softc) {
|
||||
bcopy(audio_softc, new, n * sizeof(struct audio_softc *));
|
||||
free(audio_softc, M_DEVBUF);
|
||||
}
|
||||
audio_softc = new;
|
||||
audio_softc[n] = 0;
|
||||
}
|
||||
|
||||
/* Malloc a softc for the device. */
|
||||
sc = malloc(sizeof(struct audio_softc), M_DEVBUF, M_WAITOK);
|
||||
bzero(sc, sizeof(struct audio_softc));
|
||||
|
||||
#ifdef DIAGNOSTIC
|
||||
if (hwp == 0 ||
|
||||
hwp->open == 0 ||
|
||||
hwp->close == 0 ||
|
||||
hwp->query_encoding == 0 ||
|
||||
hwp->set_params == 0 ||
|
||||
hwp->set_out_port == 0 ||
|
||||
hwp->get_out_port == 0 ||
|
||||
hwp->set_in_port == 0 ||
|
||||
hwp->get_in_port == 0 ||
|
||||
hwp->start_output == 0 ||
|
||||
hwp->start_input == 0 ||
|
||||
hwp->halt_output == 0 ||
|
||||
hwp->halt_input == 0 ||
|
||||
hwp->cont_output == 0 ||
|
||||
hwp->cont_input == 0 ||
|
||||
hwp->getdev == 0 ||
|
||||
hwp->set_port == 0 ||
|
||||
hwp->get_port == 0 ||
|
||||
hwp->query_devinfo == 0 ||
|
||||
hwp->get_props == 0) {
|
||||
printf("audio: missing method\n");
|
||||
free(sc, M_DEVBUF);
|
||||
return(EINVAL);
|
||||
}
|
||||
#endif
|
||||
|
||||
sc->hw_if = hwp;
|
||||
sc->hw_hdl = hdlp;
|
||||
sc->sc_dev = dev;
|
||||
|
||||
error = audio_alloc_ring(sc, &sc->sc_pr, AU_RING_SIZE);
|
||||
if (error)
|
||||
return error;
|
||||
error = audio_alloc_ring(sc, &sc->sc_rr, AU_RING_SIZE);
|
||||
if (error) {
|
||||
audio_free_ring(sc, &sc->sc_pr);
|
||||
return error;
|
||||
}
|
||||
|
||||
audio_softc[n] = sc;
|
||||
|
||||
/*
|
||||
* Set default softc params
|
||||
*/
|
||||
sc->sc_pparams = audio_default;
|
||||
sc->sc_rparams = audio_default;
|
||||
|
||||
/* Set up some default values */
|
||||
sc->sc_blkset = 0;
|
||||
audio_calc_blksize(sc, AUMODE_RECORD);
|
||||
audio_calc_blksize(sc, AUMODE_PLAY);
|
||||
audio_init_ringbuffer(&sc->sc_rr);
|
||||
audio_init_ringbuffer(&sc->sc_pr);
|
||||
audio_calcwater(sc);
|
||||
|
||||
printf("audio%d at %s\n", n, dev->dv_xname);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
int
|
||||
audio_hardware_detach(hwp, hdlp)
|
||||
struct audio_hw_if *hwp;
|
||||
void *hdlp;
|
||||
{
|
||||
struct audio_softc *sc;
|
||||
int n;
|
||||
|
||||
#ifdef DIAGNOSTIC
|
||||
if (!hwp)
|
||||
panic("audio_hardware_detach: null hwp");
|
||||
#endif
|
||||
for(sc = 0, n = 0; n < naudio; n++) {
|
||||
sc = audio_softc[n];
|
||||
if (sc && sc->hw_if == hwp && sc->hw_hdl == hdlp)
|
||||
break;
|
||||
}
|
||||
|
||||
if (n >= naudio)
|
||||
return(EINVAL);
|
||||
|
||||
if (sc->sc_open)
|
||||
return(EBUSY);
|
||||
|
||||
/* Free audio buffers */
|
||||
audio_free_ring(sc, &sc->sc_rr);
|
||||
audio_free_ring(sc, &sc->sc_pr);
|
||||
|
||||
free(sc, M_DEVBUF);
|
||||
audio_softc[n] = 0;
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
int
|
||||
audioopen(dev, flags, ifmt, p)
|
||||
dev_t dev;
|
||||
|
@ -610,21 +604,14 @@ audio_open(dev, flags, ifmt, p)
|
|||
int error;
|
||||
struct audio_hw_if *hw;
|
||||
|
||||
if (unit >= naudio || !audio_softc[unit]) {
|
||||
DPRINTF(("audio_open: invalid device unit - %d\n", unit));
|
||||
return (ENODEV);
|
||||
}
|
||||
|
||||
sc = audio_softc[unit];
|
||||
sc = audio_cd.cd_devs[unit];
|
||||
if (!sc)
|
||||
return ENXIO;
|
||||
hw = sc->hw_if;
|
||||
if (!hw)
|
||||
return ENXIO;
|
||||
|
||||
DPRINTF(("audio_open: dev=0x%x flags=0x%x sc=%p hdl=%p\n", dev, flags, sc, sc->hw_hdl));
|
||||
#ifdef DIAGNOSTIC
|
||||
if (hw == 0) { /* Hardware has not attached to us... */
|
||||
printf("audio_open: hw==0\n");
|
||||
return (ENXIO);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (ISDEVAUDIOCTL(dev))
|
||||
return 0;
|
||||
|
@ -785,6 +772,12 @@ audio_drain(sc)
|
|||
* XXX This should be done some other way to avoid
|
||||
* playing silence.
|
||||
*/
|
||||
#ifdef DIAGNOSTIC
|
||||
if (cb->copying) {
|
||||
printf("audio_drain: copying in progress!?!\n");
|
||||
cb->copying = 0;
|
||||
}
|
||||
#endif
|
||||
drops = cb->drops;
|
||||
while (cb->drops == drops) {
|
||||
DPRINTF(("audio_drain: used=%d, drops=%ld\n", sc->sc_pr.used, cb->drops));
|
||||
|
@ -810,7 +803,7 @@ audio_close(dev, flags, ifmt, p)
|
|||
struct proc *p;
|
||||
{
|
||||
int unit = AUDIOUNIT(dev);
|
||||
struct audio_softc *sc = audio_softc[unit];
|
||||
struct audio_softc *sc = audio_cd.cd_devs[unit];
|
||||
struct audio_hw_if *hw = sc->hw_if;
|
||||
int s;
|
||||
|
||||
|
@ -851,7 +844,7 @@ audio_read(dev, uio, ioflag)
|
|||
int ioflag;
|
||||
{
|
||||
int unit = AUDIOUNIT(dev);
|
||||
struct audio_softc *sc = audio_softc[unit];
|
||||
struct audio_softc *sc = audio_cd.cd_devs[unit];
|
||||
struct audio_ringbuffer *cb = &sc->sc_rr;
|
||||
u_char *outp;
|
||||
int error, s, used, cc, n;
|
||||
|
@ -1082,13 +1075,13 @@ audio_write(dev, uio, ioflag)
|
|||
int ioflag;
|
||||
{
|
||||
int unit = AUDIOUNIT(dev);
|
||||
struct audio_softc *sc = audio_softc[unit];
|
||||
struct audio_softc *sc = audio_cd.cd_devs[unit];
|
||||
struct audio_ringbuffer *cb = &sc->sc_pr;
|
||||
u_char *inp, *einp;
|
||||
int error, s, n, cc, used;
|
||||
|
||||
DPRINTF(("audio_write: count=%d used=%d(hi=%d)\n", uio->uio_resid,
|
||||
sc->sc_pr.used, sc->sc_pr.usedhigh));
|
||||
DPRINTF(("audio_write: sc=%p(unit=%d) count=%d used=%d(hi=%d)\n", sc, unit,
|
||||
uio->uio_resid, sc->sc_pr.used, sc->sc_pr.usedhigh));
|
||||
|
||||
if (cb->mmapped)
|
||||
return EINVAL;
|
||||
|
@ -1118,6 +1111,14 @@ audio_write(dev, uio, ioflag)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef AUDIO_DEBUG
|
||||
if (audiodebug > 1)
|
||||
printf("audio_write: sr=%ld, enc=%d, prec=%d, chan=%d, sw=%p, fact=%d\n",
|
||||
sc->sc_pparams.sample_rate, sc->sc_pparams.encoding,
|
||||
sc->sc_pparams.precision, sc->sc_pparams.channels,
|
||||
sc->sc_pparams.sw_code, sc->sc_pparams.factor);
|
||||
#endif
|
||||
|
||||
error = 0;
|
||||
while (uio->uio_resid > 0 && !error) {
|
||||
while (cb->used >= cb->usedhigh) {
|
||||
|
@ -1152,8 +1153,9 @@ audio_write(dev, uio, ioflag)
|
|||
* block pointers are always nicely aligned.
|
||||
*/
|
||||
if (cc == 0) {
|
||||
printf("audio_write: cc == 0, factor=%d\n",
|
||||
sc->sc_pparams.factor);
|
||||
printf("audio_write: cc == 0, swcode=%p, factor=%d\n",
|
||||
sc->sc_pparams.sw_code, sc->sc_pparams.factor);
|
||||
cb->copying = 0;
|
||||
return EINVAL;
|
||||
}
|
||||
#endif
|
||||
|
@ -1234,7 +1236,7 @@ audio_ioctl(dev, cmd, addr, flag, p)
|
|||
struct proc *p;
|
||||
{
|
||||
int unit = AUDIOUNIT(dev);
|
||||
struct audio_softc *sc = audio_softc[unit];
|
||||
struct audio_softc *sc = audio_cd.cd_devs[unit];
|
||||
struct audio_hw_if *hw = sc->hw_if;
|
||||
struct audio_offset *ao;
|
||||
int error = 0, s, offs, fd;
|
||||
|
@ -1394,7 +1396,7 @@ audio_poll(dev, events, p)
|
|||
struct proc *p;
|
||||
{
|
||||
int unit = AUDIOUNIT(dev);
|
||||
struct audio_softc *sc = audio_softc[unit];
|
||||
struct audio_softc *sc = audio_cd.cd_devs[unit];
|
||||
int revents = 0;
|
||||
int s = splaudio();
|
||||
|
||||
|
@ -1432,7 +1434,7 @@ audio_mmap(dev, off, prot)
|
|||
{
|
||||
int s;
|
||||
int unit = AUDIOUNIT(dev);
|
||||
struct audio_softc *sc = audio_softc[unit];
|
||||
struct audio_softc *sc = audio_cd.cd_devs[unit];
|
||||
struct audio_hw_if *hw = sc->hw_if;
|
||||
struct audio_ringbuffer *cb;
|
||||
|
||||
|
@ -2174,16 +2176,13 @@ mixer_open(dev, flags, ifmt, p)
|
|||
int unit = AUDIOUNIT(dev);
|
||||
struct audio_softc *sc;
|
||||
|
||||
if (unit >= naudio || !audio_softc[unit]) {
|
||||
DPRINTF(("mixer_open: invalid device unit - %d\n", unit));
|
||||
return (ENODEV);
|
||||
}
|
||||
|
||||
sc = audio_softc[unit];
|
||||
sc = audio_cd.cd_devs[unit];
|
||||
if (!sc)
|
||||
return ENXIO;
|
||||
if (!sc->hw_if)
|
||||
return (ENXIO);
|
||||
|
||||
DPRINTF(("mixer_open: dev=0x%x flags=0x%x sc=%p\n", dev, flags, sc));
|
||||
if (sc->hw_if == 0) /* Hardware has not attached to us... */
|
||||
return (ENXIO);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
@ -2232,7 +2231,7 @@ mixer_close(dev, flags, ifmt, p)
|
|||
struct proc *p;
|
||||
{
|
||||
int unit = AUDIOUNIT(dev);
|
||||
struct audio_softc *sc = audio_softc[unit];
|
||||
struct audio_softc *sc = audio_cd.cd_devs[unit];
|
||||
|
||||
DPRINTF(("mixer_close: unit %d\n", AUDIOUNIT(dev)));
|
||||
|
||||
|
@ -2250,7 +2249,7 @@ mixer_ioctl(dev, cmd, addr, flag, p)
|
|||
struct proc *p;
|
||||
{
|
||||
int unit = AUDIOUNIT(dev);
|
||||
struct audio_softc *sc = audio_softc[unit];
|
||||
struct audio_softc *sc = audio_cd.cd_devs[unit];
|
||||
struct audio_hw_if *hw = sc->hw_if;
|
||||
int error = EINVAL;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: audio_if.h,v 1.18 1997/08/18 21:19:03 augustss Exp $ */
|
||||
/* $NetBSD: audio_if.h,v 1.19 1997/08/19 23:49:58 augustss Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Havard Eidnes.
|
||||
|
@ -123,9 +123,10 @@ struct audio_hw_if {
|
|||
int (*get_props)__P((void *)); /* device properties */
|
||||
};
|
||||
|
||||
/* Register / deregister hardware driver */
|
||||
extern int audio_hardware_attach __P((struct audio_hw_if *, void *, struct device *));
|
||||
extern int audio_hardware_detach __P((struct audio_hw_if *, void *));
|
||||
struct midi_hw_if;
|
||||
|
||||
/* Attach the MI driver(s) to the MD driver. */
|
||||
extern void audio_attach_mi __P((struct audio_hw_if *, struct midi_hw_if *, void *, struct device *));
|
||||
|
||||
/* Device identity flags */
|
||||
#define SOUND_DEVICE 0
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: audiovar.h,v 1.15 1997/08/11 01:38:14 augustss Exp $ */
|
||||
/* $NetBSD: audiovar.h,v 1.16 1997/08/19 23:49:58 augustss Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1991-1993 Regents of the University of California.
|
||||
|
@ -74,6 +74,7 @@ struct audio_ringbuffer {
|
|||
* Software state, per audio device.
|
||||
*/
|
||||
struct audio_softc {
|
||||
struct device dev;
|
||||
void *hw_hdl; /* Hardware driver handle */
|
||||
struct audio_hw_if *hw_if; /* Hardware interface */
|
||||
struct device *sc_dev; /* Hardware device struct */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: am7930.c,v 1.26 1997/07/31 22:33:14 augustss Exp $ */
|
||||
/* $NetBSD: am7930.c,v 1.27 1997/08/19 23:49:54 augustss Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995 Rolf Grossmann
|
||||
|
@ -112,18 +112,18 @@ static void init_amd __P((volatile struct amd7930 *));
|
|||
void amd7930attach __P((struct device *, struct device *, void *));
|
||||
int amd7930match __P((struct device *, struct cfdata *, void *));
|
||||
|
||||
struct cfattach audio_ca = {
|
||||
struct cfattach audioamd_ca = {
|
||||
sizeof(struct amd7930_softc), amd7930match, amd7930attach
|
||||
};
|
||||
|
||||
struct cfdriver audio_cd = {
|
||||
NULL, "audio", DV_DULL
|
||||
struct cfdriver audioamd_cd = {
|
||||
NULL, "audioamd", DV_DULL
|
||||
};
|
||||
|
||||
struct audio_device amd7930_device = {
|
||||
"amd7930",
|
||||
"x",
|
||||
"audio"
|
||||
"audioamd"
|
||||
};
|
||||
|
||||
/* Write 16 bits of data from variable v to the data port of the audio chip */
|
||||
|
@ -325,8 +325,7 @@ amd7930attach(parent, self, args)
|
|||
|
||||
evcnt_attach(&sc->sc_dev, "intr", &sc->sc_intrcnt);
|
||||
|
||||
if (audio_hardware_attach(&sa_hw_if, sc, &sc->sc_dev) != 0)
|
||||
printf("audio: could not attach to audio pseudo-device driver\n");
|
||||
audio_attach_mi(&sa_hw_if, 0, sc, &sc->sc_dev);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: gus.c,v 1.39 1997/08/07 22:48:10 augustss Exp $ */
|
||||
/* $NetBSD: gus.c,v 1.40 1997/08/19 23:50:00 augustss Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
|
@ -942,8 +942,7 @@ gusattach(parent, self, aux)
|
|||
* Attach to the generic audio layer
|
||||
*/
|
||||
|
||||
if (audio_hardware_attach(&gus_hw_if, HAS_CODEC(sc) ? (void *)&sc->sc_codec : (void *)sc, &sc->sc_dev) != 0)
|
||||
printf("gus: could not attach to audio pseudo-device driver\n");
|
||||
audio_attach_mi(&gus_hw_if, 0, HAS_CODEC(sc) ? (void *)&sc->sc_codec : (void *)sc, &sc->sc_dev);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: pas.c,v 1.33 1997/07/31 22:33:31 augustss Exp $ */
|
||||
/* $NetBSD: pas.c,v 1.34 1997/08/19 23:50:03 augustss Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1991-1993 Regents of the University of California.
|
||||
|
@ -448,7 +448,6 @@ pasattach(parent, self, aux)
|
|||
register struct pas_softc *sc = (struct pas_softc *)self;
|
||||
struct isa_attach_args *ia = (struct isa_attach_args *)aux;
|
||||
register int iobase = ia->ia_iobase;
|
||||
int err;
|
||||
|
||||
sc->sc_sbdsp.sc_iobase = iobase;
|
||||
sc->sc_sbdsp.sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq,
|
||||
|
@ -464,8 +463,7 @@ pasattach(parent, self, aux)
|
|||
sprintf(pas_device.name, "pas,%s", pasnames[sc->model]);
|
||||
sprintf(pas_device.version, "%d", sc->rev);
|
||||
|
||||
if ((err = audio_hardware_attach(&pas_hw_if, &sc->sc_sbdsp, &sc->sc_sbdsp.sc_dev)) != 0)
|
||||
printf("pas: could not attach to audio pseudo-device driver (%d)\n", err);
|
||||
audio_attach_mi(&pas_hw_if, 0, &sc->sc_sbdsp, &sc->sc_sbdsp.sc_dev);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: pss.c,v 1.33 1997/07/31 22:33:32 augustss Exp $ */
|
||||
/* $NetBSD: pss.c,v 1.34 1997/08/19 23:50:04 augustss Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 John Brezak
|
||||
|
@ -1036,7 +1036,6 @@ pssattach(parent, self, aux)
|
|||
int iobase = ia->ia_iobase;
|
||||
u_char vers;
|
||||
struct ad1848_volume vol = {150, 150};
|
||||
int err;
|
||||
|
||||
sc->sc_iobase = iobase;
|
||||
sc->sc_drq = ia->ia_drq;
|
||||
|
@ -1061,8 +1060,7 @@ pssattach(parent, self, aux)
|
|||
(void)pss_set_treble(sc, AUDIO_MAX_GAIN/2);
|
||||
(void)pss_set_bass(sc, AUDIO_MAX_GAIN/2);
|
||||
|
||||
if ((err = audio_hardware_attach(&pss_audio_if, sc->ad1848_sc, &sc->ad1848_sc->sc_dev)) != 0)
|
||||
printf("pss: could not attach to audio pseudo-device driver (%d)\n", err);
|
||||
audio_attach_mi(&pss_audio_if, 0, sc->ad1848_sc, &sc->ad1848_sc->sc_dev);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: sb.c,v 1.53 1997/07/31 22:33:34 augustss Exp $ */
|
||||
/* $NetBSD: sb.c,v 1.54 1997/08/19 23:50:05 augustss Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1991-1993 Regents of the University of California.
|
||||
|
@ -245,16 +245,12 @@ void
|
|||
sbattach(sc)
|
||||
struct sbdsp_softc *sc;
|
||||
{
|
||||
int error;
|
||||
|
||||
sc->sc_ih = isa_intr_establish(sc->sc_ic, sc->sc_irq, IST_EDGE,
|
||||
IPL_AUDIO, sbdsp_intr, sc);
|
||||
|
||||
sbdsp_attach(sc);
|
||||
|
||||
if ((error = audio_hardware_attach(&sb_hw_if, sc, &sc->sc_dev)) != 0)
|
||||
printf("%s: could not attach to audio device driver (%d)\n",
|
||||
sc->sc_dev.dv_xname, error);
|
||||
audio_attach_mi(&sb_hw_if, 0, sc, &sc->sc_dev);
|
||||
}
|
||||
|
||||
#ifdef NEWCONFIG
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: wss.c,v 1.31 1997/08/04 22:13:34 augustss Exp $ */
|
||||
/* $NetBSD: wss.c,v 1.32 1997/08/19 23:50:06 augustss Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 John Brezak
|
||||
|
@ -298,7 +298,6 @@ wssattach(parent, self, aux)
|
|||
struct wss_softc *sc = (struct wss_softc *)self;
|
||||
struct isa_attach_args *ia = (struct isa_attach_args *)aux;
|
||||
int version;
|
||||
int err;
|
||||
|
||||
sc->sc_ad1848.sc_recdrq = ia->ia_drq;
|
||||
sc->sc_ad1848.sc_isa = parent;
|
||||
|
@ -322,8 +321,7 @@ wssattach(parent, self, aux)
|
|||
|
||||
sc->sc_ad1848.parent = sc;
|
||||
|
||||
if ((err = audio_hardware_attach(&wss_hw_if, &sc->sc_ad1848, &sc->sc_dev)) != 0)
|
||||
printf("wss: could not attach to audio pseudo-device driver (%d)\n", err);
|
||||
audio_attach_mi(&wss_hw_if, 0, &sc->sc_ad1848, &sc->sc_dev);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
Loading…
Reference in New Issue