diff options
author | Klemens Nanni <kn@cvs.openbsd.org> | 2022-11-02 10:41:35 +0000 |
---|---|---|
committer | Klemens Nanni <kn@cvs.openbsd.org> | 2022-11-02 10:41:35 +0000 |
commit | c440089b7c93a68e7af608f8ab86c4a518cc454a (patch) | |
tree | 2577bc02684daf1905bc160dfba711b3f764e84f /sys/dev/audio.c | |
parent | 9ebf01525d764141a5d3ebd642a0278c26e4de4a (diff) |
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
Diffstat (limited to 'sys/dev/audio.c')
-rw-r--r-- | sys/dev/audio.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/sys/dev/audio.c b/sys/dev/audio.c index d57a743460a..afe41327c43 100644 --- a/sys/dev/audio.c +++ b/sys/dev/audio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: audio.c,v 1.203 2022/10/28 15:13:59 kn Exp $ */ +/* $OpenBSD: audio.c,v 1.204 2022/11/02 10:41:34 kn Exp $ */ /* * Copyright (c) 2015 Alexandre Ratchov <alex@caoua.org> * @@ -1492,14 +1492,6 @@ audio_open(struct audio_softc *sc, int flags) if (flags & FREAD) sc->mode |= AUMODE_RECORD; - if (sc->ops->speaker_ctl) { - /* - * XXX: what is this used for? - */ - sc->ops->speaker_ctl(sc->arg, - (sc->mode & AUMODE_PLAY) ? SPKR_ON : SPKR_OFF); - } - error = audio_setpar(sc); if (error) goto bad; |