-/* $OpenBSD: ad1848.c,v 1.47 2022/10/18 08:22:18 kn Exp $ */
+/* $OpenBSD: ad1848.c,v 1.48 2022/10/28 14:55:46 kn Exp $ */
/* $NetBSD: ad1848.c,v 1.45 1998/01/30 02:02:38 augustss Exp $ */
/*
#include <sys/syslog.h>
#include <sys/device.h>
#include <sys/buf.h>
+#include <sys/fcntl.h>
#include <machine/cpu.h>
#include <machine/bus.h>
DPRINTF(("ad1848_open: sc=%p\n", sc));
+ if ((flags & (FWRITE | FREAD)) == (FWRITE | FREAD) && sc->mode != 2)
+ return ENXIO;
+
sc->sc_pintr = sc->sc_parg = NULL;
sc->sc_rintr = sc->sc_rarg = NULL;
size = MAX_ISADMA;
return size;
}
-
-int
-ad1848_get_props(void *addr)
-{
- struct ad1848_softc *sc = addr;
-
- return (sc->mode == 2 ? AUDIO_PROP_FULLDUPLEX : 0);
-}
-/* $OpenBSD: ad1848var.h,v 1.16 2021/03/07 06:17:03 jsg Exp $ */
+/* $OpenBSD: ad1848var.h,v 1.17 2022/10/28 14:55:46 kn Exp $ */
/* $NetBSD: ad1848var.h,v 1.22 1998/01/19 22:18:26 augustss Exp $ */
/*
void ad1848_free(void *, void *, int);
size_t ad1848_round(void *, int, size_t);
-int ad1848_get_props(void *);
-
#endif
-/* $OpenBSD: ess.c,v 1.31 2022/10/19 19:14:16 kn Exp $ */
+/* $OpenBSD: ess.c,v 1.32 2022/10/28 14:55:46 kn Exp $ */
/* $NetBSD: ess.c,v 1.44.4.1 1999/06/21 01:18:00 thorpej Exp $ */
/*
#include <sys/device.h>
#include <sys/kernel.h>
#include <sys/timeout.h>
+#include <sys/fcntl.h>
#include <machine/cpu.h>
#include <machine/intr.h>
int ess_setup_sc(struct ess_softc *, int);
+int ess_1788_open(void *, int);
int ess_open(void *, int);
void ess_1788_close(void *);
void ess_1888_close(void *);
int ess_query_devinfo(void *, mixer_devinfo_t *);
-int ess_1788_get_props(void *);
-int ess_1888_get_props(void *);
void ess_speaker_on(struct ess_softc *);
void ess_speaker_off(struct ess_softc *);
*/
const struct audio_hw_if ess_1788_hw_if = {
- .open = ess_open,
+ .open = ess_1788_open,
.close = ess_1788_close,
.set_params = ess_set_params,
.round_blocksize = ess_round_blocksize,
.allocm = ess_malloc,
.freem = ess_free,
.round_buffersize = ess_round_buffersize,
- .get_props = ess_1788_get_props,
.trigger_output = ess_audio1_trigger_output,
.trigger_input = ess_audio1_trigger_input,
};
.allocm = ess_malloc,
.freem = ess_free,
.round_buffersize = ess_round_buffersize,
- .get_props = ess_1888_get_props,
.trigger_output = ess_audio2_trigger_output,
.trigger_input = ess_audio1_trigger_input,
};
* Various routines to interface to higher level audio driver
*/
+int
+ess_1788_open(void *addr, int flags)
+{
+ if ((flags & (FWRITE | FREAD)) == (FWRITE | FREAD))
+ return ENXIO;
+
+ return ess_open(addr, flags);
+}
+
int
ess_open(void *addr, int flags)
{
return (size);
}
-int
-ess_1788_get_props(void *addr)
-{
- return (0);
-}
-
-int
-ess_1888_get_props(void *addr)
-{
- return (AUDIO_PROP_FULLDUPLEX);
-}
-
/* ============================================
* Generic functions for ess, not used by audio h/w i/f
* =============================================
-/* $OpenBSD: gus.c,v 1.53 2022/10/19 19:14:16 kn Exp $ */
+/* $OpenBSD: gus.c,v 1.54 2022/10/28 14:55:46 kn Exp $ */
/* $NetBSD: gus.c,v 1.51 1998/01/25 23:48:06 mycroft Exp $ */
/*-
.allocm = gus_malloc,
.freem = gus_free,
.round_buffersize = gus_round,
- .get_props = gus_get_props,
};
static const struct audio_hw_if gusmax_hw_if = {
.allocm = ad1848_malloc,
.freem = ad1848_free,
.round_buffersize = ad1848_round,
- .get_props = gusmax_get_props,
};
int
DPRINTF(("gusopen() called\n"));
+ if ((flags & (FWRITE | FREAD)) == (FWRITE | FREAD) &&
+ sc->sc_recdrq == sc->sc_drq)
+ return ENXIO;
+
if (sc->sc_flags & GUS_OPEN)
return EBUSY;
return error;
}
-int
-gus_get_props(void *addr)
-{
- struct gus_softc *sc = addr;
- return (sc->sc_recdrq == sc->sc_drq ? 0 : AUDIO_PROP_FULLDUPLEX);
-}
-
-int
-gusmax_get_props(void *addr)
-{
- struct ad1848_softc *ac = addr;
- return gus_get_props(ac->parent);
-}
-
int
gusmax_mixer_query_devinfo(void *addr, mixer_devinfo_t *dip)
{
-/* $OpenBSD: gusvar.h,v 1.11 2022/03/21 19:22:40 miod Exp $ */
+/* $OpenBSD: gusvar.h,v 1.12 2022/10/28 14:55:46 kn Exp $ */
/* $NetBSD: gus.c,v 1.51 1998/01/25 23:48:06 mycroft Exp $ */
/*-
void *gus_malloc(void *, int, size_t, int, int);
void gus_free(void *, void *, int);
size_t gus_round(void *, int, size_t);
-int gus_get_props(void *);
-int gusmax_get_props(void *);
void gusics_master_mute(struct ics2101_softc *, int);
void gusics_dac_mute(struct ics2101_softc *, int);
-/* $OpenBSD: pas.c,v 1.35 2022/10/19 19:14:16 kn Exp $ */
+/* $OpenBSD: pas.c,v 1.36 2022/10/28 14:55:46 kn Exp $ */
/* $NetBSD: pas.c,v 1.37 1998/01/12 09:43:43 thorpej Exp $ */
/*
.allocm = sb_malloc,
.freem = sb_free,
.round_buffersize = sb_round,
- .get_props = sbdsp_get_props,
.trigger_output = sbdsp_trigger_output,
.trigger_input = sbdsp_trigger_input,
};
-/* $OpenBSD: sb.c,v 1.33 2022/10/19 19:14:16 kn Exp $ */
+/* $OpenBSD: sb.c,v 1.34 2022/10/28 14:55:46 kn Exp $ */
/* $NetBSD: sb.c,v 1.57 1998/01/12 09:43:46 thorpej Exp $ */
/*
.allocm = sb_malloc,
.freem = sb_free,
.round_buffersize = sb_round,
- .get_props = sbdsp_get_props,
.trigger_output = sbdsp_trigger_output,
.trigger_input = sbdsp_trigger_input,
};
-/* $OpenBSD: sbdsp.c,v 1.41 2022/10/18 08:22:18 kn Exp $ */
+/* $OpenBSD: sbdsp.c,v 1.42 2022/10/28 14:55:46 kn Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
#include <sys/syslog.h>
#include <sys/device.h>
#include <sys/buf.h>
+#include <sys/fcntl.h>
#include <machine/cpu.h>
#include <machine/intr.h>
return size;
}
-int
-sbdsp_get_props(void *addr)
-{
- struct sbdsp_softc *sc = addr;
- return (sc->sc_fullduplex ? AUDIO_PROP_FULLDUPLEX : 0);
-}
-
#if NMIDI > 0
/*
* MIDI related routines.
DPRINTF(("sbdsp_midi_open: sc=%p\n", sc));
+ if ((flags & (FWRITE | FREAD)) == (FWRITE | FREAD) &&
+ !sc->sc_fullduplex)
+ return ENXIO;
if (sc->sc_open != SB_CLOSED)
return EBUSY;
if (sbdsp_reset(sc) != 0)
-/* $OpenBSD: sbdspvar.h,v 1.18 2016/09/14 06:12:19 ratchov Exp $ */
+/* $OpenBSD: sbdspvar.h,v 1.19 2022/10/28 14:55:46 kn Exp $ */
/* $NetBSD: sbdspvar.h,v 1.37 1998/08/10 00:20:39 mycroft Exp $ */
/*
void sb_free(void *, void *, int);
size_t sb_round(void *, int, size_t);
-int sbdsp_get_props(void *);
-
int sbdsp_midi_open(void *, int,
void (*iintr)(void *, int),