summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/audio.c11
-rw-r--r--sys/dev/audio_if.h4
-rw-r--r--sys/dev/isa/ad1848.c14
-rw-r--r--sys/dev/isa/pas.c8
-rw-r--r--sys/dev/isa/pss.c8
-rw-r--r--sys/dev/isa/sbdsp.c10
6 files changed, 24 insertions, 31 deletions
diff --git a/sys/dev/audio.c b/sys/dev/audio.c
index 8a292ffa157..edeeb6d33b5 100644
--- a/sys/dev/audio.c
+++ b/sys/dev/audio.c
@@ -1,4 +1,4 @@
-/* $NetBSD: audio.c,v 1.54 1997/07/27 23:51:53 augustss Exp $ */
+/* $NetBSD: audio.c,v 1.55 1997/07/28 01:31:50 augustss Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
@@ -185,8 +185,8 @@ audio_alloc_ring(sc, r, bufsize)
ROUNDSIZE(bufsize);
if (bufsize < AUMINBUF)
bufsize = AUMINBUF;
- if (hw->roundbuffer)
- bufsize = hw->roundbuffer(hdl, bufsize);
+ if (hw->round_buffersize)
+ bufsize = hw->round_buffersize(hdl, bufsize);
r->bufsize = bufsize;
if (hw->alloc)
r->start = hw->alloc(hdl, r->bufsize, M_DEVBUF, M_WAITOK);
@@ -249,7 +249,6 @@ audio_hardware_attach(hwp, hdlp)
hwp->close == 0 ||
hwp->query_encoding == 0 ||
hwp->set_params == 0 ||
- hwp->round_blocksize == 0 ||
hwp->set_out_port == 0 ||
hwp->get_out_port == 0 ||
hwp->set_in_port == 0 ||
@@ -958,7 +957,9 @@ audio_calc_blksize(sc, mode)
bs = parm->sample_rate * audio_blk_ms / 1000 *
parm->channels * parm->precision / NBBY;
ROUNDSIZE(bs);
- rb->blksize = hw->round_blocksize(sc->hw_hdl, bs);
+ if (hw->round_blocksize)
+ bs = hw->round_blocksize(sc->hw_hdl, bs);
+ rb->blksize = bs;
DPRINTF(("audio_calc_blksize: %s blksize=%d\n",
mode == AUMODE_PLAY ? "play" : "record", bs));
diff --git a/sys/dev/audio_if.h b/sys/dev/audio_if.h
index 890d1c5ccc9..ac63322f284 100644
--- a/sys/dev/audio_if.h
+++ b/sys/dev/audio_if.h
@@ -1,4 +1,4 @@
-/* $NetBSD: audio_if.h,v 1.14 1997/07/27 01:16:46 augustss Exp $ */
+/* $NetBSD: audio_if.h,v 1.15 1997/07/28 01:31:53 augustss Exp $ */
/*
* Copyright (c) 1994 Havard Eidnes.
@@ -116,7 +116,7 @@ struct audio_hw_if {
/* Allocate/free memory for the ring buffer. Usually malloc/free. */
void *(*alloc)__P((void *, unsigned long, int, int));
void (*free)__P((void *, void *, int));
- unsigned long (*roundbuffer)__P((void *, unsigned long));
+ unsigned long (*round_buffersize)__P((void *, unsigned long));
int props; /* device properties */
int audio_unit;
diff --git a/sys/dev/isa/ad1848.c b/sys/dev/isa/ad1848.c
index 337d8dbe7d6..c2ed0a5e721 100644
--- a/sys/dev/isa/ad1848.c
+++ b/sys/dev/isa/ad1848.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ad1848.c,v 1.33 1997/07/27 01:16:50 augustss Exp $ */
+/* $NetBSD: ad1848.c,v 1.34 1997/07/28 01:31:55 augustss Exp $ */
/*
* Copyright (c) 1994 John Brezak
@@ -499,7 +499,7 @@ ad1848_attach(sc)
sc->sc_recrun = NOTRUNNING;
if (sc->sc_drq != -1) {
- if (isa_dmamap_create(sc->sc_isa, sc->sc_drq, MAXPHYS /* XXX */,
+ if (isa_dmamap_create(sc->sc_isa, sc->sc_drq, MAX_ISADMA,
BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW)) {
printf("ad1848_attach: can't create map for drq %d\n",
sc->sc_drq);
@@ -507,7 +507,7 @@ ad1848_attach(sc)
}
}
if (sc->sc_recdrq != -1 && sc->sc_recdrq != sc->sc_drq) {
- if (isa_dmamap_create(sc->sc_isa, sc->sc_recdrq, MAXPHYS /* XXX */,
+ if (isa_dmamap_create(sc->sc_isa, sc->sc_recdrq, MAX_ISADMA,
BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW)) {
printf("ad1848_attach: can't creape map for drq %d\n",
sc->sc_recdrq);
@@ -1152,12 +1152,8 @@ ad1848_round_blocksize(addr, blk)
sc->sc_lastcc = -1;
- /* Don't try to DMA too much at once. */
- if (blk > NBPG)
- blk = NBPG;
-
- /* Round to a multiple of the sample size. */
- blk &= -(sc->channels * sc->precision / 8);
+ /* Round to a multiple of the biggest sample size. */
+ blk &= -4;
return (blk);
}
diff --git a/sys/dev/isa/pas.c b/sys/dev/isa/pas.c
index 7cdf20c7497..6b1d5583f0c 100644
--- a/sys/dev/isa/pas.c
+++ b/sys/dev/isa/pas.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pas.c,v 1.30 1997/07/27 23:51:57 augustss Exp $ */
+/* $NetBSD: pas.c,v 1.31 1997/07/28 01:31:57 augustss Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
@@ -120,8 +120,8 @@ struct audio_hw_if pas_hw_if = {
sbdsp_set_in_port,
sbdsp_get_in_port,
0,
- 0,
- 0,
+ sbdsp_dma_init_output,
+ sbdsp_dma_init_input,
sbdsp_dma_output,
sbdsp_dma_input,
sbdsp_haltdma,
@@ -137,7 +137,7 @@ struct audio_hw_if pas_hw_if = {
sb_malloc,
sb_free,
sb_round,
- 0,
+ AUDIO_PROP_MMAP,
0
};
diff --git a/sys/dev/isa/pss.c b/sys/dev/isa/pss.c
index 768a39a6ded..5292bd86668 100644
--- a/sys/dev/isa/pss.c
+++ b/sys/dev/isa/pss.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pss.c,v 1.30 1997/07/27 23:51:59 augustss Exp $ */
+/* $NetBSD: pss.c,v 1.31 1997/07/28 01:32:00 augustss Exp $ */
/*
* Copyright (c) 1994 John Brezak
@@ -241,8 +241,8 @@ struct audio_hw_if pss_audio_if = {
pss_set_in_port,
pss_get_in_port,
ad1848_commit_settings,
- NULL,
- NULL,
+ ad1848_dma_init_output,
+ ad1848_dma_init_input,
ad1848_dma_output,
ad1848_dma_input,
ad1848_halt_out_dma,
@@ -258,7 +258,7 @@ struct audio_hw_if pss_audio_if = {
ad1848_malloc,
ad1848_free,
ad1848_round,
- 0,
+ AUDIO_PROP_MMAP,
0
};
diff --git a/sys/dev/isa/sbdsp.c b/sys/dev/isa/sbdsp.c
index 58ab627a2f1..d816884ca62 100644
--- a/sys/dev/isa/sbdsp.c
+++ b/sys/dev/isa/sbdsp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sbdsp.c,v 1.61 1997/07/27 23:52:01 augustss Exp $ */
+/* $NetBSD: sbdsp.c,v 1.62 1997/07/28 01:32:02 augustss Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
@@ -68,8 +68,6 @@
#include <dev/isa/sbreg.h>
#include <dev/isa/sbdspvar.h>
-#define MAXDMA 65536 /* XXX */
-
#ifdef AUDIO_DEBUG
#define DPRINTF(x) if (sbdspdebug) printf x
int sbdspdebug = 0;
@@ -323,7 +321,7 @@ sbdsp_attach(sc)
*/
if (sc->sc_drq8 != -1) {
if (isa_dmamap_create(sc->sc_isa, sc->sc_drq8,
- MAXPHYS /* XXX */, BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW)) {
+ MAX_ISADMA, BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW)) {
printf("%s: can't create map for drq %d\n",
sc->sc_dev.dv_xname, sc->sc_drq8);
return;
@@ -331,7 +329,7 @@ sbdsp_attach(sc)
}
if (sc->sc_drq16 != -1 && sc->sc_drq16 != sc->sc_drq8) {
if (isa_dmamap_create(sc->sc_isa, sc->sc_drq16,
- MAXPHYS /* XXX */, BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW)) {
+ MAX_ISADMA, BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW)) {
printf("%s: can't create map for drq %d\n",
sc->sc_dev.dv_xname, sc->sc_drq16);
return;
@@ -801,8 +799,6 @@ sbdsp_round_blocksize(addr, blk)
void *addr;
int blk;
{
- if (blk > MAXDMA)
- blk = MAXDMA; /* cannot DMA more than 64k */
blk &= -4; /* round to biggest sample size */
return blk;
}