Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/dreamcast/dev/g2 Remove sc_open flag.



details:   https://anonhg.NetBSD.org/src/rev/271846cba2ca
branches:  trunk
changeset: 959249:271846cba2ca
user:      isaki <isaki%NetBSD.org@localhost>
date:      Sat Feb 06 09:14:03 2021 +0000

description:
Remove sc_open flag.
Counting {open,close} is done by the MI audio layer.

diffstat:

 sys/arch/dreamcast/dev/g2/aica.c |  37 ++++---------------------------------
 1 files changed, 4 insertions(+), 33 deletions(-)

diffs (93 lines):

diff -r 7bcb6d56482b -r 271846cba2ca sys/arch/dreamcast/dev/g2/aica.c
--- a/sys/arch/dreamcast/dev/g2/aica.c  Sat Feb 06 07:16:18 2021 +0000
+++ b/sys/arch/dreamcast/dev/g2/aica.c  Sat Feb 06 09:14:03 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aica.c,v 1.28 2020/02/23 04:02:45 isaki Exp $  */
+/*     $NetBSD: aica.c,v 1.29 2021/02/06 09:14:03 isaki Exp $  */
 
 /*
  * Copyright (c) 2003 SHIMIZU Ryo <ryo%misakimix.org@localhost>
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aica.c,v 1.28 2020/02/23 04:02:45 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aica.c,v 1.29 2021/02/06 09:14:03 isaki Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -63,7 +63,6 @@
        bus_space_handle_t      sc_aica_memh;
 
        /* audio property */
-       int                     sc_open;
        int                     sc_precision;
        int                     sc_channels;
        int                     sc_rate;
@@ -125,8 +124,6 @@
 int aica_intr(void *);
 
 /* for audio */
-int aica_open(void *, int);
-void aica_close(void *);
 int aica_query_format(void *, audio_format_query_t *);
 int aica_set_format(void *, int,
     const audio_params_t *, const audio_params_t *,
@@ -145,8 +142,6 @@
 void aica_get_locks(void *, kmutex_t **, kmutex_t **);
 
 const struct audio_hw_if aica_hw_if = {
-       .open                   = aica_open,
-       .close                  = aica_close,
        .query_format           = aica_query_format,
        .set_format             = aica_set_format,
        .round_blocksize        = aica_round_blocksize,
@@ -389,31 +384,6 @@
 }
 
 int
-aica_open(void *addr, int flags)
-{
-       struct aica_softc *sc;
-
-       sc = addr;
-       if (sc->sc_open)
-               return EBUSY;
-
-       sc->sc_intr = NULL;
-       sc->sc_open = 1;
-
-       return 0;
-}
-
-void
-aica_close(void *addr)
-{
-       struct aica_softc *sc;
-
-       sc = addr;
-       sc->sc_open = 0;
-       sc->sc_intr = NULL;
-}
-
-int
 aica_query_format(void *addr, audio_format_query_t *afp)
 {
 
@@ -561,7 +531,7 @@
        aica_fillbuffer(sc);
 
        /* call audio interrupt handler (audio_pint()) */
-       if (sc->sc_open && sc->sc_intr != NULL) {
+       if (sc->sc_intr != NULL) {
                (*(sc->sc_intr))(sc->sc_intr_arg);
        }
 
@@ -610,6 +580,7 @@
 
        sc = addr;
        aica_command(sc, AICA_COMMAND_STOP);
+       sc->sc_intr = NULL;
        return 0;
 }
 



Home | Main Index | Thread Index | Old Index