Remove audio(9) speaker_ctl(), let open() handle speakers where needed
authorkn <kn@openbsd.org>
Wed, 2 Nov 2022 10:41:34 +0000 (10:41 +0000)
committerkn <kn@openbsd.org>
Wed, 2 Nov 2022 10:41:34 +0000 (10:41 +0000)
commitc8819f5db69635e0013fbb92bd980ff98e8cde15
tree0a3a115556236977728c5223f28b4d8515b7bdfc
parent10093466eaf3052cdfa94fc7c6a221d271130d92
Remove audio(9) speaker_ctl(), let open() handle speakers where needed

Only five legacy half-duplex hardware drivers require this function to
change between playing and recording:
i386: ess(4), gus(4), pas(4), sb(4)
luna88k: nec86(4)

If defined, it is always called early in audio_open(), so just move the
call from audio(4) to each hardware driver's open() handler.

SPKR_ON/OFF remain defined to leave driver-specific code unchanged.

Further cleanup (unchecked speaker_ctl() return values,
FWRITE -> AUMODE_PLAY -> SPKR_ON dances, etc.) can happen later.

Builds fine on i386.
OK ratchov
share/man/man9/audio.9
sys/arch/luna88k/cbus/nec86.c
sys/arch/luna88k/cbus/nec86hw.c
sys/dev/audio.c
sys/dev/audio_if.h
sys/dev/isa/ess.c
sys/dev/isa/gus.c
sys/dev/isa/gusvar.h
sys/dev/isa/pas.c
sys/dev/isa/sb.c
sys/dev/isa/sbdsp.c