summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2012-03-01 08:17:27 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2012-03-01 08:17:27 +0000
commit3b6042c7c44236d057d289ded8c2dc257783718f (patch)
treed9f3ada19ea1afbb7191901e7f064cee135d0710 /sys
parent428d6c67baff052987465f1203c1ed6d61ba7a46 (diff)
zaudio is play only, so return ENXIO on any attempt to open the device
for recording. Fixes full-duplex apps (including sndiod) unable to fall back to play-only mode. Found by david@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/zaurus/dev/zaurus_audio.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/arch/zaurus/dev/zaurus_audio.c b/sys/arch/zaurus/dev/zaurus_audio.c
index ec620d0dbf5..90ce080bb3f 100644
--- a/sys/arch/zaurus/dev/zaurus_audio.c
+++ b/sys/arch/zaurus/dev/zaurus_audio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zaurus_audio.c,v 1.14 2010/09/07 16:21:41 deraadt Exp $ */
+/* $OpenBSD: zaurus_audio.c,v 1.15 2012/03/01 08:17:26 ratchov Exp $ */
/*
* Copyright (c) 2005 Christopher Pascoe <pascoe@openbsd.org>
@@ -27,6 +27,7 @@
#include <sys/device.h>
#include <sys/malloc.h>
#include <sys/kernel.h>
+#include <sys/fcntl.h>
#include <sys/audioio.h>
#include <machine/intr.h>
@@ -454,6 +455,10 @@ zaudio_open(void *hdl, int flags)
{
struct zaudio_softc *sc = hdl;
+ /* can't record yet */
+ if (flags & FREAD)
+ return (ENXIO);
+
/* Power on the I2S bus and codec */
pxa2x0_i2s_open(&sc->sc_i2s);