1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-23 07:31:31 +00:00

DMA automode patch, fix SB16 clicks

Submitted by: tim@cs.city.ac.uk
This commit is contained in:
Andrey A. Chernov 1994-11-01 17:26:50 +00:00
parent f34550da35
commit 0c9159ecd7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=4051
6 changed files with 45 additions and 10 deletions

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa.c 7.2 (Berkeley) 5/13/91
* $Id: isa.c,v 1.33 1994/10/25 23:06:15 se Exp $
* $Id: isa.c,v 1.34 1994/10/26 00:16:20 phk Exp $
*/
/*
@ -691,6 +691,15 @@ void isa_dmastart(int flags, caddr_t addr, unsigned nbytes, unsigned chan)
* byte mode channels.
*/
/* set dma channel mode, and reset address ff */
/* If B_RAW flag is set, then use autoinitialise mode */
if (flags & B_RAW) {
if (flags & B_READ)
outb(DMA1_MODE, DMA37MD_AUTO|DMA37MD_WRITE|chan);
else
outb(DMA1_MODE, DMA37MD_AUTO|DMA37MD_READ|chan);
}
else
if (flags & B_READ)
outb(DMA1_MODE, DMA37MD_SINGLE|DMA37MD_WRITE|chan);
else
@ -715,6 +724,15 @@ void isa_dmastart(int flags, caddr_t addr, unsigned nbytes, unsigned chan)
* word mode channels.
*/
/* set dma channel mode, and reset address ff */
/* If B_RAW flag is set, then use autoinitialise mode */
if (flags & B_RAW) {
if (flags & B_READ)
outb(DMA2_MODE, DMA37MD_AUTO|DMA37MD_WRITE|(chan&3));
else
outb(DMA2_MODE, DMA37MD_AUTO|DMA37MD_READ|(chan&3));
}
else
if (flags & B_READ)
outb(DMA2_MODE, DMA37MD_SINGLE|DMA37MD_WRITE|(chan&3));
else

View File

@ -1,11 +1,12 @@
/*
* Intel 8237 DMA Controller
*
* $Id$
* $Id: i8237.h,v 1.2 1993/10/16 13:48:48 rgrimes Exp $
*/
#define DMA37MD_SINGLE 0x40 /* single pass mode */
#define DMA37MD_CASCADE 0xc0 /* cascade mode */
#define DMA37MD_AUTO 0x50 /* autoinitialise single pass mode */
#define DMA37MD_WRITE 0x04 /* read the device, write memory operation */
#define DMA37MD_READ 0x08 /* write the device, read memory operation */

View File

@ -1,11 +1,12 @@
/*
* Intel 8237 DMA Controller
*
* $Id$
* $Id: i8237.h,v 1.2 1993/10/16 13:48:48 rgrimes Exp $
*/
#define DMA37MD_SINGLE 0x40 /* single pass mode */
#define DMA37MD_CASCADE 0xc0 /* cascade mode */
#define DMA37MD_AUTO 0x50 /* autoinitialise single pass mode */
#define DMA37MD_WRITE 0x04 /* read the device, write memory operation */
#define DMA37MD_READ 0x08 /* write the device, read memory operation */

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa.c 7.2 (Berkeley) 5/13/91
* $Id: isa.c,v 1.33 1994/10/25 23:06:15 se Exp $
* $Id: isa.c,v 1.34 1994/10/26 00:16:20 phk Exp $
*/
/*
@ -691,6 +691,15 @@ void isa_dmastart(int flags, caddr_t addr, unsigned nbytes, unsigned chan)
* byte mode channels.
*/
/* set dma channel mode, and reset address ff */
/* If B_RAW flag is set, then use autoinitialise mode */
if (flags & B_RAW) {
if (flags & B_READ)
outb(DMA1_MODE, DMA37MD_AUTO|DMA37MD_WRITE|chan);
else
outb(DMA1_MODE, DMA37MD_AUTO|DMA37MD_READ|chan);
}
else
if (flags & B_READ)
outb(DMA1_MODE, DMA37MD_SINGLE|DMA37MD_WRITE|chan);
else
@ -715,6 +724,15 @@ void isa_dmastart(int flags, caddr_t addr, unsigned nbytes, unsigned chan)
* word mode channels.
*/
/* set dma channel mode, and reset address ff */
/* If B_RAW flag is set, then use autoinitialise mode */
if (flags & B_RAW) {
if (flags & B_READ)
outb(DMA2_MODE, DMA37MD_AUTO|DMA37MD_WRITE|(chan&3));
else
outb(DMA2_MODE, DMA37MD_AUTO|DMA37MD_READ|(chan&3));
}
else
if (flags & B_READ)
outb(DMA2_MODE, DMA37MD_SINGLE|DMA37MD_WRITE|(chan&3));
else

View File

@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: dmabuf.c,v 1.8 1994/08/02 07:39:49 davidg Exp $
* $Id: dmabuf.c,v 1.9 1994/10/01 02:16:35 swallace Exp $
*/
#include "sound_config.h"
@ -659,9 +659,7 @@ DMAbuf_start_dma (int dev, unsigned long physaddr, int count, int dma_mode)
RESTORE_INTR (flags);
#else /* linux */
#ifdef __FreeBSD__
printk ("sound: Invalid DMA mode for device %d\n", dev);
isa_dmastart ((dma_mode == DMA_MODE_READ) ? B_READ : B_WRITE,
isa_dmastart (B_RAW + ((dma_mode == DMA_MODE_READ) ? B_READ : B_WRITE),
(caddr_t)dmap->raw_buf_phys[0],
dmap->bytes_in_use,
chan);

View File

@ -1,6 +1,6 @@
/* for FreeBSD */
/*
* $Id: local.h,v 1.9 1994/09/27 17:58:19 davidg Exp $
* $Id: local.h,v 1.10 1994/10/01 02:16:44 swallace Exp $
*/
#include "snd.h"
@ -21,7 +21,6 @@
#endif
#define DSP_BUFFSIZE 65536
#define NO_AUTODMA /* still */
#define SELECTED_SOUND_OPTIONS 0xffffffff
#define SOUND_VERSION_STRING "2.90-2"
#define SOUND_CONFIG_DATE "Thu Sep 29 15:33:39 PDT 1994"