From b3fe5d25736242646ad4720ae465600b98535108 Mon Sep 17 00:00:00 2001 From: Klemens Nanni Date: Wed, 26 Oct 2022 20:19:10 +0000 Subject: 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 --- sys/dev/tc/bba.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'sys/dev/tc') diff --git a/sys/dev/tc/bba.c b/sys/dev/tc/bba.c index ea1050c7bb8..2ddd1becaf5 100644 --- a/sys/dev/tc/bba.c +++ b/sys/dev/tc/bba.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bba.c,v 1.11 2022/10/19 19:14:17 kn Exp $ */ +/* $OpenBSD: bba.c,v 1.12 2022/10/26 20:19:09 kn Exp $ */ /* $NetBSD: bba.c,v 1.38 2011/06/04 01:27:57 tsutsui Exp $ */ /* * Copyright (c) 2011 Miodrag Vallat. @@ -146,7 +146,6 @@ int bba_halt_input(void *); void *bba_allocm(void *, int, size_t, int, int); void bba_freem(void *, void *, int); size_t bba_round_buffersize(void *, int, size_t); -int bba_get_props(void *); int bba_trigger_output(void *, void *, void *, int, void (*)(void *), void *, struct audio_params *); int bba_trigger_input(void *, void *, void *, int, @@ -166,7 +165,6 @@ const struct audio_hw_if bba_hw_if = { .allocm = bba_allocm, .freem = bba_freem, .round_buffersize = bba_round_buffersize, - .get_props = bba_get_props, .trigger_output = bba_trigger_output, .trigger_input = bba_trigger_input, }; @@ -575,12 +573,6 @@ bba_intr(void *v) return 0; } -int -bba_get_props(void *v) -{ - return am7930_get_props(v); -} - int bba_round_blocksize(void *v, int blk) { -- cgit v1.2.3