summaryrefslogtreecommitdiff
path: root/sys/dev/pci/azalia.c
diff options
context:
space:
mode:
authorKlemens Nanni <kn@cvs.openbsd.org>2022-10-26 20:19:10 +0000
committerKlemens Nanni <kn@cvs.openbsd.org>2022-10-26 20:19:10 +0000
commitb3fe5d25736242646ad4720ae465600b98535108 (patch)
treee627aad857a9e5ce1b387b607988565bafb24eae /sys/dev/pci/azalia.c
parent9543cc6d3abbc2670d3dd05054df7453ed421348 (diff)
Make audio(9) get_props() optional, remove it from duplex drivers
The property bits of audio(9) are obsolete and ought to be removed completely. sys/dev/audio.c:audio_open() currently uses get_props() to bail out if read *and* write was requested on a non-duplex driver. Drivers that currently support playing but not recording need adjustment before the API can be cleaned up. Drivers that advertise themselves as full duplex, i.e. those that always return AUDIO_PROP_FULLDUPLEX unconditionally in their get_props() currently always succeed this check. As this is the only property, losen audio_open()'s DIAGNOSTIC check and only do the duplex check if the driver provides get_props(). This allows for simple removal of get_props() from full-duplex drivers without adding any other code or without changing functionality. This includes all audio drivers under sys/dev/pci/ (maestro(4) being the only unfinished exception here). Other drivers as well as the API change can then follow in smaller diffs. This builds on amd64, arm64, i386, macppc and sparc64. amd64 with azalia(4) still plays, records as well as plays and records at the same time on my X230 as tested with $ aucat -i play.wav [-o rec.wav] alpha and hppa tests by miod OK ratchov miod
Diffstat (limited to 'sys/dev/pci/azalia.c')
-rw-r--r--sys/dev/pci/azalia.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/sys/dev/pci/azalia.c b/sys/dev/pci/azalia.c
index 5e73a2d9b57..0b1ab7a831b 100644
--- a/sys/dev/pci/azalia.c
+++ b/sys/dev/pci/azalia.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: azalia.c,v 1.279 2022/10/24 05:59:17 jsg Exp $ */
+/* $OpenBSD: azalia.c,v 1.280 2022/10/26 20:19:08 kn Exp $ */
/* $NetBSD: azalia.c,v 1.20 2006/05/07 08:31:44 kent Exp $ */
/*-
@@ -264,7 +264,6 @@ int azalia_query_devinfo(void *, mixer_devinfo_t *);
void *azalia_allocm(void *, int, size_t, int, int);
void azalia_freem(void *, void *, int);
size_t azalia_round_buffersize(void *, int, size_t);
-int azalia_get_props(void *);
int azalia_trigger_output(void *, void *, void *, int,
void (*)(void *), void *, audio_params_t *);
int azalia_trigger_input(void *, void *, void *, int,
@@ -301,7 +300,6 @@ const struct audio_hw_if azalia_hw_if = {
.allocm = azalia_allocm,
.freem = azalia_freem,
.round_buffersize = azalia_round_buffersize,
- .get_props = azalia_get_props,
.trigger_output = azalia_trigger_output,
.trigger_input = azalia_trigger_input,
.set_blksz = azalia_set_blksz,
@@ -4138,12 +4136,6 @@ azalia_round_buffersize(void *v, int dir, size_t size)
}
int
-azalia_get_props(void *v)
-{
- return AUDIO_PROP_FULLDUPLEX;
-}
-
-int
azalia_trigger_output(void *v, void *start, void *end, int blk,
void (*intr)(void *), void *arg, audio_params_t *param)
{