diff options
author | netchild <netchild@FreeBSD.org> | 2007-02-23 13:47:34 +0000 |
---|---|---|
committer | netchild <netchild@FreeBSD.org> | 2007-02-23 13:47:34 +0000 |
commit | 9ff48da7de1cc980a6dfd473d85d650be9f062ed (patch) | |
tree | 91b4aaae1205fe7533687333d8fb0c6e818d5d53 /sys/dev/sound/pci/ds1.c | |
parent | 6a2ffa86e5b748ba71e36d37462a936eb9101be7 (diff) | |
download | FreeBSD-src-9ff48da7de1cc980a6dfd473d85d650be9f062ed.zip FreeBSD-src-9ff48da7de1cc980a6dfd473d85d650be9f062ed.tar.gz |
MFp4 (114068):
Use bus_get_dma_tag() to obtain the parent DMA tag to make the drivers
a little bit more non-ia32/amd64 friendly.
There is no man page for bus_get_dma_tag, so this is modelled after
rev. 1.62 of src/sys/dev/sound/pci/es137x.c by marius.
Inspired by: commit by marius
Diffstat (limited to 'sys/dev/sound/pci/ds1.c')
-rw-r--r-- | sys/dev/sound/pci/ds1.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/dev/sound/pci/ds1.c b/sys/dev/sound/pci/ds1.c index 19b62e3..7549211 100644 --- a/sys/dev/sound/pci/ds1.c +++ b/sys/dev/sound/pci/ds1.c @@ -157,7 +157,7 @@ struct { */ /* stuff */ -static int ds_init(struct sc_info *); +static int ds_init(struct sc_info *, device_t); static void ds_intr(void *); /* talk to the card */ @@ -785,7 +785,7 @@ ds_setmap(void *arg, bus_dma_segment_t *segs, int nseg, int error) } static int -ds_init(struct sc_info *sc) +ds_init(struct sc_info *sc, device_t dev) { int i; u_int32_t *ci, r, pcs, rcs, ecs, ws, memsz, cb; @@ -833,7 +833,9 @@ ds_init(struct sc_info *sc) memsz += (64 + 1) * 4; if (sc->regbase == NULL) { - if (bus_dma_tag_create(NULL, 2, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, + if (bus_dma_tag_create(bus_get_dma_tag(dev), 2, 0, + BUS_SPACE_MAXADDR_32BIT, + BUS_SPACE_MAXADDR, NULL, NULL, memsz, 1, memsz, 0, NULL, NULL, &sc->control_dmat)) return -1; @@ -970,7 +972,8 @@ ds_pci_attach(device_t dev) sc->bufsz = pcm_getbuffersize(dev, 4096, DS1_BUFFSIZE, 65536); - if (bus_dma_tag_create(/*parent*/NULL, /*alignment*/2, /*boundary*/0, + if (bus_dma_tag_create(/*parent*/bus_get_dma_tag(dev), /*alignment*/2, + /*boundary*/0, /*lowaddr*/BUS_SPACE_MAXADDR_32BIT, /*highaddr*/BUS_SPACE_MAXADDR, /*filter*/NULL, /*filterarg*/NULL, @@ -982,7 +985,7 @@ ds_pci_attach(device_t dev) } sc->regbase = NULL; - if (ds_init(sc) == -1) { + if (ds_init(sc, dev) == -1) { device_printf(dev, "unable to initialize the card\n"); goto bad; } @@ -1050,7 +1053,7 @@ ds_pci_resume(device_t dev) sc = pcm_getdevinfo(dev); - if (ds_init(sc) == -1) { + if (ds_init(sc, dev) == -1) { device_printf(dev, "unable to reinitialize the card\n"); return ENXIO; } |