Move IRQ setup into frontend. Need to move DRQ handling as well.

This commit is contained in:
mycroft 1999-02-19 16:10:44 +00:00
parent 6edf8af927
commit 4822d3d0b0
5 changed files with 29 additions and 22 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: sb.c,v 1.65 1999/02/18 07:08:35 mycroft Exp $ */
/* $NetBSD: sb.c,v 1.66 1999/02/19 16:10:44 mycroft Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
@ -251,9 +251,6 @@ sbattach(sc)
struct midi_hw_if *mhw = &sb_midi_hw_if;
#endif
sc->sc_ih = isa_intr_establish(sc->sc_ic, sc->sc_irq, sc->sc_ist,
IPL_AUDIO, sbdsp_intr, sc);
sbdsp_attach(sc);
#if NMIDI > 0

View File

@ -1,4 +1,4 @@
/* $NetBSD: sb_isa.c,v 1.19 1998/08/17 21:16:15 augustss Exp $ */
/* $NetBSD: sb_isa.c,v 1.20 1999/02/19 16:10:44 mycroft Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
@ -100,8 +100,9 @@ sbfind(parent, sc, ia)
return 0;
}
sc->sc_iot = ia->ia_iot;
sc->sc_ic = ia->ia_ic;
sc->sc_iot = ia->ia_iot;
/* Map i/o space [we map 24 ports which is the max of the sb and pro */
if (bus_space_map(sc->sc_iot, ia->ia_iobase, SBP_NPORT, 0,
&sc->sc_ioh)) {
@ -110,12 +111,12 @@ sbfind(parent, sc, ia)
return 0;
}
/* XXX These are only for setting chip configuration registers. */
sc->sc_iobase = ia->ia_iobase;
sc->sc_irq = ia->ia_irq;
sc->sc_ist = IST_EDGE;
sc->sc_drq8 = ia->ia_drq;
sc->sc_drq16 = ia->ia_drq2;
sc->sc_ic = ia->ia_ic;
if (!sbmatch(sc))
goto bad;
@ -160,6 +161,9 @@ sb_isa_attach(parent, self, aux)
printf("%s: sbfind failed\n", sc->sc_dev.dv_xname);
return;
}
sc->sc_ic = ia->ia_ic;
sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_EDGE,
IPL_AUDIO, sbdsp_intr, sc);
sbattach(sc);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: sbdspvar.h,v 1.40 1999/02/18 15:47:29 mycroft Exp $ */
/* $NetBSD: sbdspvar.h,v 1.41 1999/02/19 16:10:44 mycroft Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
@ -93,15 +93,15 @@
*/
struct sbdsp_softc {
struct device sc_dev; /* base device */
struct isadev sc_id; /* ISA device */
isa_chipset_tag_t sc_ic;
bus_space_tag_t sc_iot; /* tag */
bus_space_handle_t sc_ioh; /* handle */
void *sc_ih; /* interrupt vectoring */
/* XXX These are only for setting chip configuration registers. */
int sc_iobase; /* I/O port base address */
int sc_irq; /* interrupt */
int sc_ist; /* interrupt share type */
int sc_drq8; /* DMA (8-bit) */
int sc_drq16; /* DMA (16-bit) */

View File

@ -1,4 +1,4 @@
/* $NetBSD: sb_isapnp.c,v 1.29 1998/08/17 21:16:16 augustss Exp $ */
/* $NetBSD: sb_isapnp.c,v 1.30 1999/02/19 16:10:44 mycroft Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
@ -107,14 +107,15 @@ sb_isapnp_attach(parent, self, aux)
return;
}
sc->sc_iot = ipa->ipa_iot;
sc->sc_ioh = ipa->ipa_io[0].h;
sc->sc_ic = ipa->ipa_ic;
sc->sc_iobase = ipa->ipa_io[0].base;
sc->sc_iot = ipa->ipa_iot;
sc->sc_ioh = ipa->ipa_io[0].h;
/* XXX These are only for setting chip configuration registers. */
sc->sc_iobase = ipa->ipa_io[0].base;
sc->sc_irq = ipa->ipa_irq[0].num;
sc->sc_ist = ipa->ipa_irq[0].type;
sc->sc_drq8 = ipa->ipa_drq[0].num;
if (ipa->ipa_ndrq > 1 && ipa->ipa_drq[0].num != ipa->ipa_drq[1].num) {
/* Some cards have the 16 bit drq first */
@ -139,6 +140,9 @@ sb_isapnp_attach(parent, self, aux)
return;
}
sc->sc_ih = isa_intr_establish(ipa->ipa_ic, ipa->ipa_irq[0].num,
ipa->ipa_irq[0].type, IPL_AUDIO, sbdsp_intr, sc);
printf("%s: %s %s", sc->sc_dev.dv_xname, ipa->ipa_devident,
ipa->ipa_devclass);

View File

@ -1,4 +1,4 @@
/* $NetBSD: sb_ofisa.c,v 1.3 1998/08/18 17:55:09 thorpej Exp $ */
/* $NetBSD: sb_ofisa.c,v 1.4 1999/02/19 16:10:44 mycroft Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -145,15 +145,14 @@ sb_ofisa_attach(parent, self, aux)
sc->sc_ic = aa->ic;
sc->sc_iot = aa->iot;
sc->sc_iobase = reg.addr;
if (bus_space_map(sc->sc_iot, sc->sc_iobase, reg.len, 0,
&sc->sc_ioh)) {
if (bus_space_map(sc->sc_iot, reg.addr, reg.len, 0, &sc->sc_ioh)) {
printf(": unable to map register space\n");
return;
}
/* XXX These are only for setting chip configuration registers. */
sc->sc_iobase = reg.addr;
sc->sc_irq = intr.irq;
sc->sc_ist = intr.share;
sc->sc_drq8 = DRQUNK;
sc->sc_drq16 = DRQUNK;
@ -185,6 +184,9 @@ sb_ofisa_attach(parent, self, aux)
return;
}
sc->sc_ih = isa_intr_establish(aa_ic, intr.irq, IST_EDGE, IPL_AUDIO,
sbdsp_intr, sc);
n = OF_getproplen(aa->oba.oba_phandle, "model");
if (n > 0) {
model = alloca(n);