Add support for the 1788 AudioDrive chip.

Some minor cleanup; refer to more registers by macros rather
than raw hex constants.
This commit is contained in:
nathanw 1999-03-02 20:36:50 +00:00
parent cfcb284c09
commit 64fffdfef9
3 changed files with 735 additions and 298 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
/* $NetBSD: essreg.h,v 1.7 1999/02/15 04:54:35 hubertf Exp $ */
/* $NetBSD: essreg.h,v 1.8 1999/03/02 20:36:51 nathanw Exp $ */
/*
* Copyright 1997
* Digital Equipment Corporation. All rights reserved.
@ -33,7 +33,7 @@
*/
/*
** @(#) $RCSfile: essreg.h,v $ $Revision: 1.7 $ (SHARK) $Date: 1999/02/15 04:54:35 $
** @(#) $RCSfile: essreg.h,v $ $Revision: 1.8 $ (SHARK) $Date: 1999/03/02 20:36:51 $
**
**++
**
@ -125,8 +125,12 @@
#define ESS_DRQ_CTRL_PU 0x10
#define ESS_DRQ_CTRL_EXT 0x40
#define ESS_XCMD_VOLIN_CTRL 0xB4 /* stereo input volume control */
#define ESS_1788_XCMD_AUDIO_CTRL0 0xB6
#define ESS_CTRL0_SIGNED 0x00
#define ESS_CTRL0_UNSIGNED 0x80
#define ESS_XCMD_AUDIO1_CTRL1 0xB7 /* */
#define ESS_AUDIO1_CTRL1_FIFO_CONNECT 0x80 /* 1=connected */
#define ESS_AUDIO1_CTRL1_FIFO_MONO 0x40 /* 0=stereo/1=mono */
#define ESS_AUDIO1_CTRL1_FIFO_SIGNED 0x20 /* 0=unsigned/1=signed */
#define ESS_AUDIO1_CTRL1_FIFO_STEREO 0x08 /* 0=mono/1=stereo */
#define ESS_AUDIO1_CTRL1_FIFO_SIZE 0x04 /* 0=8-bit/1=16-bit */
@ -225,12 +229,19 @@
#define ESS_DSP_READ 0x0A
#define ESS_DSP_WRITE 0x0C
#define ESS_DSP_RW_STATUS 0x0C
#define ESS_CLEAR_INTR 0x0E
#define ESS_DSP_READ_STATUS 0x0C
#define ESS_DSP_READ_MASK 0x40
#define ESS_DSP_READ_READY 0x40
#define ESS_DSP_READ_STATUS 0x0C
#define ESS_DSP_READ_READY 0x40
#define ESS_DSP_READ_FULL 0x20 /* FIFO full */
#define ESS_DSP_READ_EMPTY 0x10 /* FIFO empty */
#define ESS_DSP_READ_HALF 0x08 /* FIFO half-empty */
#define ESS_DSP_READ_IRQ 0x04 /* IRQ generated */
#define ESS_DSP_READ_HALF_IRQ 0x02 /* " from half-empty flag change */
#define ESS_DSP_READ_OFLOW 0x01 /* " from DMA counter overflow */
#define ESS_DSP_READ_ANYIRQ (ESS_DSP_READ_IRQ | \
ESS_DSP_READ_HALF_IRQ | \
ESS_DSP_READ_OFLOW)
#define ESS_DSP_WRITE_STATUS 0x0C
#define ESS_DSP_WRITE_MASK 0x80
@ -245,6 +256,23 @@
/*
* ESS Mixer registers
*/
#define ESS_MREG_VOLUME_VOICE 0x14
#define ESS_MREG_VOLUME_MIC 0x1A
#define ESS_MREG_ADC_SOURCE 0x1C
#define ESS_SOURCE_MIC 0x00
#define ESS_SOURCE_CD 0x02
#define ESS_SOURCE_LINE 0x06
#define ESS_SOURCE_MIXER 0x07
#define ESS_MREG_VOLUME_MASTER 0x32
#define ESS_MREG_VOLUME_SYNTH 0x36
#define ESS_MREG_VOLUME_CD 0x38
#define ESS_MREG_VOLUME_AUXB 0x3A
#define ESS_MREG_VOLUME_PCSPKR 0x3C
#define ESS_MREG_VOLUME_LINE 0x3E
#define ESS_MREG_VOLUME_LEFT 0x60
#define ESS_MREG_VOLUME_RIGHT 0x62
#define ESS_VOLUME_MUTE 0x40
#define ESS_MREG_VOLUME_CTRL 0x64
#define ESS_MREG_SAMPLE_RATE 0x70 /* sample rate for Audio2 channel */
#define ESS_MREG_FILTER_CLOCK 0x72 /* filter clock for Audio2 channel */
#define ESS_MREG_XFER_COUNTLO 0x74 /* low-byte of DMA transfer size */

View File

@ -1,4 +1,4 @@
/* $NetBSD: essvar.h,v 1.11 1999/02/19 16:15:06 mycroft Exp $ */
/* $NetBSD: essvar.h,v 1.12 1999/03/02 20:36:51 nathanw Exp $ */
/*
* Copyright 1997
* Digital Equipment Corporation. All rights reserved.
@ -33,7 +33,7 @@
*/
/*
** @(#) $RCSfile: essvar.h,v $ $Revision: 1.11 $ (SHARK) $Date: 1999/02/19 16:15:06 $
** @(#) $RCSfile: essvar.h,v $ $Revision: 1.12 $ (SHARK) $Date: 1999/03/02 20:36:51 $
**
**++
**
@ -74,21 +74,25 @@
#define ESS_PCSPEAKER_VOL 8
#define ESS_OUTPUT_CLASS 9
#define ESS_DAC_REC_VOL 10
#define ESS_MIC_REC_VOL 11
#define ESS_LINE_REC_VOL 12
#define ESS_SYNTH_REC_VOL 13
#define ESS_CD_REC_VOL 14
#define ESS_AUXB_REC_VOL 15
#define ESS_MIC_PREAMP 16
#define ESS_RECORD_VOL 17
#define ESS_RECORD_SOURCE 18
#define ESS_RECORD_CLASS 19
#define ESS_RECORD_MONITOR 10
#define ESS_MONITOR_CLASS 11
#define ESS_RECORD_MONITOR 20
#define ESS_MONITOR_CLASS 21
#define ESS_RECORD_VOL 12
#define ESS_RECORD_SOURCE 13
#define ESS_RECORD_CLASS 14
#define ESS_NDEVS 22
#define ESS_1788_NDEVS 15
#define ESS_DAC_REC_VOL 15
#define ESS_MIC_REC_VOL 16
#define ESS_LINE_REC_VOL 17
#define ESS_SYNTH_REC_VOL 18
#define ESS_CD_REC_VOL 19
#define ESS_AUXB_REC_VOL 20
#define ESS_MIC_PREAMP 21
#define ESS_1888_NDEVS 22
#define ESS_MAX_NDEVS 22
struct ess_audio_channel
{
@ -116,7 +120,8 @@ struct ess_softc
u_short sc_open; /* reference count of open calls */
u_char gain[ESS_NDEVS][2]; /* kept in input levels */
int ndevs;
u_char gain[ESS_MAX_NDEVS][2]; /* kept in input levels */
#define ESS_LEFT 0
#define ESS_RIGHT 1
@ -134,6 +139,7 @@ struct ess_softc
#define ESS_1888 1
#define ESS_1887 2
#define ESS_888 3
#define ESS_1788 4
u_int sc_version; /* Legacy ES688/ES1688 ID */
};