aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2020-04-13 16:32:18 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2020-04-13 16:32:18 +0000
commit0dce3fac5b8c77950fe47845111616f2ce8c2304 (patch)
treea56e0d647031ef1fbd33d08511ec49a4f970a841
parent34bac8dd3f8a6e294f129da6729fa0774d9b7c13 (diff)
downloadsrc-0dce3fac5b8c77950fe47845111616f2ce8c2304.tar.gz
src-0dce3fac5b8c77950fe47845111616f2ce8c2304.zip
MFC r359440:
Implement new mixer API to return the device pointer based on the mixer pointer. Sponsored by: Mellanox Technologies
Notes
Notes: svn path=/stable/10/; revision=359887
-rw-r--r--sys/dev/sound/pcm/mixer.c8
-rw-r--r--sys/dev/sound/pcm/mixer.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c
index 4bc148de0b0d..b0d7576714f2 100644
--- a/sys/dev/sound/pcm/mixer.c
+++ b/sys/dev/sound/pcm/mixer.c
@@ -1031,6 +1031,14 @@ mix_get_type(struct snd_mixer *m)
return (m->type);
}
+device_t
+mix_get_dev(struct snd_mixer *m)
+{
+ KASSERT(m != NULL, ("NULL snd_mixer"));
+
+ return (m->dev);
+}
+
/* ----------------------------------------------------------------------- */
static int
diff --git a/sys/dev/sound/pcm/mixer.h b/sys/dev/sound/pcm/mixer.h
index 0fb2e914433b..9f97bec65b6b 100644
--- a/sys/dev/sound/pcm/mixer.h
+++ b/sys/dev/sound/pcm/mixer.h
@@ -54,6 +54,7 @@ int mix_get(struct snd_mixer *m, u_int dev);
int mix_setrecsrc(struct snd_mixer *m, u_int32_t src);
u_int32_t mix_getrecsrc(struct snd_mixer *m);
int mix_get_type(struct snd_mixer *m);
+device_t mix_get_dev(struct snd_mixer *m);
void mix_setdevs(struct snd_mixer *m, u_int32_t v);
void mix_setrecdevs(struct snd_mixer *m, u_int32_t v);