xref: /onnv-gate/usr/src/uts/common/sys/audio/ac97.h (revision 12407:99038848ee7d)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
51549Sfl147353  * Common Development and Distribution License (the "License").
61549Sfl147353  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
211549Sfl147353 
220Sstevel@tonic-gate /*
23*12407Sgdamore@opensolaris.org  * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
241549Sfl147353  */
251549Sfl147353 
260Sstevel@tonic-gate #ifndef	_SYS_AC97_H
270Sstevel@tonic-gate #define	_SYS_AC97_H
280Sstevel@tonic-gate 
299484Sgarrett.damore@Sun.COM #include <sys/types.h>
309484Sgarrett.damore@Sun.COM #include <sys/audio/audio_common.h>
310Sstevel@tonic-gate 
320Sstevel@tonic-gate #ifdef	__cplusplus
330Sstevel@tonic-gate extern "C" {
340Sstevel@tonic-gate #endif
350Sstevel@tonic-gate 
360Sstevel@tonic-gate #ifdef _KERNEL
370Sstevel@tonic-gate 
380Sstevel@tonic-gate /*
399484Sgarrett.damore@Sun.COM  * This header file describes the AC-97 Codec register set. See the
400Sstevel@tonic-gate  * spec for a detailed description of each register.
410Sstevel@tonic-gate  */
420Sstevel@tonic-gate 
430Sstevel@tonic-gate /*
449484Sgarrett.damore@Sun.COM  * Defines for the registers.
450Sstevel@tonic-gate  */
460Sstevel@tonic-gate 
470Sstevel@tonic-gate /* Reset Register					Index 00h */
480Sstevel@tonic-gate #define	AC97_RESET_REGISTER				0x00
490Sstevel@tonic-gate #define	RR_DEDICATED_MIC				0x0001
500Sstevel@tonic-gate #define	RR_RESERVED					0x0002
510Sstevel@tonic-gate #define	RR_BASS_TREBLE					0x0004
520Sstevel@tonic-gate #define	RR_PSEUDO_STEREO				0x0008
530Sstevel@tonic-gate #define	RR_HEADPHONE_SUPPORT				0x0010
540Sstevel@tonic-gate #define	RR_LOUDNESS_SUPPORT				0x0020
550Sstevel@tonic-gate #define	RR_18_BIT_DAC					0x0040
560Sstevel@tonic-gate #define	RR_20_BIT_DAC					0x0080
570Sstevel@tonic-gate #define	RR_18_BIT_ADC					0x0100
580Sstevel@tonic-gate #define	RR_20_BIT_ADC					0x0200
590Sstevel@tonic-gate #define	RR_3D_STEREO_ENHANCE_MASK			0x7c00
600Sstevel@tonic-gate 
610Sstevel@tonic-gate /* Master Volume Register				Index 02h */
620Sstevel@tonic-gate #define	AC97_MASTER_VOLUME_REGISTER			0x02
630Sstevel@tonic-gate #define	MVR_RIGHT_MASK					0x001f
640Sstevel@tonic-gate #define	MVR_RIGHT_0dB_ATTEN				0x0000
650Sstevel@tonic-gate #define	MVR_RIGHT_OPTIONAL_MASK				0x003f
660Sstevel@tonic-gate #define	MVR_LEFT_MASK					0x1f00
670Sstevel@tonic-gate #define	MVR_LEFT_0dB_ATTEN				0x0000
680Sstevel@tonic-gate #define	MVR_LEFT_OPTIONAL_MASK				0x3f00
690Sstevel@tonic-gate #define	MVR_MUTE					0x8000
700Sstevel@tonic-gate 
710Sstevel@tonic-gate /* Headphone Volume Register				Index 04h - Optional */
720Sstevel@tonic-gate #define	AC97_HEADPHONE_VOLUME_REGISTER			0x04
730Sstevel@tonic-gate #define	HPVR_RIGHT_MASK					0x001f
740Sstevel@tonic-gate #define	HPVR_RIGHT_0dB_ATTEN				0x0000
750Sstevel@tonic-gate #define	HPVR_RIGHT_OPTIONAL_MASK			0x003f
760Sstevel@tonic-gate #define	HPVR_LEFT_MASK					0x1f00
770Sstevel@tonic-gate #define	HPVR_LEFT_0dB_ATTEN				0x0000
780Sstevel@tonic-gate #define	HPVR_LEFT_OPTIONAL_MASK				0x3f00
790Sstevel@tonic-gate #define	HPVR_MUTE					0x8000
800Sstevel@tonic-gate 
810Sstevel@tonic-gate /* Mono Master Volume Register				Index 06h - Optional */
829484Sgarrett.damore@Sun.COM #define	AC97_MONO_MASTER_VOLUME_REGISTER		0x06
830Sstevel@tonic-gate #define	MMVR_MASK					0x001f
840Sstevel@tonic-gate #define	MMVR_0dB_ATTEN					0x0000
850Sstevel@tonic-gate #define	MMVR_OPTIONAL_MASK				0x003f
860Sstevel@tonic-gate #define	MMVR_MUTE					0x8000
870Sstevel@tonic-gate 
880Sstevel@tonic-gate /* Master Tone Control Register				Index 08h - Optional */
890Sstevel@tonic-gate #define	AC97_MASTER_TONE_CONTROL_REGISTER		0x08
900Sstevel@tonic-gate #define	MTCR_TREBLE_MASK				0x000e
910Sstevel@tonic-gate #define	MTCR_TREBLE_OPTIONAL_MASK			0x000f
920Sstevel@tonic-gate #define	MTCR_TREBLE_BYPASS				0x000f
930Sstevel@tonic-gate #define	MTCR_BASS_MASK					0x0e00
940Sstevel@tonic-gate #define	MTCR_BASS_OPTIONAL_MASK				0x0f00
950Sstevel@tonic-gate #define	MTCR_BASS_BYPASS				0x0f00
960Sstevel@tonic-gate 
970Sstevel@tonic-gate /* PC Beep Register					Index 0ah - Optional */
980Sstevel@tonic-gate #define	AC97_PC_BEEP_REGISTER				0x0a
990Sstevel@tonic-gate #define	PCBR_VOLUME_MASK				0x001e
1000Sstevel@tonic-gate #define	PCBR_0dB_ATTEN					0x0000
1010Sstevel@tonic-gate #define	PCBR_MUTE					0x8000
1020Sstevel@tonic-gate 
1030Sstevel@tonic-gate /* Phone Volume	Register				Index 0ch - Optional */
1040Sstevel@tonic-gate #define	AC97_PHONE_VOLUME_REGISTER			0x0c
1050Sstevel@tonic-gate #define	PVR_GAIN_MASK					0x001f
1060Sstevel@tonic-gate #define	PVR_0dB_GAIN					0x0010
1070Sstevel@tonic-gate #define	PVR_MAX_ATTEN					0x001f
1080Sstevel@tonic-gate #define	PVR_MUTE					0x8000
1090Sstevel@tonic-gate 
1100Sstevel@tonic-gate /* Mic Volume Register					Index 0eh */
1110Sstevel@tonic-gate #define	AC97_MIC_VOLUME_REGISTER			0x0e
1120Sstevel@tonic-gate #define	MICVR_GAIN_MASK					0x001f
1130Sstevel@tonic-gate #define	MICVR_0dB_GAIN					0x0008
1140Sstevel@tonic-gate #define	MICVR_MAX_ATTEN					0x001f
1150Sstevel@tonic-gate #define	MICVR_20dB_BOOST				0x0040
1160Sstevel@tonic-gate #define	MICVR_20dB_NOBOOST				0x0000
1170Sstevel@tonic-gate #define	MICVR_MUTE					0x8000
1180Sstevel@tonic-gate 
1190Sstevel@tonic-gate /* Line In Volume Register				Index 10h */
1200Sstevel@tonic-gate #define	AC97_LINE_IN_VOLUME_REGISTER			0x10
1210Sstevel@tonic-gate #define	LIVR_RIGHT_GAIN_MASK				0x001f
1220Sstevel@tonic-gate #define	LIVR_RIGHT_0dB_GAIN				0x0010
1230Sstevel@tonic-gate #define	LIVR_RIGHT_MAX_ATTEN				0x001f
1240Sstevel@tonic-gate #define	LIVR_LEFT_GAIN_MASK				0x1f00
1250Sstevel@tonic-gate #define	LIVR_LEFT_0dB_GAIN				0x1000
1260Sstevel@tonic-gate #define	LIVR_LEFT_MAX_ATTEN				0x1f00
1270Sstevel@tonic-gate #define	LIVR_MUTE					0x8000
1280Sstevel@tonic-gate 
1290Sstevel@tonic-gate /* CD Volume Register					Index 12h */
1300Sstevel@tonic-gate #define	AC97_CD_VOLUME_REGISTER				0x12
1310Sstevel@tonic-gate #define	CDVR_RIGHT_GAIN_MASK				0x001f
1320Sstevel@tonic-gate #define	CDVR_RIGHT_0dB_GAIN				0x0010
1330Sstevel@tonic-gate #define	CDVR_RIGHT_MAX_ATTEN				0x001f
1340Sstevel@tonic-gate #define	CDVR_LEFT_GAIN_MASK				0x1f00
1350Sstevel@tonic-gate #define	CDVR_LEFT_0dB_GAIN				0x1000
1360Sstevel@tonic-gate #define	CDVR_LEFT_MAX_ATTEN				0x1f00
1370Sstevel@tonic-gate #define	CDVR_MUTE					0x8000
1380Sstevel@tonic-gate 
1390Sstevel@tonic-gate /* Video Volume Register				Index 14h - Optional */
1400Sstevel@tonic-gate #define	AC97_VIDEO_VOLUME_REGISTER			0x14
1410Sstevel@tonic-gate #define	VIDVR_RIGHT_GAIN_MASK				0x001f
1420Sstevel@tonic-gate #define	VIDVR_RIGHT_0dB_GAIN				0x0010
1430Sstevel@tonic-gate #define	VIDVR_RIGHT_MAX_ATTEN				0x001f
1440Sstevel@tonic-gate #define	VIDVR_LEFT_GAIN_MASK				0x1f00
1450Sstevel@tonic-gate #define	VIDVR_LEFT_0dB_GAIN				0x1000
1460Sstevel@tonic-gate #define	VIDVR_LEFT_MAX_ATTEN				0x1f00
1470Sstevel@tonic-gate #define	VIDVR_MUTE					0x8000
1480Sstevel@tonic-gate 
1490Sstevel@tonic-gate /* Aux Volume Register					Index 16h - Optional */
1500Sstevel@tonic-gate #define	AC97_AUX_VOLUME_REGISTER			0x16
1510Sstevel@tonic-gate #define	AUXVR_RIGHT_GAIN_MASK				0x001f
1520Sstevel@tonic-gate #define	AUXVR_RIGHT_0dB_GAIN				0x0010
1530Sstevel@tonic-gate #define	AUXVR_RIGHT_MAX_ATTEN				0x001f
1540Sstevel@tonic-gate #define	AUXVR_LEFT_GAIN_MASK				0x1f00
1550Sstevel@tonic-gate #define	AUXVR_LEFT_0dB_GAIN				0x1000
1560Sstevel@tonic-gate #define	AUXVR_LEFT_MAX_ATTEN				0x1f00
1570Sstevel@tonic-gate #define	AUXVR_MUTE					0x8000
1580Sstevel@tonic-gate 
1599484Sgarrett.damore@Sun.COM /* PCM Out Volume Register				Index 18h */
1600Sstevel@tonic-gate #define	AC97_PCM_OUT_VOLUME_REGISTER			0x18
1610Sstevel@tonic-gate #define	PCMOVR_RIGHT_GAIN_MASK				0x001f
1620Sstevel@tonic-gate #define	PCMOVR_RIGHT_0dB_GAIN				0x0010
1630Sstevel@tonic-gate #define	PCMOVR_RIGHT_MAX_ATTEN				0x001f
1640Sstevel@tonic-gate #define	PCMOVR_LEFT_GAIN_MASK				0x1f00
1650Sstevel@tonic-gate #define	PCMOVR_LEFT_0dB_GAIN				0x1000
1660Sstevel@tonic-gate #define	PCMOVR_LEFT_MAX_ATTEN				0x1f00
1670Sstevel@tonic-gate #define	PCMOVR_MUTE					0x8000
1681549Sfl147353 #define	PCMOVR_GAIN_BITS				5
1690Sstevel@tonic-gate 
1700Sstevel@tonic-gate /* Record Select Control Register			Index 1ah */
1710Sstevel@tonic-gate #define	AC97_RECORD_SELECT_CTRL_REGISTER		0x1a
1720Sstevel@tonic-gate #define	RSCR_R_MIC					0x0000
1730Sstevel@tonic-gate #define	RSCR_R_CD					0x0001
1740Sstevel@tonic-gate #define	RSCR_R_VIDEO					0x0002
1750Sstevel@tonic-gate #define	RSCR_R_AUX					0x0003
1760Sstevel@tonic-gate #define	RSCR_R_LINE_IN					0x0004
1770Sstevel@tonic-gate #define	RSCR_R_STEREO_MIX				0x0005
1780Sstevel@tonic-gate #define	RSCR_R_MONO_MIX					0x0006
1790Sstevel@tonic-gate #define	RSCR_R_PHONE					0x0007
1800Sstevel@tonic-gate #define	RSCR_L_MIC					0x0000
1810Sstevel@tonic-gate #define	RSCR_L_CD					0x0100
1820Sstevel@tonic-gate #define	RSCR_L_VIDEO					0x0200
1830Sstevel@tonic-gate #define	RSCR_L_AUX					0x0300
1840Sstevel@tonic-gate #define	RSCR_L_LINE_IN					0x0400
1850Sstevel@tonic-gate #define	RSCR_L_STEREO_MIX				0x0500
1860Sstevel@tonic-gate #define	RSCR_L_MONO_MIX					0x0600
1870Sstevel@tonic-gate #define	RSCR_L_PHONE					0x0700
1880Sstevel@tonic-gate 
1890Sstevel@tonic-gate /* Record Gain Register					Index 1ch */
1900Sstevel@tonic-gate #define	AC97_RECORD_GAIN_REGISTER			0x1c
1910Sstevel@tonic-gate #define	RGR_RIGHT_MASK					0x000f
1920Sstevel@tonic-gate #define	RGR_RIGHT_0db_GAIN				0x0000
1930Sstevel@tonic-gate #define	RGR_RIGHT_MAX_GAIN				0x000f
1940Sstevel@tonic-gate #define	RGR_LEFT_MASK					0x0f00
1950Sstevel@tonic-gate #define	RGR_LEFT_0db_GAIN				0x0000
1960Sstevel@tonic-gate #define	RGR_LEFT_MAX_GAIN				0x0f00
1970Sstevel@tonic-gate #define	RGR_MUTE					0x8000
1980Sstevel@tonic-gate 
1990Sstevel@tonic-gate /* Record Gain Mic Register				Index 1eh - Optional */
2000Sstevel@tonic-gate #define	AC97_RECORD_GAIN_MIC_REGISTER			0x1e
2010Sstevel@tonic-gate #define	RGMR_MASK					0x000f
2020Sstevel@tonic-gate #define	RGMR_MUTE					0x8000
2030Sstevel@tonic-gate #define	RGMR_MASK					0x000f
2040Sstevel@tonic-gate #define	RGMR_0db_GAIN					0x0000
2050Sstevel@tonic-gate #define	RGMR_MAX_GAIN					0x000f
2060Sstevel@tonic-gate 
2070Sstevel@tonic-gate /* General Purpose Register				Index 20h - Optional */
2080Sstevel@tonic-gate #define	AC97_GENERAL_PURPOSE_REGISTER			0x20
2090Sstevel@tonic-gate #define	GPR_LPBK					0x0080
2100Sstevel@tonic-gate #define	GPR_MS_MIC1					0x0000
2110Sstevel@tonic-gate #define	GPR_MS_MIC2					0x0100
2120Sstevel@tonic-gate #define	GPR_MONO_MIX_IN					0x0000
2130Sstevel@tonic-gate #define	GPR_MONO_MIC_IN					0x0200
2140Sstevel@tonic-gate #define	GPR_BASS_BOOST					0x1000
2150Sstevel@tonic-gate #define	GPR_3D_STEREO_ENHANCE				0x2000
2160Sstevel@tonic-gate #define	GPR_ST						0x4000
2170Sstevel@tonic-gate #define	GPR_POP_PRE_3D					0x0000
2180Sstevel@tonic-gate #define	GPR_POP_POST_3D					0x8000
2190Sstevel@tonic-gate 
2200Sstevel@tonic-gate /* 3D Control Regsiter					Index 22h - Optional */
2210Sstevel@tonic-gate #define	AC97_THREE_D_CONTROL_REGISTER			0x22
2220Sstevel@tonic-gate #define	TDCR_DEPTH_MASK					0x000f
2230Sstevel@tonic-gate #define	TDCR_CENTER_MASK				0x0f00
2240Sstevel@tonic-gate #define	TDCR_NULL					0x0000
2250Sstevel@tonic-gate 
2269484Sgarrett.damore@Sun.COM /* Audio Interrupt and Paging Mechanism			Index 24h - r2.3 */
2279484Sgarrett.damore@Sun.COM #define	AC97_INTERRUPT_PAGING_REGISTER			0x24
2289484Sgarrett.damore@Sun.COM #define	IPR_IS						0x8000
2299484Sgarrett.damore@Sun.COM #define	IPR_CAUSE_MASK					0x6000
2309484Sgarrett.damore@Sun.COM #define	IPR_SC						0x1000
2319484Sgarrett.damore@Sun.COM #define	IPR_IE						0x0800
2329484Sgarrett.damore@Sun.COM #define	IPR_PG_MASK					0x000f
2339484Sgarrett.damore@Sun.COM 
2340Sstevel@tonic-gate /* Powerdown Control Status Register			Index 26h */
2350Sstevel@tonic-gate #define	AC97_POWERDOWN_CTRL_STAT_REGISTER		0x26
2360Sstevel@tonic-gate #define	PCSR_ADC					0x0001
2370Sstevel@tonic-gate #define	PCSR_DAC					0x0002
2380Sstevel@tonic-gate #define	PCSR_ANL					0x0004
2390Sstevel@tonic-gate #define	PCSR_REF					0x0008
2400Sstevel@tonic-gate #define	PCSR_POWERD_UP					(PCSR_ADC|PCSR_DAC|\
2410Sstevel@tonic-gate 							PCSR_ANL|PCSR_REF)
2420Sstevel@tonic-gate #define	PCSR_PR0					0x0100
2430Sstevel@tonic-gate #define	PCSR_PR1					0x0200
2440Sstevel@tonic-gate #define	PCSR_PR2					0x0400
2450Sstevel@tonic-gate #define	PCSR_PR3					0x0800
2460Sstevel@tonic-gate #define	PCSR_PR4					0x1000
2470Sstevel@tonic-gate #define	PCSR_PR5					0x2000
2480Sstevel@tonic-gate #define	PCSR_PR6					0x4000
2490Sstevel@tonic-gate #define	PCSR_EAPD					0x8000
2500Sstevel@tonic-gate 
2510Sstevel@tonic-gate /* Extended Audio Register				Index 28h - Optional */
2520Sstevel@tonic-gate #define	AC97_EXTENDED_AUDIO_REGISTER			0x28
2530Sstevel@tonic-gate #define	EAR_VRA						0x0001
2540Sstevel@tonic-gate #define	EAR_DRA						0x0002
2559484Sgarrett.damore@Sun.COM #define	EAR_SPDIF					0x0004
2560Sstevel@tonic-gate #define	EAR_VRM						0x0008
2579484Sgarrett.damore@Sun.COM #define	EAR_DSA_MASK					0x0030
2580Sstevel@tonic-gate #define	EAR_CDAC					0x0040
2590Sstevel@tonic-gate #define	EAR_SDAC					0x0080
2600Sstevel@tonic-gate #define	EAR_LDAC					0x0100
2610Sstevel@tonic-gate #define	EAR_AMAP					0x0200
2629484Sgarrett.damore@Sun.COM #define	EAR_REV_MASK					0x0c00
2639484Sgarrett.damore@Sun.COM #define	EAR_REV_21					0x0000
2649484Sgarrett.damore@Sun.COM #define	EAR_REV_22					0x0400
2659484Sgarrett.damore@Sun.COM #define	EAR_REV_23					0x0800
2660Sstevel@tonic-gate #define	EAR_PRIMARY_CODEC				0x0000
2670Sstevel@tonic-gate #define	EAR_SECONDARY_01_CODEC				0x4000
2680Sstevel@tonic-gate #define	EAR_SECONDARY_10_CODEC				0x8000
2690Sstevel@tonic-gate #define	EAR_SECONDARY_11_CODEC				0xc000
2700Sstevel@tonic-gate 
2710Sstevel@tonic-gate /* Extended Audio Status and Control Register		Index 2ah - Optional */
2720Sstevel@tonic-gate #define	AC97_EXTENDED_AUDIO_STAT_CTRL_REGISTER		0x2a
2730Sstevel@tonic-gate #define	EASCR_VRA					0x0001
2740Sstevel@tonic-gate #define	EASCR_DRA					0x0002
2759484Sgarrett.damore@Sun.COM #define	EASCR_SPDIF					0x0004
2760Sstevel@tonic-gate #define	EASCR_VRM					0x0008
2779484Sgarrett.damore@Sun.COM #define	EASCR_SPSA_MASK					0x0030
2789484Sgarrett.damore@Sun.COM #define	EASCR_SPSA_3_4					0x0000
2799484Sgarrett.damore@Sun.COM #define	EASCR_SPSA_7_8					0x0010
2809484Sgarrett.damore@Sun.COM #define	EASCR_SPSA_6_9					0x0020
2819484Sgarrett.damore@Sun.COM #define	EASCR_SPSA_10_11				0x0030
2820Sstevel@tonic-gate #define	EASCR_CDAC					0x0040
2830Sstevel@tonic-gate #define	EASCR_SDAC					0x0080
2840Sstevel@tonic-gate #define	EASCR_LDAC					0x0100
2850Sstevel@tonic-gate #define	EASCR_MADC					0x0200
2869484Sgarrett.damore@Sun.COM #define	EASCR_SPCV					0x0400
2870Sstevel@tonic-gate #define	EASCR_PRI					0x0800
2880Sstevel@tonic-gate #define	EASCR_PRJ					0x1000
2890Sstevel@tonic-gate #define	EASCR_PRK					0x2000
2900Sstevel@tonic-gate #define	EASCR_PRL					0x4000
2919484Sgarrett.damore@Sun.COM #define	EASCR_VCFG					0x8000
2920Sstevel@tonic-gate 
2930Sstevel@tonic-gate /* Extended Front DAC Rate Register			2ch - Optional */
2940Sstevel@tonic-gate #define	AC97_EXTENDED_FRONT_DAC_RATE_REGISTER		0x2c
2950Sstevel@tonic-gate #define	AC97_SAMPLE_RATE_48000				0xbb80
2960Sstevel@tonic-gate 
2970Sstevel@tonic-gate /* Extended Surround DAC Rate Register			2eh - Optional */
2980Sstevel@tonic-gate #define	AC97_EXTENDED_SURROUND_DAC_RATE_REGISTER	0x2e
2990Sstevel@tonic-gate 
3000Sstevel@tonic-gate /* Extended LFE DAC Rate Register			30h - Optional */
3010Sstevel@tonic-gate #define	AC97_EXTENDED_LFE_DAC_RATE_REGISTER		0x30
3020Sstevel@tonic-gate 
3030Sstevel@tonic-gate /* Extended LR DAC Rate Register			32h - Optional */
3040Sstevel@tonic-gate #define	AC97_EXTENDED_LR_DAC_RATE_REGISTER		0x32
3050Sstevel@tonic-gate 
3060Sstevel@tonic-gate /* Extended Mic ADC Rate Register			34h - Optional */
3070Sstevel@tonic-gate #define	AC97_EXTENDED_MIC_ADC_RATE_REGISTER		0x34
3080Sstevel@tonic-gate 
3090Sstevel@tonic-gate /* Extended Center and LFE Volume Register		36h - Optional */
3100Sstevel@tonic-gate #define	AC97_EXTENDED_C_LFE_VOLUME_REGISTER		0x36
3110Sstevel@tonic-gate #define	EXLFEVR_CENTER_MASK				0x001f
3120Sstevel@tonic-gate #define	EXLFEVR_CENTER_OPTIONAL_MASK			0x003f
3139484Sgarrett.damore@Sun.COM #define	EXLFEVR_CENTER_MUTE				0x0080
3140Sstevel@tonic-gate #define	EXLFEVR_LFE_MASK				0x1f00
3150Sstevel@tonic-gate #define	EXLFEVR_LFE_OPTIONAL_MASK			0x3f00
3160Sstevel@tonic-gate #define	EXLFEVR_LFE_MUTE				0x8000
3170Sstevel@tonic-gate 
3180Sstevel@tonic-gate /* Extended Left and Right Surround Volume Register	38h - Optional */
3190Sstevel@tonic-gate #define	AC97_EXTENDED_LRS_VOLUME_REGISTER		0x38
3200Sstevel@tonic-gate #define	EXLFEVR_RIGHT_MASK				0x001f
3210Sstevel@tonic-gate #define	EXLFEVR_RIGHT_OPTIONAL_MASK			0x003f
3220Sstevel@tonic-gate #define	EXLFEVR_RIGHT_MTUE				0x0080
3230Sstevel@tonic-gate #define	EXLFEVR_LEFT_MASK				0x1f00
3240Sstevel@tonic-gate #define	EXLFEVR_LEFT_OPTIONAL_MASK			0x3f00
3250Sstevel@tonic-gate #define	EXLFEVR_LEFT_MUTE				0x8000
3260Sstevel@tonic-gate 
3279484Sgarrett.damore@Sun.COM /* S/PDIF Control Register				3ah - Optional */
3289484Sgarrett.damore@Sun.COM #define	AC97_SPDIF_CONTROL_REGISTER			0x3a
3299484Sgarrett.damore@Sun.COM #define	SPCR_PRO					0x0001
3309484Sgarrett.damore@Sun.COM #define	SPCR_AUDIO					0x0002
3319484Sgarrett.damore@Sun.COM #define	SPCR_COPY					0x0004
3329484Sgarrett.damore@Sun.COM #define	SPCR_PRE					0x0008
3339484Sgarrett.damore@Sun.COM #define	SPCR_CC_MASK					0x07f0
3349484Sgarrett.damore@Sun.COM #define	SPCR_L						0x0800
3359484Sgarrett.damore@Sun.COM #define	SPCR_SPSR_MASK					0x3000
3369484Sgarrett.damore@Sun.COM #define	SPCR_SPSR_44100					0x0000
3379484Sgarrett.damore@Sun.COM #define	SPCR_SPSR_48000					0x2000
3389484Sgarrett.damore@Sun.COM #define	SPCR_SPSR_32000					0x3000
3399484Sgarrett.damore@Sun.COM #define	SPCR_DRS					0x4000
3409484Sgarrett.damore@Sun.COM #define	SPCR_V						0x8000
3419484Sgarrett.damore@Sun.COM 
3429484Sgarrett.damore@Sun.COM /*
3439484Sgarrett.damore@Sun.COM  * Modem only registers from 3ch - 58h.
3449484Sgarrett.damore@Sun.COM  */
3459484Sgarrett.damore@Sun.COM 
3460Sstevel@tonic-gate /* Extended Modem ID Register				3ch - Optional */
3470Sstevel@tonic-gate #define	AC97_EXTENDED_MODEM_ID_REGISTER			0x3c
3480Sstevel@tonic-gate #define	EMIDR_LINE1					0x0001
3490Sstevel@tonic-gate #define	EMIDR_LINE2					0x0002
3500Sstevel@tonic-gate #define	EMIDR_HSET					0x0004
3510Sstevel@tonic-gate #define	EMIDR_CID1					0x0008
3520Sstevel@tonic-gate #define	EMIDR_CID2					0x0010
3530Sstevel@tonic-gate #define	EMIDR_PRIMARY_CODEC				0x0000
3540Sstevel@tonic-gate #define	EMIDR_SECONDARY_01_CODEC			0x4000
3550Sstevel@tonic-gate #define	EMIDR_SECONDARY_10_CODEC			0x8000
3560Sstevel@tonic-gate #define	EMIDR_SECONDARY_11_CODEC			0xc000
3570Sstevel@tonic-gate 
3580Sstevel@tonic-gate /* Extended Modem Status and Control Register		3eh - Optional */
3590Sstevel@tonic-gate #define	AC97_EXTENDED_MODE_STAT_CTRL_REGISTER		0x3e
3600Sstevel@tonic-gate #define	EMSCR_BPIO					0x0001
3610Sstevel@tonic-gate #define	EMSCR_MREF					0x0002
3620Sstevel@tonic-gate #define	EMSCR_ADC1					0x0004
3630Sstevel@tonic-gate #define	EMSCR_DAC1					0x0008
3640Sstevel@tonic-gate #define	EMSCR_ADC2					0x0010
3650Sstevel@tonic-gate #define	EMSCR_DAC2					0x0020
3660Sstevel@tonic-gate #define	EMSCR_HADC					0x0040
3670Sstevel@tonic-gate #define	EMSCR_HDAC					0x0080
3680Sstevel@tonic-gate #define	EMSCR_PRA					0x0100
3690Sstevel@tonic-gate #define	EMSCR_PRB					0x0200
3700Sstevel@tonic-gate #define	EMSCR_PRC					0x0400
3710Sstevel@tonic-gate #define	EMSCR_PRD					0x0800
3720Sstevel@tonic-gate #define	EMSCR_PRE					0x1000
3730Sstevel@tonic-gate #define	EMSCR_PRF					0x2000
3740Sstevel@tonic-gate #define	EMSCR_PRG					0x4000
3750Sstevel@tonic-gate #define	EMSCR_PRH					0x8000
3760Sstevel@tonic-gate 
3770Sstevel@tonic-gate /* Extended Modem Line 1 DAC/ADC Sample Rate Register	40h - Optional */
3780Sstevel@tonic-gate #define	AC97_EXTENDED_MODEM_LINE1_RATE_REGISTER		0x40
3790Sstevel@tonic-gate 
3800Sstevel@tonic-gate /* Extended Modem Line 2 DAC/ADC Sample Rate Register	42h - Optional */
3810Sstevel@tonic-gate #define	AC97_EXTENDED_MODEM_LINE2_RATE_REGISTER		0x42
3820Sstevel@tonic-gate 
3830Sstevel@tonic-gate /* Extended Modem Handset Sample Rate Register		44h - Optional */
3840Sstevel@tonic-gate #define	AC97_EXTENDED_MODEM_HANDSET_RATE_REGISTER	0x44
3850Sstevel@tonic-gate 
3860Sstevel@tonic-gate /* Extended Modem Line 1 DAC/ADC Level Register		46h - Optional */
3870Sstevel@tonic-gate #define	AC97_EXTENDED_MODEM_LINE1_LEVEL_REGISTER	0x46
3880Sstevel@tonic-gate #define	EML1LR_ADC_LEVEL_MASK				0x000f
3890Sstevel@tonic-gate #define	EML1LR_ADC_LEVEL_MUTE				0x0080
3900Sstevel@tonic-gate #define	EML1LR_DAC_LEVEL_MASK				0x0f00
3910Sstevel@tonic-gate #define	EML1LR_DAC_LEVEL_MUTE				0x8000
3920Sstevel@tonic-gate 
3930Sstevel@tonic-gate /* Extended Modem Line 2 DAC/ADC Level Register		48h - Optional */
3940Sstevel@tonic-gate #define	AC97_EXTENDED_MODEM_LINE2_LEVEL_REGISTER	0x48
3950Sstevel@tonic-gate #define	EML2LR_ADC_LEVEL_MASK				0x000f
3960Sstevel@tonic-gate #define	EML2LR_ADC_LEVEL_MUTE				0x0080
3970Sstevel@tonic-gate #define	EML2LR_DAC_LEVEL_MASK				0x0f00
3980Sstevel@tonic-gate #define	EML2LR_DAC_LEVEL_MUTE				0x8000
3990Sstevel@tonic-gate 
4000Sstevel@tonic-gate /* Extended Modem Handset DAC/ADC Level Register	4ah - Optional */
4010Sstevel@tonic-gate #define	AC97_EXTENDED_MODEM_HANDSET_LEVEL_REGISTER	0x4a
4020Sstevel@tonic-gate #define	EMHLR_ADC_LEVEL_MASK				0x000f
4030Sstevel@tonic-gate #define	EMHLR_ADC_LEVEL_MUTE				0x0080
4040Sstevel@tonic-gate #define	EMHLR_DAC_LEVEL_MASK				0x0f00
4050Sstevel@tonic-gate #define	EMHLR_DAC_LEVEL_MUTE				0x8000
4060Sstevel@tonic-gate 
4070Sstevel@tonic-gate /* Extended Modem GPIO Pin Configuration Register	4ch - Optional */
4080Sstevel@tonic-gate #define	AC97_EXTENDED_MODEM_GPIO_PIN_REGISTER		0x4c
4090Sstevel@tonic-gate 
4100Sstevel@tonic-gate /* Extended Modem GPIO Pin Polarity Register		4eh - Optional */
4110Sstevel@tonic-gate #define	AC97_EXTENDED_MODEM_GPIO_POLARITY_REGISTER	0x4e
4120Sstevel@tonic-gate 
4130Sstevel@tonic-gate /* Extended Modem GPIO Pin Sticky Register		50h - Optional */
4140Sstevel@tonic-gate #define	AC97_EXTENDED_MODEM_GPIO_STICKY_REGISTER	0x50
4150Sstevel@tonic-gate 
4160Sstevel@tonic-gate /* Extended Modem GPIO Pin Wake-up Mask Register	52h - Optional */
4170Sstevel@tonic-gate #define	AC97_EXTENDED_MODEM_GPIO_WAKEUP_REGISTER	0x52
4180Sstevel@tonic-gate 
4190Sstevel@tonic-gate /* Extended Modem GPIO Pin Status Mask Register		54h - Optional */
4200Sstevel@tonic-gate #define	AC97_EXTENDED_MODEM_GPIO_STATUS_REGISTER	0x54
4210Sstevel@tonic-gate 
4220Sstevel@tonic-gate /* Extended Modem AFE Status and Control Register	56h - Optional */
4230Sstevel@tonic-gate #define	AC97_EXTENDED_MODEM_AFE_STAT_CTRL_REGISTER	0x56
4240Sstevel@tonic-gate #define	EMAFESCR_L1B0					0x0001
4250Sstevel@tonic-gate #define	EMAFESCR_L1B1					0x0002
4260Sstevel@tonic-gate #define	EMAFESCR_L1B2					0x0004
4270Sstevel@tonic-gate #define	EMAFESCR_L2B0					0x0010
4280Sstevel@tonic-gate #define	EMAFESCR_L2B1					0x0020
4290Sstevel@tonic-gate #define	EMAFESCR_L2B2					0x0040
4300Sstevel@tonic-gate #define	EMAFESCR_HSB0					0x0100
4310Sstevel@tonic-gate #define	EMAFESCR_HSB1					0x0200
4320Sstevel@tonic-gate #define	EMAFESCR_HSB2					0x0400
4330Sstevel@tonic-gate #define	EMAFESCR_MLINK_ON				0x0000
4340Sstevel@tonic-gate #define	EMAFESCR_MLINK_OFF				0x1000
4350Sstevel@tonic-gate #define	EMAFESCR_CIDR					0x2000
4360Sstevel@tonic-gate #define	EMAFESCR_CID1					0x4000
4370Sstevel@tonic-gate #define	EMAFESCR_CID2					0x8000
4380Sstevel@tonic-gate 
4399484Sgarrett.damore@Sun.COM /* Vendor Reserved Registers				5ah - 7ah - Optional */
4409484Sgarrett.damore@Sun.COM /*
4419484Sgarrett.damore@Sun.COM  * Note that 60h - 6eh is also defined as the extended codec page area in
4429484Sgarrett.damore@Sun.COM  * AC'97 r2.3.
4439484Sgarrett.damore@Sun.COM  */
4440Sstevel@tonic-gate #define	AC97_VENDOR_REGISTER_01				0x5a
4450Sstevel@tonic-gate #define	AC97_VENDOR_REGISTER_02				0x5c
4460Sstevel@tonic-gate #define	AC97_VENDOR_REGISTER_03				0x5e
4470Sstevel@tonic-gate #define	AC97_VENDOR_REGISTER_04				0x60
4480Sstevel@tonic-gate #define	AC97_VENDOR_REGISTER_05				0x62
4490Sstevel@tonic-gate #define	AC97_VENDOR_REGISTER_06				0x64
4500Sstevel@tonic-gate #define	AC97_VENDOR_REGISTER_07				0x66
4510Sstevel@tonic-gate #define	AC97_VENDOR_REGISTER_08				0x68
4520Sstevel@tonic-gate #define	AC97_VENDOR_REGISTER_09				0x6a
4530Sstevel@tonic-gate #define	AC97_VENDOR_REGISTER_10				0x6c
4540Sstevel@tonic-gate #define	AC97_VENDOR_REGISTER_11				0x6e
4550Sstevel@tonic-gate #define	AC97_VENDOR_REGISTER_12				0x70
4560Sstevel@tonic-gate #define	AC97_VENDOR_REGISTER_13				0x72
4570Sstevel@tonic-gate #define	AC97_VENDOR_REGISTER_14				0x74
4580Sstevel@tonic-gate #define	AC97_VENDOR_REGISTER_15				0x76
4590Sstevel@tonic-gate #define	AC97_VENDOR_REGISTER_16				0x78
4600Sstevel@tonic-gate #define	AC97_VENDOR_REGISTER_17				0x7a
4610Sstevel@tonic-gate 
4629484Sgarrett.damore@Sun.COM /*
4639484Sgarrett.damore@Sun.COM  * Page 01 Extended Codec Registers
4649484Sgarrett.damore@Sun.COM  */
4659484Sgarrett.damore@Sun.COM #define	AC97_PAGE01_CODEC_CLASS_REV_REGISTER		0x60
4669484Sgarrett.damore@Sun.COM #define	AC97_PAGE01_PCI_SVID_REGISTER			0x62
4679484Sgarrett.damore@Sun.COM #define	AC97_PAGE01_PCI_SID_REGISTER			0x64
4689484Sgarrett.damore@Sun.COM #define	AC97_PAGE01_FUNCTION_SELECT_REGISTER		0x66
4699484Sgarrett.damore@Sun.COM #define	AC97_PAGE01_FUNCTION_INFORMATION_REGISTER	0x68
4709484Sgarrett.damore@Sun.COM #define	AC97_PAGE01_SENSE_DETAILS_REGISTER		0x6a
4719484Sgarrett.damore@Sun.COM #define	AC97_PAGE01_DAC_SLOT_MAPPING_REGISTER		0x6c
4729484Sgarrett.damore@Sun.COM #define	AC97_PAGE01_ADC_SLOT_MAPPING_REGISTER		0x6e
4739484Sgarrett.damore@Sun.COM 
4740Sstevel@tonic-gate /* Vendor ID1 Register					7ch */
4750Sstevel@tonic-gate #define	AC97_VENDOR_ID1_REGISTER			0x7c
4760Sstevel@tonic-gate #define	VID1R_CHAR2_MASK				0x00ff
4770Sstevel@tonic-gate #define	VID1R_CHAR1_MASK				0xff00
4780Sstevel@tonic-gate 
4790Sstevel@tonic-gate /* Vendor ID2 Register					7eh */
4800Sstevel@tonic-gate #define	AC97_VENDOR_ID2_REGISTER			0x7e
4810Sstevel@tonic-gate #define	VID2R_REVISION_MASK				0x00ff
4820Sstevel@tonic-gate #define	VID2R_CHAR3_MASK				0xff00
4830Sstevel@tonic-gate 
4849484Sgarrett.damore@Sun.COM /*
4859484Sgarrett.damore@Sun.COM  * Property names used by AC97.  We should probably have a better way
4869484Sgarrett.damore@Sun.COM  * of dealing with some of these.  (LINEIN_FUNC and MIC_FUNC should really
4879484Sgarrett.damore@Sun.COM  * be saved/restored with other global settings.)
4889484Sgarrett.damore@Sun.COM  */
4899484Sgarrett.damore@Sun.COM #define	AC97_PROP_AMPLIFIER	"ac97-amplifier"
4909484Sgarrett.damore@Sun.COM #define	AC97_PROP_SPEAKER	"ac97-speaker"
4919484Sgarrett.damore@Sun.COM #define	AC97_PROP_MICBOOST	"ac97-micboost"
4929484Sgarrett.damore@Sun.COM #define	AC97_PROP_NO_HEADPHONE	"ac97-no-headphone"
4939484Sgarrett.damore@Sun.COM #define	AC97_PROP_NO_AUXOUT	"ac97-no-auxout"
4949484Sgarrett.damore@Sun.COM #define	AC97_PROP_NO_CDROM	"ac97-no-cdrom"
4959484Sgarrett.damore@Sun.COM #define	AC97_PROP_NO_VIDEO	"ac97-no-video"
4969484Sgarrett.damore@Sun.COM #define	AC97_PROP_NO_AUXIN	"ac97-no-auxin"
4979484Sgarrett.damore@Sun.COM #define	AC97_PROP_NO_MIC	"ac97-no-mic"
4989484Sgarrett.damore@Sun.COM #define	AC97_PROP_NO_LINEIN	"ac97-no-linein"
4999484Sgarrett.damore@Sun.COM #define	AC97_PROP_LINEIN_FUNC	"ac97-linein-function"	/* 1=linein, 2=surr */
5009484Sgarrett.damore@Sun.COM #define	AC97_PROP_MIC_FUNC	"ac97-mic-function"	/* 1=mic, 2=cen/lfe */
5019484Sgarrett.damore@Sun.COM #define	AC97_PROP_DOWNMIX	"ac97-downmix"
5029484Sgarrett.damore@Sun.COM #define	AC97_PROP_SPREAD	"ac97-spread"
5039484Sgarrett.damore@Sun.COM 
5049484Sgarrett.damore@Sun.COM /*
5059484Sgarrett.damore@Sun.COM  * Known Codec vendors.
5069484Sgarrett.damore@Sun.COM  */
5079484Sgarrett.damore@Sun.COM #define	AC97_VENDOR_ADS			0x41445300	/* Analog Devices */
5089484Sgarrett.damore@Sun.COM #define	AC97_VENDOR_AKM			0x414b4d00	/* Asahi Kasei */
5099484Sgarrett.damore@Sun.COM #define	AC97_VENDOR_ALC			0x414c4300	/* Realtek */
5109484Sgarrett.damore@Sun.COM #define	AC97_VENDOR_ALG			0x414c4700	/* Realtek */
511*12407Sgdamore@opensolaris.org #define	AC97_VENDOR_CMI			0x434d4900	/* Cmedia */
5129484Sgarrett.damore@Sun.COM #define	AC97_VENDOR_CRY			0x43525900	/* Cirrus Logic */
5139484Sgarrett.damore@Sun.COM #define	AC97_VENDOR_CXT			0x43585400	/* Conexant */
5149484Sgarrett.damore@Sun.COM #define	AC97_VENDOR_EMC			0x454d4300	/* eMicro */
5159484Sgarrett.damore@Sun.COM #define	AC97_VENDOR_EV			0x000f8300	/* Ectiva */
5169484Sgarrett.damore@Sun.COM #define	AC97_VENDOR_ESS			0x45838300	/* ESS */
51710913Sgdamore@opensolaris.org #define	AC97_VENDOR_HRS			0x48525300	/* Intersil */
5189484Sgarrett.damore@Sun.COM #define	AC97_VENDOR_ICE			0x49434500	/* ICEnsemble */
51910913Sgdamore@opensolaris.org #define	AC97_VENDOR_ITE			0x49544500	/* ITE */
52010913Sgdamore@opensolaris.org #define	AC97_VENDOR_NSC			0x4e534300	/* National */
52110913Sgdamore@opensolaris.org #define	AC97_VENDOR_PSC			0x50534300	/* Philips */
52210913Sgdamore@opensolaris.org #define	AC97_VENDOR_SIL			0x53494c00	/* Silicon Labs */
5239484Sgarrett.damore@Sun.COM #define	AC97_VENDOR_ST			0x83847600	/* SigmaTel */
5249484Sgarrett.damore@Sun.COM #define	AC97_VENDOR_TRA			0x54524100	/* TriTech */
52510913Sgdamore@opensolaris.org #define	AC97_VENDOR_TXN			0x54584e00	/* TI */
5269484Sgarrett.damore@Sun.COM #define	AC97_VENDOR_VIA			0x56494100	/* VIA */
5279484Sgarrett.damore@Sun.COM #define	AC97_VENDOR_WML			0x574d4c00	/* Wolfson */
5289484Sgarrett.damore@Sun.COM #define	AC97_VENDOR_YMH			0x594d4800	/* Yamaha */
5299484Sgarrett.damore@Sun.COM 
5309484Sgarrett.damore@Sun.COM /*
5319484Sgarrett.damore@Sun.COM  * Known Codec IDs.
5329484Sgarrett.damore@Sun.COM  */
5339484Sgarrett.damore@Sun.COM #define	AC97_CODEC_AD1819B		0x41445303
5349484Sgarrett.damore@Sun.COM #define	AC97_CODEC_AD1881		0x41445340
5359484Sgarrett.damore@Sun.COM #define	AC97_CODEC_AD1881A		0x41445348
5369484Sgarrett.damore@Sun.COM #define	AC97_CODEC_AD1885		0x41445360
5379484Sgarrett.damore@Sun.COM #define	AC97_CODEC_AD1886		0x41445361
5389484Sgarrett.damore@Sun.COM #define	AC97_CODEC_AD1887		0x41445362
5399484Sgarrett.damore@Sun.COM #define	AC97_CODEC_AD1888		0x41445368
5409484Sgarrett.damore@Sun.COM #define	AC97_CODEC_AD1980		0x41445370
5419484Sgarrett.damore@Sun.COM #define	AC97_CODEC_AD1981A		0x41445371
5429484Sgarrett.damore@Sun.COM #define	AC97_CODEC_AD1981		0x41445372
5439484Sgarrett.damore@Sun.COM #define	AC97_CODEC_AD1981B		0x41445374
5449484Sgarrett.damore@Sun.COM #define	AC97_CODEC_AD1985		0x41445375
5459484Sgarrett.damore@Sun.COM #define	AC97_CODEC_AK4540		0x414b4d00
5469484Sgarrett.damore@Sun.COM #define	AC97_CODEC_ALC100		0x414c4326
5479484Sgarrett.damore@Sun.COM #define	AC97_CODEC_ALC200P		0x414c4710
5489484Sgarrett.damore@Sun.COM #define	AC97_CODEC_ALC202		0x414c4740
5499484Sgarrett.damore@Sun.COM #define	AC97_CODEC_ALC203		0x414c4770
5509484Sgarrett.damore@Sun.COM #define	AC97_CODEC_ALC250		0x414c4750
5519484Sgarrett.damore@Sun.COM #define	AC97_CODEC_ALC250_2		0x414c4752
5529484Sgarrett.damore@Sun.COM #define	AC97_CODEC_ALC650		0x414c4720
5539484Sgarrett.damore@Sun.COM #define	AC97_CODEC_ALC655		0x414c4760
5549484Sgarrett.damore@Sun.COM #define	AC97_CODEC_ALC658		0x414c4780
5559484Sgarrett.damore@Sun.COM #define	AC97_CODEC_ALC850		0x414c4790
5569484Sgarrett.damore@Sun.COM #define	AC97_CODEC_CMI9738		0x434d4941
5579484Sgarrett.damore@Sun.COM #define	AC97_CODEC_CMI9739		0x434d4961
5589484Sgarrett.damore@Sun.COM #define	AC97_CODEC_CMI9780		0x434d4969
5599484Sgarrett.damore@Sun.COM #define	AC97_CODEC_CMI9761		0x434d4978
5609484Sgarrett.damore@Sun.COM #define	AC97_CODEC_CMI9761_2		0x434d4982
5619484Sgarrett.damore@Sun.COM #define	AC97_CODEC_CMI9761_3		0x434d4983
5629484Sgarrett.damore@Sun.COM #define	AC97_CODEC_CS4202		0x43525970
5639484Sgarrett.damore@Sun.COM #define	AC97_CODEC_CS4205		0x43525950
5649484Sgarrett.damore@Sun.COM #define	AC97_CODEC_CS4294		0x43525920
5659484Sgarrett.damore@Sun.COM #define	AC97_CODEC_CS4297		0x43525900
5669484Sgarrett.damore@Sun.COM #define	AC97_CODEC_CS4297A		0x43525910
5679484Sgarrett.damore@Sun.COM #define	AC97_CODEC_CS4299		0x43525930
5689484Sgarrett.damore@Sun.COM #define	AC97_CODEC_CX20468		0x43585428
5699484Sgarrett.damore@Sun.COM #define	AC97_CODEC_CX20468_2		0x43585429
5709484Sgarrett.damore@Sun.COM #define	AC97_CODEC_CX20468_21		0x43585430
5719484Sgarrett.damore@Sun.COM #define	AC97_CODEC_EM28028		0x454d4328
5729484Sgarrett.damore@Sun.COM #define	AC97_CODEC_ES1921		0x45838308
5739484Sgarrett.damore@Sun.COM #define	AC97_CODEC_EV1938		0x000f8384
5749484Sgarrett.damore@Sun.COM #define	AC97_CODEC_ICE1232		0x49434511
57510913Sgdamore@opensolaris.org #define	AC97_CODEC_LM4550		0x4e534350
5769484Sgarrett.damore@Sun.COM #define	AC97_CODEC_STAC9700		0x83847600
5779484Sgarrett.damore@Sun.COM #define	AC97_CODEC_STAC9701		0x83847601
5789484Sgarrett.damore@Sun.COM #define	AC97_CODEC_STAC9701_2		0xc250c250
5799484Sgarrett.damore@Sun.COM #define	AC97_CODEC_STAC9704		0x83847604
5809484Sgarrett.damore@Sun.COM #define	AC97_CODEC_STAC9705		0x83847605
5819484Sgarrett.damore@Sun.COM #define	AC97_CODEC_STAC9708		0x83847608
5829484Sgarrett.damore@Sun.COM #define	AC97_CODEC_STAC9721		0x83847609
5839484Sgarrett.damore@Sun.COM #define	AC97_CODEC_STAC9744		0x83847644
5849484Sgarrett.damore@Sun.COM #define	AC97_CODEC_STAC9750		0x83847650
5859484Sgarrett.damore@Sun.COM #define	AC97_CODEC_STAC9752		0x83847652
5869484Sgarrett.damore@Sun.COM #define	AC97_CODEC_STAC9756		0x83847656
5879484Sgarrett.damore@Sun.COM #define	AC97_CODEC_STAC9758		0x83847658
5889484Sgarrett.damore@Sun.COM #define	AC97_CODEC_STAC9766		0x83847666
5899484Sgarrett.damore@Sun.COM #define	AC97_CODEC_TR28023		0x54524103
5909484Sgarrett.damore@Sun.COM #define	AC97_CODEC_TR28023_2		0x54524123
5919484Sgarrett.damore@Sun.COM #define	AC97_CODEC_TR28028		0x54524108
5929484Sgarrett.damore@Sun.COM #define	AC97_CODEC_TR28028_2		0x54524128
5939484Sgarrett.damore@Sun.COM #define	AC97_CODEC_VT1612A		0x56494161
5949484Sgarrett.damore@Sun.COM #define	AC97_CODEC_VT1617A		0x56494170
5959484Sgarrett.damore@Sun.COM #define	AC97_CODEC_VT1616		0x49434551
5969484Sgarrett.damore@Sun.COM #define	AC97_CODEC_VT1616A		0x49434552
5979484Sgarrett.damore@Sun.COM #define	AC97_CODEC_VT1618		0x56494182
5989484Sgarrett.damore@Sun.COM #define	AC97_CODEC_WM9701A		0x574d4c00
5999484Sgarrett.damore@Sun.COM #define	AC97_CODEC_WM9703		0x574d4c03
6009484Sgarrett.damore@Sun.COM #define	AC97_CODEC_WM9704		0x574d4c04
6019484Sgarrett.damore@Sun.COM #define	AC97_CODEC_YMF743		0x594d4800
6029484Sgarrett.damore@Sun.COM #define	AC97_CODEC_YMF753		0x594d4803
6039484Sgarrett.damore@Sun.COM 
6049484Sgarrett.damore@Sun.COM /*
6059484Sgarrett.damore@Sun.COM  * Functions for drivers to interact with the common ac97 module.
6069484Sgarrett.damore@Sun.COM  */
6079484Sgarrett.damore@Sun.COM typedef struct ac97 ac97_t;
6089484Sgarrett.damore@Sun.COM typedef void (*ac97_wr_t)(void *, uint8_t, uint16_t);
6099484Sgarrett.damore@Sun.COM typedef uint16_t (*ac97_rd_t)(void *, uint8_t);
61010413SGarrett.Damore@Sun.COM typedef struct ac97_ctrl ac97_ctrl_t;
61110413SGarrett.Damore@Sun.COM typedef boolean_t (*ac97_ctrl_walk_t)(ac97_ctrl_t *, void *);
6129484Sgarrett.damore@Sun.COM 
61310413SGarrett.Damore@Sun.COM /*
61410413SGarrett.Damore@Sun.COM  * Old style initialization.  The driver simply calls ac97_alloc()
61510413SGarrett.Damore@Sun.COM  * followed by ac97_init().  These interfaces should not be used in
61610413SGarrett.Damore@Sun.COM  * new drivers.
61710413SGarrett.Damore@Sun.COM  */
6189484Sgarrett.damore@Sun.COM ac97_t *ac97_alloc(dev_info_t *, ac97_rd_t, ac97_wr_t, void *);
61910413SGarrett.Damore@Sun.COM int ac97_init(ac97_t *, audio_dev_t *);
62010413SGarrett.Damore@Sun.COM 
62110413SGarrett.Damore@Sun.COM /*
62210413SGarrett.Damore@Sun.COM  * New style initialization.  The driver will call ac97_allocate(),
62310413SGarrett.Damore@Sun.COM  * then it can call ac97_register_controls() to register controls.
62410413SGarrett.Damore@Sun.COM  * Or, if it doesn't want all controls registered, it can find
62510413SGarrett.Damore@Sun.COM  * controls with ac97_find_control(), and register them individually
62610413SGarrett.Damore@Sun.COM  * with ac97_register_control().  ac97_alloc()
62710413SGarrett.Damore@Sun.COM  *
62810413SGarrett.Damore@Sun.COM  * Note that adjusting the set of controls should only be performed
62910413SGarrett.Damore@Sun.COM  * while the driver is single threaded, during attach or detach
63010413SGarrett.Damore@Sun.COM  * processing.  The AC'97 framework does not provide any locks
63110413SGarrett.Damore@Sun.COM  * surrounding its internal list of controls.  Note however that
63210413SGarrett.Damore@Sun.COM  * changes to the controls made from within the framework (e.g. by
63310413SGarrett.Damore@Sun.COM  * someone accessing the control via the audio framework) are safe.
63410413SGarrett.Damore@Sun.COM  */
63510413SGarrett.Damore@Sun.COM ac97_t *ac97_allocate(audio_dev_t *, dev_info_t *, ac97_rd_t, ac97_wr_t,
63610413SGarrett.Damore@Sun.COM     void *);
63710413SGarrett.Damore@Sun.COM void ac97_probe_controls(ac97_t *);
63810413SGarrett.Damore@Sun.COM void ac97_register_controls(ac97_t *);
63910413SGarrett.Damore@Sun.COM void ac97_unregister_controls(ac97_t *);
64010413SGarrett.Damore@Sun.COM 
64110413SGarrett.Damore@Sun.COM void ac97_walk_controls(ac97_t *, ac97_ctrl_walk_t, void *);
64210413SGarrett.Damore@Sun.COM ac97_ctrl_t *ac97_control_find(ac97_t *, const char *);
64310413SGarrett.Damore@Sun.COM void ac97_control_register(ac97_ctrl_t *);
64410413SGarrett.Damore@Sun.COM void ac97_control_unregister(ac97_ctrl_t *);
64510413SGarrett.Damore@Sun.COM void ac97_control_remove(ac97_ctrl_t *);
64610413SGarrett.Damore@Sun.COM const char *ac97_control_name(ac97_ctrl_t *);
64710413SGarrett.Damore@Sun.COM const audio_ctrl_desc_t *ac97_control_desc(ac97_ctrl_t *);
64810413SGarrett.Damore@Sun.COM int ac97_control_get(ac97_ctrl_t *, uint64_t *);
64910413SGarrett.Damore@Sun.COM int ac97_control_set(ac97_ctrl_t *, uint64_t);
65010413SGarrett.Damore@Sun.COM 
65110413SGarrett.Damore@Sun.COM /*
65210413SGarrett.Damore@Sun.COM  * Bits common to both new style and old style initialization.
65310413SGarrett.Damore@Sun.COM  */
6549484Sgarrett.damore@Sun.COM void ac97_free(ac97_t *);
6559484Sgarrett.damore@Sun.COM void ac97_reset(ac97_t *);
6569602Sgdamore@opensolaris.org int ac97_num_channels(ac97_t *);
6579484Sgarrett.damore@Sun.COM 
6580Sstevel@tonic-gate #endif	/* _KERNEL */
6590Sstevel@tonic-gate 
6600Sstevel@tonic-gate #ifdef	__cplusplus
6610Sstevel@tonic-gate }
6620Sstevel@tonic-gate #endif
6630Sstevel@tonic-gate 
6640Sstevel@tonic-gate #endif	/* _SYS_AC97_H */
665