diff --git a/sys/arch/sparc/conf/files.sparc b/sys/arch/sparc/conf/files.sparc index 055d602c6a76..d7138e2060c6 100644 --- a/sys/arch/sparc/conf/files.sparc +++ b/sys/arch/sparc/conf/files.sparc @@ -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 @@ file arch/sparc/dev/esp_obio.c esp_obio 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 --git a/sys/arch/sparc/dev/audioamd.c b/sys/arch/sparc/dev/audioamd.c index 1084d10e4983..df2743ab306b 100644 --- a/sys/arch/sparc/dev/audioamd.c +++ b/sys/arch/sparc/dev/audioamd.c @@ -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 @@ struct audioamd_softc { 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 @@ void audioamd_attach(struct audioamd_softc *sc, int); 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); @@ -201,6 +206,20 @@ audioamd_mainbus_match(parent, cf, aux) return (strcmp(AUDIO_ROM_NAME, ma->ma_name) == 0); } +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; @@ -236,6 +255,28 @@ audioamd_mainbus_attach(parent, self, aux) 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)