Use EBDMA_BURST_SIZE_16. Introduce EBus specific round_blocksize to

make block size multiple of 16 words.  No point in using
round_buffersize that returns the argument unchanged, so just NULL it
in audio_hw_if.
This commit is contained in:
uwe 2003-09-10 10:40:40 +00:00
parent d963f70264
commit b3935a6934
1 changed files with 19 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: cs4231_ebus.c,v 1.12 2003/07/14 15:47:05 lukem Exp $ */
/* $NetBSD: cs4231_ebus.c,v 1.13 2003/09/10 10:40:40 uwe Exp $ */
/*
* Copyright (c) 2002 Valeriy E. Ushakov
@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cs4231_ebus.c,v 1.12 2003/07/14 15:47:05 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: cs4231_ebus.c,v 1.13 2003/09/10 10:40:40 uwe Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -73,6 +73,7 @@ CFATTACH_DECL(audiocs_ebus, sizeof(struct cs4231_ebus_softc),
cs4231_ebus_match, cs4231_ebus_attach, NULL, NULL);
/* audio_hw_if methods specific to ebus DMA */
static int cs4231_ebus_round_blocksize(void *, int);
static int cs4231_ebus_trigger_output(void *, void *, void *, int,
void (*)(void *), void *,
struct audio_params *);
@ -88,7 +89,7 @@ struct audio_hw_if audiocs_ebus_hw_if = {
NULL, /* drain */
ad1848_query_encoding,
ad1848_set_params,
cs4231_round_blocksize,
cs4231_ebus_round_blocksize,
ad1848_commit_settings,
NULL, /* init_output */
NULL, /* init_input */
@ -104,7 +105,7 @@ struct audio_hw_if audiocs_ebus_hw_if = {
cs4231_query_devinfo,
cs4231_malloc,
cs4231_free,
cs4231_round_buffersize,
NULL, /* round_buffersize */
NULL, /* mappage */
cs4231_get_props,
cs4231_ebus_trigger_output,
@ -212,6 +213,17 @@ cs4231_ebus_attach(parent, self, aux)
}
static int
cs4231_ebus_round_blocksize(addr, blk)
void *addr;
int blk;
{
/* we want to use DMA burst size of 16 words */
return (blk & -64);
}
#ifdef AUDIO_DEBUG
static void
cs4231_ebus_regdump(label, ebsc)
@ -276,7 +288,7 @@ cs4231_ebus_dma_advance(t, dt, dh)
/*
* Trigger transfer "t" using DMA controller "dmac".
* Trigger transfer "t" using DMA controller at "dt"/"dh".
* "iswrite" defines direction of the transfer.
*/
static int
@ -311,7 +323,8 @@ cs4231_ebus_trigger_transfer(sc, t, dt, dh, iswrite,
csr = bus_space_read_4(dt, dh, EBUS_DMAC_DCSR);
bus_space_write_4(dt, dh, EBUS_DMAC_DCSR,
csr | EBDMA_EN_NEXT | (iswrite ? EBDMA_WRITE : 0)
| EBDMA_EN_DMA | EBDMA_EN_CNT | EBDMA_INT_EN);
| EBDMA_EN_DMA | EBDMA_EN_CNT | EBDMA_INT_EN
| EBDMA_BURST_SIZE_16);
/* first load: propagated to DACR/DBCR */
bus_space_write_4(dt, dh, EBUS_DMAC_DNBR, (u_int32_t)dmasize);