summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaki <isaki@NetBSD.org>2021-02-06 07:16:18 +0000
committerisaki <isaki@NetBSD.org>2021-02-06 07:16:18 +0000
commitfa6da0bf1fcd5c3d3055f4ea6d3a2eae6a4df47c (patch)
tree4f6ae154c4bc5d14b58cc49ac1910570a1bf804a
parent2b8075d6a336d70828fef6c15060e9795c8c0e6e (diff)
Calling halt_{input,output} is done by the MI audio layer if necessary.
-rw-r--r--sys/arch/arm/xscale/pxa2x0_ac97.c4
-rw-r--r--sys/arch/macppc/dev/awacs.c24
-rw-r--r--sys/dev/isa/gus.c14
3 files changed, 10 insertions, 32 deletions
diff --git a/sys/arch/arm/xscale/pxa2x0_ac97.c b/sys/arch/arm/xscale/pxa2x0_ac97.c
index 29b9872f675..c4902732017 100644
--- a/sys/arch/arm/xscale/pxa2x0_ac97.c
+++ b/sys/arch/arm/xscale/pxa2x0_ac97.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pxa2x0_ac97.c,v 1.18 2020/04/19 08:18:19 isaki Exp $ */
+/* $NetBSD: pxa2x0_ac97.c,v 1.19 2021/02/06 07:16:54 isaki Exp $ */
/*
* Copyright (c) 2003, 2005 Wasabi Systems, Inc.
@@ -545,8 +545,6 @@ acu_close(void *arg)
/*
* Make sure the hardware is quiescent
*/
- acu_halt_output(sc);
- acu_halt_input(sc);
delay(100);
/* Assert Cold Reset */
diff --git a/sys/arch/macppc/dev/awacs.c b/sys/arch/macppc/dev/awacs.c
index 960773d96ca..51ac5e49a6e 100644
--- a/sys/arch/macppc/dev/awacs.c
+++ b/sys/arch/macppc/dev/awacs.c
@@ -1,4 +1,4 @@
-/* $NetBSD: awacs.c,v 1.49 2021/01/26 14:49:41 thorpej Exp $ */
+/* $NetBSD: awacs.c,v 1.50 2021/02/06 07:20:36 isaki Exp $ */
/*-
* Copyright (c) 2000 Tsubai Masanari. All rights reserved.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: awacs.c,v 1.49 2021/01/26 14:49:41 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: awacs.c,v 1.50 2021/02/06 07:20:36 isaki Exp $");
#include <sys/param.h>
#include <sys/audioio.h>
@@ -110,7 +110,6 @@ static void awacs_attach(device_t, device_t, void *);
static int awacs_intr(void *);
static int awacs_status_intr(void *);
-static void awacs_close(void *);
static int awacs_query_format(void *, audio_format_query_t *);
static int awacs_set_format(void *, int,
const audio_params_t *, const audio_params_t *,
@@ -154,7 +153,6 @@ CFATTACH_DECL_NEW(awacs, sizeof(struct awacs_softc),
awacs_match, awacs_attach, NULL, NULL);
const struct audio_hw_if awacs_hw_if = {
- .close = awacs_close,
.query_format = awacs_query_format,
.set_format = awacs_set_format,
.round_blocksize = awacs_round_blocksize,
@@ -620,22 +618,6 @@ awacs_intr(void *v)
return 1;
}
-/*
- * Close function is called at splaudio().
- */
-static void
-awacs_close(void *h)
-{
- struct awacs_softc *sc;
-
- sc = h;
- awacs_halt_output(sc);
- awacs_halt_input(sc);
-
- sc->sc_ointr = 0;
- sc->sc_iintr = 0;
-}
-
static int
awacs_query_format(void *h, audio_format_query_t *afp)
{
@@ -678,6 +660,7 @@ awacs_halt_output(void *h)
sc = h;
dbdma_stop(sc->sc_odma);
dbdma_reset(sc->sc_odma);
+ sc->sc_ointr = NULL;
return 0;
}
@@ -689,6 +672,7 @@ awacs_halt_input(void *h)
sc = h;
dbdma_stop(sc->sc_idma);
dbdma_reset(sc->sc_idma);
+ sc->sc_iintr = NULL;
return 0;
}
diff --git a/sys/dev/isa/gus.c b/sys/dev/isa/gus.c
index 2ea56229b3a..86f753b1e99 100644
--- a/sys/dev/isa/gus.c
+++ b/sys/dev/isa/gus.c
@@ -1,4 +1,4 @@
-/* $NetBSD: gus.c,v 1.118 2020/02/29 05:51:11 isaki Exp $ */
+/* $NetBSD: gus.c,v 1.119 2021/02/06 07:16:18 isaki Exp $ */
/*-
* Copyright (c) 1996, 1999, 2008 The NetBSD Foundation, Inc.
@@ -88,7 +88,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gus.c,v 1.118 2020/02/29 05:51:11 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gus.c,v 1.119 2021/02/06 07:16:18 isaki Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1359,14 +1359,10 @@ gusclose(void *addr)
sc = addr;
DPRINTF(("gus_close: sc=%p\n", sc));
+ KASSERT((sc->sc_flags & (GUS_DMAOUT_ACTIVE | GUS_LOCKED)) == 0);
+ KASSERT((sc->sc_flags & GUS_DMAIN_ACTIVE) == 0);
-/* if (sc->sc_flags & GUS_DMAOUT_ACTIVE) */ {
- gus_halt_out_dma(sc);
- }
-/* if (sc->sc_flags & GUS_DMAIN_ACTIVE) */ {
- gus_halt_in_dma(sc);
- }
- sc->sc_flags &= ~(GUS_OPEN|GUS_LOCKED|GUS_DMAOUT_ACTIVE|GUS_DMAIN_ACTIVE);
+ sc->sc_flags &= ~GUS_OPEN;
/* turn off speaker, etc. */