Module Name: src Committed By: isaki Date: Sat Feb 6 09:14:03 UTC 2021
Modified Files: src/sys/arch/dreamcast/dev/g2: aica.c Log Message: Remove sc_open flag. Counting {open,close} is done by the MI audio layer. To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/arch/dreamcast/dev/g2/aica.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/dreamcast/dev/g2/aica.c diff -u src/sys/arch/dreamcast/dev/g2/aica.c:1.28 src/sys/arch/dreamcast/dev/g2/aica.c:1.29 --- src/sys/arch/dreamcast/dev/g2/aica.c:1.28 Sun Feb 23 04:02:45 2020 +++ src/sys/arch/dreamcast/dev/g2/aica.c Sat Feb 6 09:14:03 2021 @@ -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 <r...@misakimix.org> @@ -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 @@ struct aica_softc { 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 @@ void aica_fillbuffer(struct aica_softc * 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 @@ int aica_get_props(void *); 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 @@ aica_ch2p8write(struct aica_softc *sc, b } 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_intr(void *arg) 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 @@ aica_halt_output(void *addr) sc = addr; aica_command(sc, AICA_COMMAND_STOP); + sc->sc_intr = NULL; return 0; }