diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2006-05-08 03:28:47 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2006-05-08 03:28:47 +0000 |
commit | a9dfbeb84a851f947455c476a3b89e2fe3d78518 (patch) | |
tree | ccfed5686c3abc7c05b6bf4f75ac66b32887d918 /sys/dev/pci/azalia.c | |
parent | 1ba7e4dbd8d9de3510dad202881c48c396cadbf6 (diff) |
- Don't assume the device always has PCI_MAPREG_MEM_TYPE_64BIT. [1]
- OpenBSD-ify dmesg entry and error path printf's.
[1] From NetBSD
Diffstat (limited to 'sys/dev/pci/azalia.c')
-rw-r--r-- | sys/dev/pci/azalia.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sys/dev/pci/azalia.c b/sys/dev/pci/azalia.c index f41ebbddb8b..8ed0519f958 100644 --- a/sys/dev/pci/azalia.c +++ b/sys/dev/pci/azalia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: azalia.c,v 1.1 2006/04/26 15:53:08 jason Exp $ */ +/* $OpenBSD: azalia.c,v 1.2 2006/05/08 03:28:46 brad Exp $ */ /* $NetBSD: azalia.c,v 1.15 2005/09/29 04:14:03 kent Exp $ */ /*- @@ -375,10 +375,11 @@ azalia_pci_attach(struct device *parent, struct device *self, void *aux) sc->dmat = pa->pa_dmat; - printf(": Generic High Definition Audio Controller\n"); - if (pci_mapreg_map(pa, ICH_PCI_HDBARL, PCI_MAPREG_MEM_TYPE_64BIT, 0, + v = pci_conf_read(pa->pa_pc, pa->pa_tag, ICH_PCI_HDBARL); + v &= PCI_MAPREG_TYPE_MASK | PCI_MAPREG_MEM_TYPE_MASK; + if (pci_mapreg_map(pa, ICH_PCI_HDBARL, v, 0, &sc->iot, &sc->ioh, NULL, &sc->map_size, 0)) { - printf("%s: can't map device i/o space\n", XNAME(sc)); + printf(": can't map device i/o space\n"); return; } @@ -389,7 +390,7 @@ azalia_pci_attach(struct device *parent, struct device *self, void *aux) /* interrupt */ if (pci_intr_map(pa, &ih)) { - printf("%s: can't map interrupt\n", XNAME(sc)); + printf(": can't map interrupt\n"); return; } sc->pc = pa->pa_pc; @@ -397,13 +398,13 @@ azalia_pci_attach(struct device *parent, struct device *self, void *aux) sc->ih = pci_intr_establish(pa->pa_pc, ih, IPL_AUDIO, azalia_intr, sc, sc->dev.dv_xname); if (sc->ih == NULL) { - printf("%s: can't establish interrupt", XNAME(sc)); + printf(": can't establish interrupt"); if (intrrupt_str != NULL) printf(" at %s", intrrupt_str); printf("\n"); return; } - printf("%s: interrupting at %s\n", XNAME(sc), intrrupt_str); + printf(": %s\n", intrrupt_str); if (azalia_attach(sc)) { printf("%s: initialization failure\n", XNAME(sc)); @@ -511,7 +512,7 @@ azalia_attach(azalia_t *az) uint16_t gcap; uint16_t statests; - printf("%s: host: High Definition Audio rev. %d.%d\n", + printf("%s: High Definition Audio, rev. %d.%d\n", XNAME(az), AZ_READ_1(az, VMAJ), AZ_READ_1(az, VMIN)); gcap = AZ_READ_2(az, GCAP); az->nistreams = HDA_GCAP_ISS(gcap); |