summaryrefslogtreecommitdiff
path: root/sys/arch/macppc
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/macppc')
-rw-r--r--sys/arch/macppc/conf/GENERIC4
-rw-r--r--sys/arch/macppc/conf/files.macppc7
-rw-r--r--sys/arch/macppc/dev/aoa.c165
-rw-r--r--sys/arch/macppc/dev/snapper.c5
4 files changed, 176 insertions, 5 deletions
diff --git a/sys/arch/macppc/conf/GENERIC b/sys/arch/macppc/conf/GENERIC
index 18c7f3592a1..534ba7427de 100644
--- a/sys/arch/macppc/conf/GENERIC
+++ b/sys/arch/macppc/conf/GENERIC
@@ -1,4 +1,4 @@
-# $OpenBSD: GENERIC,v 1.92 2005/10/30 23:55:02 joris Exp $g
+# $OpenBSD: GENERIC,v 1.93 2005/10/31 00:04:53 joris Exp $g
#
# For further information on compiling OpenBSD kernels, see the config(8)
# man page.
@@ -143,6 +143,7 @@ zstty* at zsc?
awacs* at macobio? # Apple audio device
ki2c* at macobio? # Keywest I2C
snapper* at macobio? # Snapper audio device
+aoa* at macobio? # aoa audio device
daca* at macobio? # Dac3550a audio device
bktr0 at pci? # Bt8[47][89] tv/fmradio/video
@@ -264,6 +265,7 @@ audio* at awacs?
audio* at snapper?
audio* at eap?
audio* at uaudio?
+audio* at aoa?
audio* at daca?
sd* at scsibus?
diff --git a/sys/arch/macppc/conf/files.macppc b/sys/arch/macppc/conf/files.macppc
index 4d26e998349..e04786691bb 100644
--- a/sys/arch/macppc/conf/files.macppc
+++ b/sys/arch/macppc/conf/files.macppc
@@ -1,4 +1,4 @@
-# $OpenBSD: files.macppc,v 1.29 2005/10/30 23:55:02 joris Exp $
+# $OpenBSD: files.macppc,v 1.30 2005/10/31 00:04:53 joris Exp $
#
# macppc-specific configuration info
@@ -202,6 +202,11 @@ device snapper: audio, auconv, mulaw, i2s
attach snapper at macobio
file arch/macppc/dev/snapper.c snapper
+# aoa audio
+device aoa: audio, auconv, mulaw, i2s
+attach aoa at macobio
+file arch/macppc/dev/aoa.c aoa
+
# daca audio
device daca: audio, auconv, mulaw, i2s
attach daca at macobio
diff --git a/sys/arch/macppc/dev/aoa.c b/sys/arch/macppc/dev/aoa.c
new file mode 100644
index 00000000000..3c9edf466e2
--- /dev/null
+++ b/sys/arch/macppc/dev/aoa.c
@@ -0,0 +1,165 @@
+/* $OpenBSD: aoa.c,v 1.1 2005/10/31 00:04:54 joris Exp $ */
+/* $Id: aoa.c,v 1.1 2005/10/31 00:04:54 joris Exp $ */
+
+/*-
+ * Copyright (c) 2005 Tsubai Masanari. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * WORK-IN-PROGRESS AOAKeylargo audio driver.
+ */
+
+#include <sys/param.h>
+#include <sys/audioio.h>
+#include <sys/device.h>
+#include <sys/systm.h>
+
+#include <dev/audio_if.h>
+#include <dev/ofw/openfirm.h>
+
+#include <machine/autoconf.h>
+#include <macppc/dev/dbdma.h>
+
+#include <macppc/dev/i2svar.h>
+
+#ifdef AOA_DEBUG
+# define DPRINTF printf
+#else
+# define DPRINTF while (0) printf
+#endif
+
+#define aoa_softc i2s_softc /* XXX */
+
+int aoa_match(struct device *, void *, void *);
+void aoa_attach(struct device *, struct device *, void *);
+
+/* XXX */
+int aoa_getdev(void *, struct audio_device *);
+
+void aoa_set_volume(struct aoa_softc *, int, int);
+
+struct cfattach aoa_ca = {
+ sizeof(struct aoa_softc), aoa_match, aoa_attach
+};
+
+struct cfdriver aoa_cd = {
+ NULL, "aoa", DV_DULL
+};
+
+struct audio_hw_if aoa_hw_if = {
+ i2s_open,
+ i2s_close,
+ NULL,
+ i2s_query_encoding,
+ i2s_set_params,
+ i2s_round_blocksize,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ i2s_halt_output,
+ i2s_halt_input,
+ NULL,
+ aoa_getdev,
+ NULL,
+ i2s_set_port,
+ i2s_get_port,
+ i2s_query_devinfo,
+ i2s_allocm,
+ NULL,
+ i2s_round_buffersize,
+ i2s_mappage,
+ i2s_get_props,
+ i2s_trigger_output,
+ i2s_trigger_input,
+};
+
+struct audio_device aoa_device = {
+ "AOA",
+ "",
+ "aoa"
+};
+
+int
+aoa_match(parent, match, aux)
+ struct device *parent;
+ void *match;
+ void *aux;
+{
+ struct confargs *ca = aux;
+ int soundbus, soundchip;
+ char compat[32];
+
+ if (strcmp(ca->ca_name, "i2s") != 0)
+ return 0;
+
+ if ((soundbus = OF_child(ca->ca_node)) == 0 ||
+ (soundchip = OF_child(soundbus)) == 0)
+ return 0;
+
+ bzero(compat, sizeof compat);
+ OF_getprop(soundchip, "compatible", compat, sizeof compat);
+
+ if (strcmp(compat, "AOAKeylargo") == 0)
+ return 1;
+ if (strcmp(compat, "AOAK2") == 0)
+ return 1;
+ if (strcmp(compat, "AOAbase") == 0)
+ return 1;
+
+ return 0;
+}
+
+void
+aoa_attach(parent, self, aux)
+ struct device *parent, *self;
+ void *aux;
+{
+ struct aoa_softc *sc = (struct aoa_softc *)self;
+
+ /* "set volume" callback */
+ sc->sc_setvolume = aoa_set_volume;
+
+ i2s_attach(parent, sc, aux);
+ audio_attach_mi(&aoa_hw_if, sc, &sc->sc_dev);
+}
+
+int
+aoa_getdev(h, retp)
+ void *h;
+ struct audio_device *retp;
+{
+ *retp = aoa_device;
+ return 0;
+}
+
+void
+aoa_set_volume(sc, left, right)
+ struct aoa_softc *sc;
+ int left, right;
+{
+ printf("aoa_set_volume() not supported yet\n");
+}
diff --git a/sys/arch/macppc/dev/snapper.c b/sys/arch/macppc/dev/snapper.c
index c7b1e3ebe70..54163a60434 100644
--- a/sys/arch/macppc/dev/snapper.c
+++ b/sys/arch/macppc/dev/snapper.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: snapper.c,v 1.21 2005/10/28 15:27:49 joris Exp $ */
+/* $OpenBSD: snapper.c,v 1.22 2005/10/31 00:04:54 joris Exp $ */
/* $NetBSD: snapper.c,v 1.1 2003/12/27 02:19:34 grant Exp $ */
/*-
@@ -222,8 +222,7 @@ snapper_match(parent, match, aux)
bzero(compat, sizeof compat);
OF_getprop(soundchip, "compatible", compat, sizeof compat);
- if (strcmp(compat, "snapper") != 0 &&
- strcmp(compat, "AOAKeylargo") != 0)
+ if (strcmp(compat, "snapper") != 0)
return 0;
return 1;