-/* $OpenBSD: aplaudio.c,v 1.3 2022/09/02 17:54:42 kettenis Exp $ */
+/* $OpenBSD: aplaudio.c,v 1.4 2022/10/28 15:09:45 kn Exp $ */
/*
* Copyright (c) 2022 Mark Kettenis <kettenis@openbsd.org>
* Copyright (c) 2020 Patrick Wildt <patrick@blueri.se>
int aplaudio_set_port(void *, mixer_ctrl_t *);
int aplaudio_get_port(void *, mixer_ctrl_t *);
int aplaudio_query_devinfo(void *, mixer_devinfo_t *);
-int aplaudio_get_props(void *);
int aplaudio_round_blocksize(void *, int);
size_t aplaudio_round_buffersize(void *, int, size_t);
int aplaudio_trigger_output(void *, void *, void *, int,
.set_port = aplaudio_set_port,
.get_port = aplaudio_get_port,
.query_devinfo = aplaudio_query_devinfo,
- .get_props = aplaudio_get_props,
.round_blocksize = aplaudio_round_blocksize,
.round_buffersize = aplaudio_round_buffersize,
.trigger_output = aplaudio_trigger_output,
return ENXIO;
}
-int
-aplaudio_get_props(void *cookie)
-{
- struct aplaudio_softc *sc = cookie;
- struct dai_device *dai = sc->sc_dai_cpu;
- const struct audio_hw_if *hwif = dai->dd_hw_if;
-
- if (hwif->get_props)
- return hwif->get_props(dai->dd_cookie);
-
- return 0;
-}
-
int
aplaudio_round_blocksize(void *cookie, int block)
{
-/* $OpenBSD: aplmca.c,v 1.4 2022/10/19 07:59:26 kn Exp $ */
+/* $OpenBSD: aplmca.c,v 1.5 2022/10/28 15:09:45 kn Exp $ */
/*
* Copyright (c) 2022 Mark Kettenis <kettenis@openbsd.org>
*
#include <sys/audioio.h>
#include <sys/device.h>
#include <sys/malloc.h>
+#include <sys/fcntl.h>
#include <machine/bus.h>
#include <machine/fdt.h>
int aplmca_set_format(void *, uint32_t, uint32_t, uint32_t);
int aplmca_set_sysclk(void *, uint32_t);
+int aplmca_open(void *, int);
int aplmca_set_params(void *, int, int,
struct audio_params *, struct audio_params *);
void *aplmca_allocm(void *, int, size_t, int, int);
void aplmca_freem(void *, void *, int);
-int aplmca_get_props(void *);
int aplmca_trigger_output(void *, void *, void *, int,
void (*)(void *), void *, struct audio_params *);
int aplmca_trigger_input(void *, void *, void *, int,
int aplmca_halt_input(void *);
const struct audio_hw_if aplmca_hw_if = {
+ .open = aplmca_open,
.set_params = aplmca_set_params,
- .get_props = aplmca_get_props,
.allocm = aplmca_allocm,
.freem = aplmca_freem,
.trigger_output = aplmca_trigger_output,
return clock_set_frequency_idx(sc->sc_node, ad->ad_cluster, rate);
}
+int
+aplmca_open(void *cookie, int flags)
+{
+ if ((flags & (FWRITE | FREAD)) == (FWRITE | FREAD))
+ return ENXIO;
+
+ return 0;
+}
+
int
aplmca_set_params(void *cookie, int setmode, int usemode,
struct audio_params *play, struct audio_params *rec)
return 0;
}
-int
-aplmca_get_props(void *cookie)
-{
- return 0;
-}
-
void *
aplmca_allocm(void *cookie, int direction, size_t size, int type,
int flags)
-/* $OpenBSD: nec86.c,v 1.7 2022/10/19 19:14:16 kn Exp $ */
+/* $OpenBSD: nec86.c,v 1.8 2022/10/28 15:09:45 kn Exp $ */
/* $NecBSD: nec86.c,v 1.11 1999/07/23 11:04:39 honda Exp $ */
/* $NetBSD$ */
.set_port = nec86hw_mixer_set_port,
.get_port = nec86hw_mixer_get_port,
.query_devinfo = nec86hw_mixer_query_devinfo,
- .get_props = nec86_get_props,
};
/*
-/* $OpenBSD: nec86hw.c,v 1.7 2022/10/19 15:34:02 kn Exp $ */
+/* $OpenBSD: nec86hw.c,v 1.8 2022/10/28 15:09:45 kn Exp $ */
/* $NecBSD: nec86hw.c,v 1.13 1998/03/14 07:04:54 kmatsuda Exp $ */
/* $NetBSD$ */
#include <sys/syslog.h>
#include <sys/device.h>
#include <sys/proc.h>
+#include <sys/fcntl.h>
#include <machine/bus.h>
#include <machine/cpu.h>
struct nec86hw_softc *sc = arg;
DPRINTF(("nec86hw_open: sc=%p\n", sc));
+ if ((flags & (FWRITE | FREAD)) == (FWRITE | FREAD))
+ return ENXIO;
+
if (sc->sc_open != 0 || nec86hw_reset(sc) != 0)
return ENXIO;
mtx_leave(&audio_lock);
return 1;
}
-
-int
-nec86_get_props(void *addr)
-{
- return 0;
-}
-/* $OpenBSD: nec86hwvar.h,v 1.4 2022/10/19 15:34:02 kn Exp $ */
+/* $OpenBSD: nec86hwvar.h,v 1.5 2022/10/28 15:09:45 kn Exp $ */
/* $NecBSD: nec86hwvar.h,v 1.10 1998/03/14 07:04:55 kmatsuda Exp $ */
/* $NetBSD$ */
int nec86hw_intr(void *);
-int nec86_get_props(void *);
-
#endif /* _KERNEL */
#endif /* !_NEC86HWVAR_H_ */
-/* $OpenBSD: graphaudio.c,v 1.4 2022/04/06 18:59:28 naddy Exp $ */
+/* $OpenBSD: graphaudio.c,v 1.5 2022/10/28 15:09:45 kn Exp $ */
/*
* Copyright (c) 2020 Patrick Wildt <patrick@blueri.se>
* Copyright (c) 2021 Mark Kettenis <kettenis@openbsd.org>
int graphaudio_set_port(void *, mixer_ctrl_t *);
int graphaudio_get_port(void *, mixer_ctrl_t *);
int graphaudio_query_devinfo(void *, mixer_devinfo_t *);
-int graphaudio_get_props(void *);
int graphaudio_round_blocksize(void *, int);
size_t graphaudio_round_buffersize(void *, int, size_t);
int graphaudio_trigger_output(void *, void *, void *, int,
.set_port = graphaudio_set_port,
.get_port = graphaudio_get_port,
.query_devinfo = graphaudio_query_devinfo,
- .get_props = graphaudio_get_props,
.round_blocksize = graphaudio_round_blocksize,
.round_buffersize = graphaudio_round_buffersize,
.trigger_output = graphaudio_trigger_output,
return ENXIO;
}
-int
-graphaudio_get_props(void *cookie)
-{
- struct graphaudio_softc *sc = cookie;
- struct dai_device *dai = sc->sc_dai_cpu;
- const struct audio_hw_if *hwif = dai->dd_hw_if;
-
- if (hwif->get_props)
- return hwif->get_props(dai->dd_cookie);
-
- return 0;
-}
-
int
graphaudio_round_blocksize(void *cookie, int block)
{
-/* $OpenBSD: rkiis.c,v 1.3 2022/04/06 18:59:28 naddy Exp $ */
+/* $OpenBSD: rkiis.c,v 1.4 2022/10/28 15:09:45 kn Exp $ */
/* $NetBSD: rk_i2s.c,v 1.3 2020/02/29 05:51:10 isaki Exp $ */
/*-
* Copyright (c) 2019 Jared McNeill <jmcneill@invisible.ca>
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/malloc.h>
+#include <sys/fcntl.h>
#include <machine/intr.h>
#include <machine/bus.h>
int rkiis_set_sysclk(void *, uint32_t);
int rkiis_open(void *, int);
-void rkiis_close(void *);
int rkiis_set_params(void *, int, int,
struct audio_params *, struct audio_params *);
void *rkiis_allocm(void *, int, size_t, int, int);
void rkiis_freem(void *, void *, int);
-int rkiis_get_props(void *);
int rkiis_trigger_output(void *, void *, void *, int,
void (*)(void *), void *, struct audio_params *);
int rkiis_trigger_input(void *, void *, void *, int,
};
const struct audio_hw_if rkiis_hw_if = {
+ .open = rkiis_open,
.set_params = rkiis_set_params,
- .get_props = rkiis_get_props,
.allocm = rkiis_allocm,
.freem = rkiis_freem,
.trigger_output = rkiis_trigger_output,
return 0;
}
+int
+rkiis_open(void *cookie, int flags)
+{
+ if ((flags & (FWRITE | FREAD)) == (FWRITE | FREAD))
+ return ENXIO;
+
+ return 0;
+}
+
int
rkiis_set_params(void *cookie, int setmode, int usemode,
struct audio_params *play, struct audio_params *rec)
return 0;
}
-int
-rkiis_get_props(void *cookie)
-{
- return 0;
-}
-
void *
rkiis_allocm(void *cookie, int direction, size_t size, int type,
int flags)
-/* $OpenBSD: simpleaudio.c,v 1.6 2022/08/01 09:50:02 kettenis Exp $ */
+/* $OpenBSD: simpleaudio.c,v 1.7 2022/10/28 15:09:45 kn Exp $ */
/*
* Copyright (c) 2020 Patrick Wildt <patrick@blueri.se>
*
int simpleaudio_set_port(void *, mixer_ctrl_t *);
int simpleaudio_get_port(void *, mixer_ctrl_t *);
int simpleaudio_query_devinfo(void *, mixer_devinfo_t *);
-int simpleaudio_get_props(void *);
int simpleaudio_round_blocksize(void *, int);
size_t simpleaudio_round_buffersize(void *, int, size_t);
int simpleaudio_trigger_output(void *, void *, void *, int,
.set_port = simpleaudio_set_port,
.get_port = simpleaudio_get_port,
.query_devinfo = simpleaudio_query_devinfo,
- .get_props = simpleaudio_get_props,
.round_blocksize = simpleaudio_round_blocksize,
.round_buffersize = simpleaudio_round_buffersize,
.trigger_output = simpleaudio_trigger_output,
return ENXIO;
}
-int
-simpleaudio_get_props(void *cookie)
-{
- struct simpleaudio_softc *sc = cookie;
- struct dai_device *dai = sc->sc_dai_cpu;
- const struct audio_hw_if *hwif = dai->dd_hw_if;
-
- if (hwif->get_props)
- return hwif->get_props(dai->dd_cookie);
-
- return 0;
-}
-
int
simpleaudio_round_blocksize(void *cookie, int block)
{
-/* $OpenBSD: arcofi.c,v 1.20 2022/06/27 20:14:51 miod Exp $ */
+/* $OpenBSD: arcofi.c,v 1.21 2022/10/28 15:09:45 kn Exp $ */
/*
* Copyright (c) 2011 Miodrag Vallat.
#include <sys/kernel.h>
#include <sys/proc.h>
#include <sys/endian.h>
+#include <sys/fcntl.h>
#include <sys/audioio.h>
#include <dev/audio_if.h>
void arcofi_close(void *);
int arcofi_commit_settings(void *);
int arcofi_get_port(void *, mixer_ctrl_t *);
-int arcofi_get_props(void *);
int arcofi_halt_input(void *);
int arcofi_halt_output(void *);
int arcofi_open(void *, int);
.set_port = arcofi_set_port,
.get_port = arcofi_get_port,
.query_devinfo = arcofi_query_devinfo,
- .get_props = arcofi_get_props,
};
/* mixer items */
{
struct arcofi_softc *sc = (struct arcofi_softc *)v;
+ if ((flags & (FWRITE | FREAD)) == (FWRITE | FREAD))
+ return ENXIO;
if (sc->sc_open)
return EBUSY;
sc->sc_open = 1;
return 0;
}
-int
-arcofi_get_props(void *v)
-{
- return 0;
-}
-
int
arcofi_hwintr(void *v)
{
-/* $OpenBSD: maestro.c,v 1.49 2022/10/19 19:14:17 kn Exp $ */
+/* $OpenBSD: maestro.c,v 1.50 2022/10/28 15:09:46 kn Exp $ */
/* $FreeBSD: /c/ncvs/src/sys/dev/sound/pci/maestro.c,v 1.3 2000/11/21 12:22:11 julian Exp $ */
/*
* FreeBSD's ESS Agogo/Maestro driver
int maestro_query_devinfo(void *, mixer_devinfo_t *);
void *maestro_malloc(void *, int, size_t, int, int);
void maestro_free(void *, void *, int);
-int maestro_get_props(void *);
int maestro_trigger_output(void *, void *, void *, int, void (*)(void *),
void *, struct audio_params *);
int maestro_trigger_input(void *, void *, void *, int, void (*)(void *),
.query_devinfo = maestro_query_devinfo,
.allocm = maestro_malloc,
.freem = maestro_free,
- .get_props = maestro_get_props,
.trigger_output = maestro_trigger_output,
.trigger_input = maestro_trigger_input,
};
salloc_free(sc->dmapool, ptr);
}
-int
-maestro_get_props(void *self)
-{
- /* struct maestro_softc *sc = (struct maestro_softc *)self; */
-
- return (0); /* XXX */
-}
-
int
maestro_set_port(void *self, mixer_ctrl_t *cp)
{
struct maestro_softc *sc = (struct maestro_softc *)hdl;
DPRINTF(("%s: open(%d)\n", sc->dev.dv_xname, flags));
+ if ((flags & (FWRITE | FREAD)) == (FWRITE | FREAD))
+ return ENXIO; /* XXX */
+
/* XXX work around VM brokeness */
#if 0
if ((OFLAGS(flags) & O_ACCMODE) != O_WRONLY)