1*9484Sgarrett.damore@Sun.COM /* 2*9484Sgarrett.damore@Sun.COM * CDDL HEADER START 3*9484Sgarrett.damore@Sun.COM * 4*9484Sgarrett.damore@Sun.COM * The contents of this file are subject to the terms of the 5*9484Sgarrett.damore@Sun.COM * Common Development and Distribution License (the "License"). 6*9484Sgarrett.damore@Sun.COM * You may not use this file except in compliance with the License. 7*9484Sgarrett.damore@Sun.COM * 8*9484Sgarrett.damore@Sun.COM * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*9484Sgarrett.damore@Sun.COM * or http://www.opensolaris.org/os/licensing. 10*9484Sgarrett.damore@Sun.COM * See the License for the specific language governing permissions 11*9484Sgarrett.damore@Sun.COM * and limitations under the License. 12*9484Sgarrett.damore@Sun.COM * 13*9484Sgarrett.damore@Sun.COM * When distributing Covered Code, include this CDDL HEADER in each 14*9484Sgarrett.damore@Sun.COM * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*9484Sgarrett.damore@Sun.COM * If applicable, add the following below this CDDL HEADER, with the 16*9484Sgarrett.damore@Sun.COM * fields enclosed by brackets "[]" replaced with your own identifying 17*9484Sgarrett.damore@Sun.COM * information: Portions Copyright [yyyy] [name of copyright owner] 18*9484Sgarrett.damore@Sun.COM * 19*9484Sgarrett.damore@Sun.COM * CDDL HEADER END 20*9484Sgarrett.damore@Sun.COM */ 21*9484Sgarrett.damore@Sun.COM /* 22*9484Sgarrett.damore@Sun.COM * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 23*9484Sgarrett.damore@Sun.COM * Use is subject to license terms. 24*9484Sgarrett.damore@Sun.COM */ 25*9484Sgarrett.damore@Sun.COM /* 26*9484Sgarrett.damore@Sun.COM * Purpose: Definitions for the Creative/Ensoniq AudioPCI97 driver. 27*9484Sgarrett.damore@Sun.COM */ 28*9484Sgarrett.damore@Sun.COM /* 29*9484Sgarrett.damore@Sun.COM * This file is part of Open Sound System 30*9484Sgarrett.damore@Sun.COM * 31*9484Sgarrett.damore@Sun.COM * Copyright (C) 4Front Technologies 1996-2008. 32*9484Sgarrett.damore@Sun.COM * 33*9484Sgarrett.damore@Sun.COM * This software is released under CDDL 1.0 source license. 34*9484Sgarrett.damore@Sun.COM * See the COPYING file included in the main directory of this source 35*9484Sgarrett.damore@Sun.COM * distribution for the license terms and conditions. 36*9484Sgarrett.damore@Sun.COM */ 37*9484Sgarrett.damore@Sun.COM 38*9484Sgarrett.damore@Sun.COM #ifndef _AUDIOPCI_H 39*9484Sgarrett.damore@Sun.COM #define _AUDIOPCI_H 40*9484Sgarrett.damore@Sun.COM 41*9484Sgarrett.damore@Sun.COM /* CONCERT PCI-SIG defines */ 42*9484Sgarrett.damore@Sun.COM #define CONC_PCI_VENDID 0x1274U 43*9484Sgarrett.damore@Sun.COM #define CONC_PCI_DEVID 0x5000U 44*9484Sgarrett.damore@Sun.COM 45*9484Sgarrett.damore@Sun.COM /* used for the development board only!! */ 46*9484Sgarrett.damore@Sun.COM #define CONC_DEV_PCI_VENDID 0x1274U 47*9484Sgarrett.damore@Sun.COM #define CONC_DEV_PCI_DEVID 0x5000U 48*9484Sgarrett.damore@Sun.COM 49*9484Sgarrett.damore@Sun.COM 50*9484Sgarrett.damore@Sun.COM /* 51*9484Sgarrett.damore@Sun.COM * CONCERT Registers 52*9484Sgarrett.damore@Sun.COM */ 53*9484Sgarrett.damore@Sun.COM 54*9484Sgarrett.damore@Sun.COM #define DAC_CLOCK_DIVIDE 22579200UL /* DAC2 (CODEC) clock divide */ 55*9484Sgarrett.damore@Sun.COM 56*9484Sgarrett.damore@Sun.COM /* Concert direct register offset defines */ 57*9484Sgarrett.damore@Sun.COM 58*9484Sgarrett.damore@Sun.COM #define CONC_bDEVCTL_OFF 0x00 /* Device control/enable */ 59*9484Sgarrett.damore@Sun.COM #define CONC_bMISCCTL_OFF 0x01 /* Miscellaneous control */ 60*9484Sgarrett.damore@Sun.COM #define CONC_wDACRATE_OFF 0x02 /* CODEC clock divider for PLL */ 61*9484Sgarrett.damore@Sun.COM #define CONC_dSTATUS_OFF 0x04 /* long status register */ 62*9484Sgarrett.damore@Sun.COM #define CONC_bCODECSTAT_OFF 0x05 /* CODEC interface status */ 63*9484Sgarrett.damore@Sun.COM #define CONC_bUARTDATA_OFF 0x08 /* UART data R/W - read clears RX int */ 64*9484Sgarrett.damore@Sun.COM #define CONC_bUARTCSTAT_OFF 0x09 /* UART control and status */ 65*9484Sgarrett.damore@Sun.COM #define CONC_bMEMPAGE_OFF 0x0c /* Memory page select */ 66*9484Sgarrett.damore@Sun.COM #define CONC_wCODECCTL_OFF 0x10 /* CODEC control - word-write-only */ 67*9484Sgarrett.damore@Sun.COM #define CONC_wNMISTAT_OFF 0x18 /* Legacy NMI status */ 68*9484Sgarrett.damore@Sun.COM #define CONC_bNMIENA_OFF 0x1a /* Legacy NMI enable */ 69*9484Sgarrett.damore@Sun.COM #define CONC_bNMICTL_OFF 0x1b /* Legacy control */ 70*9484Sgarrett.damore@Sun.COM #define CONC_bSERFMT_OFF 0x20 /* Serial device control */ 71*9484Sgarrett.damore@Sun.COM #define CONC_bSERCTL_OFF 0x21 /* Serial device format */ 72*9484Sgarrett.damore@Sun.COM #define CONC_bSKIPC_OFF 0x22 /* Skip counts for DAC (wave) */ 73*9484Sgarrett.damore@Sun.COM #define CONC_wSYNIC_OFF 0x24 /* Synth int count in sample frames */ 74*9484Sgarrett.damore@Sun.COM #define CONC_wSYNCIC_OFF 0x26 /* Synth current int count */ 75*9484Sgarrett.damore@Sun.COM #define CONC_wDACIC_OFF 0x28 /* DAC int count in sample frames */ 76*9484Sgarrett.damore@Sun.COM #define CONC_wDACCIC_OFF 0x2a /* DAC current int count */ 77*9484Sgarrett.damore@Sun.COM #define CONC_wADCIC_OFF 0x2c /* ADC int count in sample frames */ 78*9484Sgarrett.damore@Sun.COM #define CONC_wADCCIC_OFF 0x2e /* ADC current int count */ 79*9484Sgarrett.damore@Sun.COM #define CONC_MEMBASE_OFF 0x30 /* Memory window base - 16 bytes */ 80*9484Sgarrett.damore@Sun.COM 81*9484Sgarrett.damore@Sun.COM /* Device Control defines */ 82*9484Sgarrett.damore@Sun.COM #define CONC_DEVCTL_SERR_DIS 0x01 /* internal PCI serr bus enable */ 83*9484Sgarrett.damore@Sun.COM #define CONC_DEVCTL_CODEC_EN 0x02 /* CoDec Enable */ 84*9484Sgarrett.damore@Sun.COM #define CONC_DEVCTL_JSTICK_EN 0x04 /* Joystick Enable */ 85*9484Sgarrett.damore@Sun.COM #define CONC_DEVCTL_UART_EN 0x08 /* UART Enable */ 86*9484Sgarrett.damore@Sun.COM #define CONC_DEVCTL_ADC_EN 0x10 /* ADC Enable (record) */ 87*9484Sgarrett.damore@Sun.COM #define CONC_DEVCTL_DAC_EN 0x20 /* DAC Enable (playback) */ 88*9484Sgarrett.damore@Sun.COM #define CONC_DEVCTL_SYN_EN 0x40 /* Synth Enable */ 89*9484Sgarrett.damore@Sun.COM #define CONC_DEVCTL_MICBIAS 0x4000L /* mic bias switch */ 90*9484Sgarrett.damore@Sun.COM 91*9484Sgarrett.damore@Sun.COM /* Misc Control defines */ 92*9484Sgarrett.damore@Sun.COM #define CONC_MISCCTL_MUTE 0x01 /* XTL0 wired to mute */ 93*9484Sgarrett.damore@Sun.COM #define CONC_MISCCTL_CCB_INTRM 0x04 /* CCB interrupt mask */ 94*9484Sgarrett.damore@Sun.COM #define CONC_MISCCTL_SYN_5KHZ 0x00 /* synth: 5512 Hz */ 95*9484Sgarrett.damore@Sun.COM #define CONC_MISCCTL_SYN_11KHZ 0x10 /* synth: 11025 Hz */ 96*9484Sgarrett.damore@Sun.COM #define CONC_MISCCTL_SYN_22KHZ 0x20 /* synth: 22050 Hz */ 97*9484Sgarrett.damore@Sun.COM #define CONC_MISCCTL_SYN_44KHZ 0x30 /* synth: 44100 Hz */ 98*9484Sgarrett.damore@Sun.COM 99*9484Sgarrett.damore@Sun.COM /* Interrupt Status defines */ 100*9484Sgarrett.damore@Sun.COM #define CONC_INTSTAT_ADCINT 0x01 /* A/D interrupt pending bit */ 101*9484Sgarrett.damore@Sun.COM #define CONC_INTSTAT_DACINT 0x02 /* DAC interrupt pending bit */ 102*9484Sgarrett.damore@Sun.COM #define CONC_INTSTAT_SYNINT 0x04 /* synth interrupt pending bit */ 103*9484Sgarrett.damore@Sun.COM #define CONC_INTSTAT_UARTINT 0x08 /* UART interrupt pending bit */ 104*9484Sgarrett.damore@Sun.COM #define CONC_INTSTAT_PENDING 0x80000000 105*9484Sgarrett.damore@Sun.COM /* this bit set high while'st we have an interrupt */ 106*9484Sgarrett.damore@Sun.COM 107*9484Sgarrett.damore@Sun.COM /* Codec Status defines */ 108*9484Sgarrett.damore@Sun.COM #define CONC_CSTAT_CSTAT 0x4 109*9484Sgarrett.damore@Sun.COM #define CONC_CSTAT_CBUSY 0x2 110*9484Sgarrett.damore@Sun.COM #define CONC_CSTAT_CWRIP 0x1 111*9484Sgarrett.damore@Sun.COM 112*9484Sgarrett.damore@Sun.COM /* SERFMT PCM format defines */ 113*9484Sgarrett.damore@Sun.COM #define CONC_PCM_SYN_STEREO 0x01 114*9484Sgarrett.damore@Sun.COM #define CONC_PCM_SYN_16BIT 0x02 115*9484Sgarrett.damore@Sun.COM #define CONC_PCM_DAC_STEREO 0x04 116*9484Sgarrett.damore@Sun.COM #define CONC_PCM_DAC_16BIT 0x08 117*9484Sgarrett.damore@Sun.COM #define CONC_PCM_ADC_STEREO 0x10 118*9484Sgarrett.damore@Sun.COM #define CONC_PCM_ADC_16BIT 0x20 119*9484Sgarrett.damore@Sun.COM 120*9484Sgarrett.damore@Sun.COM /* Serial Control defines */ 121*9484Sgarrett.damore@Sun.COM #define CONC_SERCTL_SYNIE 0x01 /* synth int enable */ 122*9484Sgarrett.damore@Sun.COM #define CONC_SERCTL_DACIE 0x02 /* playback interrupt enable */ 123*9484Sgarrett.damore@Sun.COM #define CONC_SERCTL_ADCIE 0x04 /* record interrupt enable */ 124*9484Sgarrett.damore@Sun.COM #define CONC_SERCTL_SYNPAUSE 0x10 /* playback pause */ 125*9484Sgarrett.damore@Sun.COM 126*9484Sgarrett.damore@Sun.COM /* Concert memory page-banked register offset defines */ 127*9484Sgarrett.damore@Sun.COM #define CONC_dSYNPADDR_OFF 0x30 /* Synth host frame PCI phys addr */ 128*9484Sgarrett.damore@Sun.COM #define CONC_wSYNFC_OFF 0x34 /* Synth host frame count in DWORDS */ 129*9484Sgarrett.damore@Sun.COM #define CONC_wSYNCFC_OFF 0x36 /* Synth host current frame count */ 130*9484Sgarrett.damore@Sun.COM #define CONC_dDACPADDR_OFF 0x38 /* DAC host frame PCI phys addr */ 131*9484Sgarrett.damore@Sun.COM #define CONC_wDACFC_OFF 0x3c /* DAC host frame count in DWORDS */ 132*9484Sgarrett.damore@Sun.COM #define CONC_wDACCFC_OFF 0x3e /* DAC host current frame count */ 133*9484Sgarrett.damore@Sun.COM #define CONC_dADCPADDR_OFF 0x30 /* ADC host frame PCI phys addr */ 134*9484Sgarrett.damore@Sun.COM #define CONC_wADCFC_OFF 0x34 /* ADC host frame count in DWORDS */ 135*9484Sgarrett.damore@Sun.COM #define CONC_wADCCFC_OFF 0x36 /* ADC host current frame count */ 136*9484Sgarrett.damore@Sun.COM 137*9484Sgarrett.damore@Sun.COM /* Concert memory page number defines */ 138*9484Sgarrett.damore@Sun.COM #define CONC_SYNRAM_PAGE 0x00 /* Synth host/serial I/F RAM */ 139*9484Sgarrett.damore@Sun.COM #define CONC_DACRAM_PAGE 0x04 /* DAC host/serial I/F RAM */ 140*9484Sgarrett.damore@Sun.COM #define CONC_ADCRAM_PAGE 0x08 /* ADC host/serial I/F RAM */ 141*9484Sgarrett.damore@Sun.COM #define CONC_SYNCTL_PAGE 0x0c /* Page bank for synth host control */ 142*9484Sgarrett.damore@Sun.COM #define CONC_DACCTL_PAGE 0x0c /* Page bank for DAC host control */ 143*9484Sgarrett.damore@Sun.COM #define CONC_ADCCTL_PAGE 0x0d /* Page bank for ADC host control */ 144*9484Sgarrett.damore@Sun.COM #define CONC_FIFO0_PAGE 0x0e /* page 0 of UART "FIFO" (rx stash) */ 145*9484Sgarrett.damore@Sun.COM #define CONC_FIFO1_PAGE 0x0f /* page 1 of UART "FIFO" (rx stash) */ 146*9484Sgarrett.damore@Sun.COM 147*9484Sgarrett.damore@Sun.COM /* UARTCSTAT register masks */ 148*9484Sgarrett.damore@Sun.COM #define CONC_UART_RXRDY 0x01 149*9484Sgarrett.damore@Sun.COM #define CONC_UART_TXRDY 0x02 150*9484Sgarrett.damore@Sun.COM #define CONC_UART_TXINT 0x04 151*9484Sgarrett.damore@Sun.COM #define CONC_UART_RXINT 0x80 152*9484Sgarrett.damore@Sun.COM 153*9484Sgarrett.damore@Sun.COM #define CONC_UART_CTL 0x03 154*9484Sgarrett.damore@Sun.COM #define CONC_UART_TXINTEN 0x20 155*9484Sgarrett.damore@Sun.COM #define CONC_UART_RXINTEN 0x80 156*9484Sgarrett.damore@Sun.COM 157*9484Sgarrett.damore@Sun.COM /* 158*9484Sgarrett.damore@Sun.COM * CODEC register map 159*9484Sgarrett.damore@Sun.COM */ 160*9484Sgarrett.damore@Sun.COM #define NUMREGS 32 /* total number of registers */ 161*9484Sgarrett.damore@Sun.COM #define NUMVOLS 16 /* number of vol regs */ 162*9484Sgarrett.damore@Sun.COM 163*9484Sgarrett.damore@Sun.COM /* Source and output volume control defines */ 164*9484Sgarrett.damore@Sun.COM #define CODEC_VOL_MASTER_L 0x00U /* Master out, left */ 165*9484Sgarrett.damore@Sun.COM #define CODEC_VOL_MASTER_R 0x01U /* Master out, right */ 166*9484Sgarrett.damore@Sun.COM #define CODEC_VOL_WAVE_L 0x02U /* Wave DAC, left */ 167*9484Sgarrett.damore@Sun.COM #define CODEC_VOL_WAVE_R 0x03U /* Wave DAC, right */ 168*9484Sgarrett.damore@Sun.COM #define CODEC_VOL_SYNTH_L 0x04U /* Synth DAC, left */ 169*9484Sgarrett.damore@Sun.COM #define CODEC_VOL_SYNTH_R 0x05U /* Synth DAC, right */ 170*9484Sgarrett.damore@Sun.COM #define CODEC_VOL_CD_L 0x06U /* CD audio, left */ 171*9484Sgarrett.damore@Sun.COM #define CODEC_VOL_CD_R 0x07U /* CD audio, right */ 172*9484Sgarrett.damore@Sun.COM #define CODEC_VOL_AUX_L 0x08U /* Aux line source, left */ 173*9484Sgarrett.damore@Sun.COM #define CODEC_VOL_AUX_R 0x09U /* Aux line source, right */ 174*9484Sgarrett.damore@Sun.COM #define CODEC_VOL_TV_L 0x0aU /* TV Tuner, left */ 175*9484Sgarrett.damore@Sun.COM #define CODEC_VOL_TV_R 0x0bU /* TV Tuner, right */ 176*9484Sgarrett.damore@Sun.COM #define CODEC_VOL_TAD 0x0cU /* TAD monitor, mono */ 177*9484Sgarrett.damore@Sun.COM #define CODEC_VOL_MONO2 0x0dU /* Unused MONO2 */ 178*9484Sgarrett.damore@Sun.COM #define CODEC_VOL_MIC 0x0eU /* Mic, mono */ 179*9484Sgarrett.damore@Sun.COM #define CODEC_VOL_MONO 0x0fU /* Mono out volume */ 180*9484Sgarrett.damore@Sun.COM 181*9484Sgarrett.damore@Sun.COM /* Input bus enable defines -SW1 */ 182*9484Sgarrett.damore@Sun.COM #define CODEC_IN_ENABLE_MIC 0x01U /* Mic enable, mono */ 183*9484Sgarrett.damore@Sun.COM #define CODEC_IN_ENABLE_CD_R 0x02U /* CD audio enable, right */ 184*9484Sgarrett.damore@Sun.COM #define CODEC_IN_ENABLE_CD_L 0x04U /* CD audio enable, left */ 185*9484Sgarrett.damore@Sun.COM #define CODEC_IN_ENABLE_AUX_R 0x08U /* Aux line source enable, right */ 186*9484Sgarrett.damore@Sun.COM #define CODEC_IN_ENABLE_AUX_L 0x10U /* Aux line source enable, left */ 187*9484Sgarrett.damore@Sun.COM #define CODEC_IN_ENABLE_SYNTH_R 0x20U /* Synth DAC enable, right */ 188*9484Sgarrett.damore@Sun.COM #define CODEC_IN_ENABLE_SYNTH_L 0x40U /* Synth DAC enable, left */ 189*9484Sgarrett.damore@Sun.COM 190*9484Sgarrett.damore@Sun.COM /* Input bus enable defines - SW2 */ 191*9484Sgarrett.damore@Sun.COM #define CODEC_IN_ENABLE_TAD 0x01U /* TAD monitor enable, mono */ 192*9484Sgarrett.damore@Sun.COM #define CODEC_IN_ENABLE_MONO2 0x02U /* Unused MONO2 enable, mono */ 193*9484Sgarrett.damore@Sun.COM #define CODEC_IN_ENABLE_WAVE 0x04U /* Wave DAC enable */ 194*9484Sgarrett.damore@Sun.COM #define CODEC_IN_ENABLE_TV_R 0x08U /* TV Tuner enable, right */ 195*9484Sgarrett.damore@Sun.COM #define CODEC_IN_ENABLE_TV_L 0x10U /* TV Tuner enable, left */ 196*9484Sgarrett.damore@Sun.COM #define CODEC_IN_ENABLE_TMONO2 0x20U /* unboosted MONO2 */ 197*9484Sgarrett.damore@Sun.COM #define CODEC_IN_ENABLE_TMONO1 0x40U /* unboosted MONO1 */ 198*9484Sgarrett.damore@Sun.COM #define CODEC_IN_ENABLE_TMIC 0x80U /* unboosted MONO3 (mic) */ 199*9484Sgarrett.damore@Sun.COM 200*9484Sgarrett.damore@Sun.COM /* Output bus enable defines - SW1 */ 201*9484Sgarrett.damore@Sun.COM #define CODEC_OUT_ENABLE_MIC 0x01U /* Mic enable, mono */ 202*9484Sgarrett.damore@Sun.COM #define CODEC_OUT_ENABLE_CD 0x06U /* CD audio enable, stereo */ 203*9484Sgarrett.damore@Sun.COM #define CODEC_OUT_ENABLE_AUX 0x18U /* Aux line source enable, stereo */ 204*9484Sgarrett.damore@Sun.COM #define CODEC_OUT_ENABLE_SYNTH 0x60U /* Synth DAC enable, stereo */ 205*9484Sgarrett.damore@Sun.COM 206*9484Sgarrett.damore@Sun.COM /* Output bus enable defines - SW2 */ 207*9484Sgarrett.damore@Sun.COM #define CODEC_OUT_ENABLE_TAD 0x01U /* TAD monitor enable, mono */ 208*9484Sgarrett.damore@Sun.COM #define CODEC_OUT_ENABLE_MONO2 0x02U /* Unused MONO2 enable, mono */ 209*9484Sgarrett.damore@Sun.COM #define CODEC_OUT_ENABLE_WAVE 0x0cU /* Wave DAC enable, stereo */ 210*9484Sgarrett.damore@Sun.COM #define CODEC_OUT_ENABLE_TV 0x30U /* TV Tuner enable, stereo */ 211*9484Sgarrett.damore@Sun.COM 212*9484Sgarrett.damore@Sun.COM /* Volume setting constants */ 213*9484Sgarrett.damore@Sun.COM #define CODEC_ATT_MUTE 0x80U 214*9484Sgarrett.damore@Sun.COM #define CODEC_ATT_MAX 0x1fU 215*9484Sgarrett.damore@Sun.COM #define CODEC_ATT_MONO 0x07U 216*9484Sgarrett.damore@Sun.COM 217*9484Sgarrett.damore@Sun.COM /* Control function defines */ 218*9484Sgarrett.damore@Sun.COM #define CODEC_CTL_4SPKR 0x00U /* 4-spkr output mode enable */ 219*9484Sgarrett.damore@Sun.COM #define CODEC_CTL_MICBOOST 0x01U /* Mic boost (+30 dB) enable */ 220*9484Sgarrett.damore@Sun.COM 221*9484Sgarrett.damore@Sun.COM /* Miscellaneous CODEC defines for internal use */ 222*9484Sgarrett.damore@Sun.COM #define CODEC_OUT_SW1 0x10U 223*9484Sgarrett.damore@Sun.COM #define CODEC_OUT_SW2 0x11U 224*9484Sgarrett.damore@Sun.COM #define CODEC_LIN_SW1 0x12U 225*9484Sgarrett.damore@Sun.COM #define CODEC_RIN_SW1 0x13U 226*9484Sgarrett.damore@Sun.COM #define CODEC_LIN_SW2 0x14U 227*9484Sgarrett.damore@Sun.COM #define CODEC_RIN_SW2 0x15U 228*9484Sgarrett.damore@Sun.COM #define CODEC_RESET_PWRD 0x16U 229*9484Sgarrett.damore@Sun.COM #define CODEC_CLKSELECT 0x17U 230*9484Sgarrett.damore@Sun.COM #define CODEC_ADSELECT 0x18U 231*9484Sgarrett.damore@Sun.COM #define CODEC_MICBOOST 0x19U 232*9484Sgarrett.damore@Sun.COM 233*9484Sgarrett.damore@Sun.COM #endif /* _AUDIOPCI_H */ 234