aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/sound/pci/neomagic.c
diff options
context:
space:
mode:
authorCameron Grant <cg@FreeBSD.org>2000-09-01 20:09:24 +0000
committerCameron Grant <cg@FreeBSD.org>2000-09-01 20:09:24 +0000
commit33dbf14a176a5bdcd78deec75616b8ede1937e96 (patch)
treede613fdf24f49d54b13e2071271879602e1f83e8 /sys/dev/sound/pci/neomagic.c
parent84a563762067d9b4f4bfa534c936519173acdd89 (diff)
downloadsrc-33dbf14a176a5bdcd78deec75616b8ede1937e96.tar.gz
src-33dbf14a176a5bdcd78deec75616b8ede1937e96.zip
change mixer api slightly
change channel interface - kobj implementation coming soonish make pcm_makelinks not panic if modular add pcm_unregister() these changes support newpcm kld unloading, but this is only implemented by ds1.c
Notes
Notes: svn path=/head/; revision=65340
Diffstat (limited to 'sys/dev/sound/pci/neomagic.c')
-rw-r--r--sys/dev/sound/pci/neomagic.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/sys/dev/sound/pci/neomagic.c b/sys/dev/sound/pci/neomagic.c
index f7a864ffaca4..99eece841e4a 100644
--- a/sys/dev/sound/pci/neomagic.c
+++ b/sys/dev/sound/pci/neomagic.c
@@ -78,6 +78,7 @@ struct sc_info {
/* channel interface */
static void *nmchan_init(void *devinfo, snd_dbuf *b, pcm_channel *c, int dir);
+static int nmchan_free(void *data);
static int nmchan_setdir(void *data, int dir);
static int nmchan_setformat(void *data, u_int32_t format);
static int nmchan_setspeed(void *data, u_int32_t speed);
@@ -143,6 +144,14 @@ static pcm_channel nm_chantemplate = {
nmchan_trigger,
nmchan_getptr,
nmchan_getcaps,
+ nmchan_free, /* free */
+ NULL, /* nop1 */
+ NULL, /* nop2 */
+ NULL, /* nop3 */
+ NULL, /* nop4 */
+ NULL, /* nop5 */
+ NULL, /* nop6 */
+ NULL, /* nop7 */
};
/* -------------------------------------------------------------------- */
@@ -364,6 +373,12 @@ nmchan_init(void *devinfo, snd_dbuf *b, pcm_channel *c, int dir)
}
static int
+nmchan_free(void *data)
+{
+ return 0;
+}
+
+static int
nmchan_setdir(void *data, int dir)
{
return 0;
@@ -582,13 +597,11 @@ nm_pci_probe(device_t dev)
static int
nm_pci_attach(device_t dev)
{
- snddev_info *d;
u_int32_t data;
struct sc_info *sc;
struct ac97_info *codec;
char status[SND_STATUSLEN];
- d = device_get_softc(dev);
if ((sc = malloc(sizeof(*sc), M_DEVBUF, M_NOWAIT)) == NULL) {
device_printf(dev, "cannot allocate softc\n");
return ENXIO;
@@ -622,7 +635,7 @@ nm_pci_attach(device_t dev)
codec = ac97_create(dev, sc, nm_initcd, nm_rdcd, nm_wrcd);
if (codec == NULL) goto bad;
- if (mixer_init(d, &ac97_mixer, codec) == -1) goto bad;
+ if (mixer_init(dev, &ac97_mixer, codec) == -1) goto bad;
sc->irqid = 0;
sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irqid,
@@ -656,10 +669,8 @@ bad:
static int
nm_pci_resume(device_t dev)
{
- snddev_info *d;
struct sc_info *sc;
- d = device_get_softc(dev);
sc = pcm_getdevinfo(dev);
/* Reinit audio device */
@@ -668,7 +679,7 @@ nm_pci_resume(device_t dev)
return ENXIO;
}
/* Reinit mixer */
- if (mixer_reinit(d) == -1) {
+ if (mixer_reinit(dev) == -1) {
device_printf(dev, "unable to reinitialize the mixer\n");
return ENXIO;
}