Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc Add audioamd at obio attachment. Now we have...
details: https://anonhg.NetBSD.org/src/rev/e7f5c831e996
branches: trunk
changeset: 538227:e7f5c831e996
user: jdc <jdc%NetBSD.org@localhost>
date: Tue Oct 15 13:49:52 2002 +0000
description:
Add audioamd at obio attachment. Now we have working audio on 4/600's :
audioamd0 at obio0 slot 0 offset 0x500000 level 13 softpri 4
audio0 at audioamd0: full duplex
diffstat:
sys/arch/sparc/conf/files.sparc | 3 +-
sys/arch/sparc/dev/audioamd.c | 43 ++++++++++++++++++++++++++++++++++++++++-
2 files changed, 44 insertions(+), 2 deletions(-)
diffs (95 lines):
diff -r ff4fdf5fe3e0 -r e7f5c831e996 sys/arch/sparc/conf/files.sparc
--- a/sys/arch/sparc/conf/files.sparc Tue Oct 15 08:53:46 2002 +0000
+++ b/sys/arch/sparc/conf/files.sparc Tue Oct 15 13:49:52 2002 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.sparc,v 1.118 2002/10/03 16:13:24 uwe Exp $
+# $NetBSD: files.sparc,v 1.119 2002/10/15 13:49:52 jdc Exp $
# @(#)files.sparc 8.1 (Berkeley) 7/19/93
# sparc-specific configuration info
@@ -216,6 +216,7 @@
device audioamd: audiobus, am7930
attach audioamd at mainbus with audioamd_mainbus
+attach audioamd at obio with audioamd_obio
attach audioamd at sbus with audioamd_sbus
file arch/sparc/dev/audioamd.c audioamd
file arch/sparc/sparc/amd7930intr.s audioamd
diff -r ff4fdf5fe3e0 -r e7f5c831e996 sys/arch/sparc/dev/audioamd.c
--- a/sys/arch/sparc/dev/audioamd.c Tue Oct 15 08:53:46 2002 +0000
+++ b/sys/arch/sparc/dev/audioamd.c Tue Oct 15 13:49:52 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: audioamd.c,v 1.12 2002/10/02 16:02:12 thorpej Exp $ */
+/* $NetBSD: audioamd.c,v 1.13 2002/10/15 13:49:52 jdc Exp $ */
/* NetBSD: am7930_sparc.c,v 1.44 1999/03/14 22:29:00 jonathan Exp */
/*
@@ -107,6 +107,8 @@
void audioamd_mainbus_attach __P((struct device *,
struct device *, void *));
int audioamd_mainbus_match __P((struct device *, struct cfdata *, void *));
+void audioamd_obio_attach __P((struct device *, struct device *, void *));
+int audioamd_obio_match __P((struct device *, struct cfdata *, void *));
void audioamd_sbus_attach __P((struct device *, struct device *, void *));
int audioamd_sbus_match __P((struct device *, struct cfdata *, void *));
void audioamd_attach(struct audioamd_softc *sc, int);
@@ -114,6 +116,9 @@
CFATTACH_DECL(audioamd_mainbus, sizeof(struct audioamd_softc),
audioamd_mainbus_match, audioamd_mainbus_attach, NULL, NULL);
+CFATTACH_DECL(audioamd_obio, sizeof(struct audioamd_softc),
+ audioamd_obio_match, audioamd_obio_attach, NULL, NULL);
+
CFATTACH_DECL(audioamd_sbus, sizeof(struct audioamd_softc),
audioamd_sbus_match, audioamd_sbus_attach, NULL, NULL);
@@ -202,6 +207,20 @@
}
int
+audioamd_obio_match(parent, cf, aux)
+ struct device *parent;
+ struct cfdata *cf;
+ void *aux;
+{
+ union obio_attach_args *uoba = aux;
+
+ if (uoba->uoba_isobio4 != 0)
+ return (0);
+
+ return (strcmp("audio", uoba->uoba_sbus.sa_name) == 0);
+}
+
+int
audioamd_sbus_match(parent, cf, aux)
struct device *parent;
struct cfdata *cf;
@@ -236,6 +255,28 @@
audioamd_attach(sc, ma->ma_pri);
}
+void
+audioamd_obio_attach(parent, self, aux)
+ struct device *parent, *self;
+ void *aux;
+{
+ union obio_attach_args *uoba = aux;
+ struct sbus_attach_args *sa = &uoba->uoba_sbus;
+ struct audioamd_softc *sc = (struct audioamd_softc *)self;
+ bus_space_handle_t bh;
+
+ sc->sc_bt = sa->sa_bustag;
+
+ if (sbus_bus_map(sa->sa_bustag,
+ sa->sa_slot, sa->sa_offset,
+ AM7930_DREG_SIZE,
+ 0, &bh) != 0) {
+ printf("%s: cannot map registers\n", self->dv_xname);
+ return;
+ }
+ sc->sc_bh = bh;
+ audioamd_attach(sc, sa->sa_pri);
+}
void
audioamd_sbus_attach(parent, self, aux)
Home |
Main Index |
Thread Index |
Old Index