summaryrefslogtreecommitdiffstats
path: root/sys/dev/sound/pcm/ac97.c
diff options
context:
space:
mode:
authorcg <cg@FreeBSD.org>2000-09-01 20:09:24 +0000
committercg <cg@FreeBSD.org>2000-09-01 20:09:24 +0000
commita6b7de97e3e709e699c0638c9ff07e8fc3477772 (patch)
treeba5ec2ebf628be720fad52ae78db04a46cc46680 /sys/dev/sound/pcm/ac97.c
parente95936f6ddf2411361330abe8f44903c01b42fe5 (diff)
downloadFreeBSD-src-a6b7de97e3e709e699c0638c9ff07e8fc3477772.zip
FreeBSD-src-a6b7de97e3e709e699c0638c9ff07e8fc3477772.tar.gz
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
Diffstat (limited to 'sys/dev/sound/pcm/ac97.c')
-rw-r--r--sys/dev/sound/pcm/ac97.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/sys/dev/sound/pcm/ac97.c b/sys/dev/sound/pcm/ac97.c
index 8432769..296e800 100644
--- a/sys/dev/sound/pcm/ac97.c
+++ b/sys/dev/sound/pcm/ac97.c
@@ -386,6 +386,12 @@ ac97_create(device_t dev, void *devinfo, ac97_init *init, ac97_read *rd, ac97_wr
return codec;
}
+void
+ac97_destroy(struct ac97_info *codec)
+{
+ free(codec, M_DEVBUF);
+}
+
static int
ac97mix_init(snd_mixer *m)
{
@@ -400,6 +406,20 @@ ac97mix_init(snd_mixer *m)
}
static int
+ac97mix_uninit(snd_mixer *m)
+{
+ struct ac97_info *codec = mix_getdevinfo(m);
+ if (codec == NULL)
+ return -1;
+ /*
+ if (ac97_uninitmixer(codec))
+ return -1;
+ */
+ ac97_destroy(codec);
+ return 0;
+}
+
+static int
ac97mix_set(snd_mixer *m, unsigned dev, unsigned left, unsigned right)
{
struct ac97_info *codec = mix_getdevinfo(m);
@@ -424,6 +444,7 @@ ac97mix_setrecsrc(snd_mixer *m, u_int32_t src)
snd_mixer ac97_mixer = {
"AC97 mixer",
ac97mix_init,
+ ac97mix_uninit,
ac97mix_set,
ac97mix_setrecsrc,
};
OpenPOWER on IntegriCloud