17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5dfb9e8d7Sfl147353 * Common Development and Distribution License (the "License"). 6dfb9e8d7Sfl147353 * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 21dfb9e8d7Sfl147353 227c478bd9Sstevel@tonic-gate /* 23*1cf80175SGarrett D'Amore * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. 24dfb9e8d7Sfl147353 */ 25dfb9e8d7Sfl147353 267c478bd9Sstevel@tonic-gate #ifndef _SYS_AC97_H 277c478bd9Sstevel@tonic-gate #define _SYS_AC97_H 287c478bd9Sstevel@tonic-gate 2988447a05SGarrett D'Amore #include <sys/types.h> 3088447a05SGarrett D'Amore #include <sys/audio/audio_common.h> 317c478bd9Sstevel@tonic-gate 327c478bd9Sstevel@tonic-gate #ifdef __cplusplus 337c478bd9Sstevel@tonic-gate extern "C" { 347c478bd9Sstevel@tonic-gate #endif 357c478bd9Sstevel@tonic-gate 367c478bd9Sstevel@tonic-gate #ifdef _KERNEL 377c478bd9Sstevel@tonic-gate 387c478bd9Sstevel@tonic-gate /* 3988447a05SGarrett D'Amore * This header file describes the AC-97 Codec register set. See the 407c478bd9Sstevel@tonic-gate * spec for a detailed description of each register. 417c478bd9Sstevel@tonic-gate */ 427c478bd9Sstevel@tonic-gate 437c478bd9Sstevel@tonic-gate /* 4488447a05SGarrett D'Amore * Defines for the registers. 457c478bd9Sstevel@tonic-gate */ 467c478bd9Sstevel@tonic-gate 477c478bd9Sstevel@tonic-gate /* Reset Register Index 00h */ 487c478bd9Sstevel@tonic-gate #define AC97_RESET_REGISTER 0x00 497c478bd9Sstevel@tonic-gate #define RR_DEDICATED_MIC 0x0001 507c478bd9Sstevel@tonic-gate #define RR_RESERVED 0x0002 517c478bd9Sstevel@tonic-gate #define RR_BASS_TREBLE 0x0004 527c478bd9Sstevel@tonic-gate #define RR_PSEUDO_STEREO 0x0008 537c478bd9Sstevel@tonic-gate #define RR_HEADPHONE_SUPPORT 0x0010 547c478bd9Sstevel@tonic-gate #define RR_LOUDNESS_SUPPORT 0x0020 557c478bd9Sstevel@tonic-gate #define RR_18_BIT_DAC 0x0040 567c478bd9Sstevel@tonic-gate #define RR_20_BIT_DAC 0x0080 577c478bd9Sstevel@tonic-gate #define RR_18_BIT_ADC 0x0100 587c478bd9Sstevel@tonic-gate #define RR_20_BIT_ADC 0x0200 597c478bd9Sstevel@tonic-gate #define RR_3D_STEREO_ENHANCE_MASK 0x7c00 607c478bd9Sstevel@tonic-gate 617c478bd9Sstevel@tonic-gate /* Master Volume Register Index 02h */ 627c478bd9Sstevel@tonic-gate #define AC97_MASTER_VOLUME_REGISTER 0x02 637c478bd9Sstevel@tonic-gate #define MVR_RIGHT_MASK 0x001f 647c478bd9Sstevel@tonic-gate #define MVR_RIGHT_0dB_ATTEN 0x0000 657c478bd9Sstevel@tonic-gate #define MVR_RIGHT_OPTIONAL_MASK 0x003f 667c478bd9Sstevel@tonic-gate #define MVR_LEFT_MASK 0x1f00 677c478bd9Sstevel@tonic-gate #define MVR_LEFT_0dB_ATTEN 0x0000 687c478bd9Sstevel@tonic-gate #define MVR_LEFT_OPTIONAL_MASK 0x3f00 697c478bd9Sstevel@tonic-gate #define MVR_MUTE 0x8000 707c478bd9Sstevel@tonic-gate 717c478bd9Sstevel@tonic-gate /* Headphone Volume Register Index 04h - Optional */ 727c478bd9Sstevel@tonic-gate #define AC97_HEADPHONE_VOLUME_REGISTER 0x04 737c478bd9Sstevel@tonic-gate #define HPVR_RIGHT_MASK 0x001f 747c478bd9Sstevel@tonic-gate #define HPVR_RIGHT_0dB_ATTEN 0x0000 757c478bd9Sstevel@tonic-gate #define HPVR_RIGHT_OPTIONAL_MASK 0x003f 767c478bd9Sstevel@tonic-gate #define HPVR_LEFT_MASK 0x1f00 777c478bd9Sstevel@tonic-gate #define HPVR_LEFT_0dB_ATTEN 0x0000 787c478bd9Sstevel@tonic-gate #define HPVR_LEFT_OPTIONAL_MASK 0x3f00 797c478bd9Sstevel@tonic-gate #define HPVR_MUTE 0x8000 807c478bd9Sstevel@tonic-gate 817c478bd9Sstevel@tonic-gate /* Mono Master Volume Register Index 06h - Optional */ 8288447a05SGarrett D'Amore #define AC97_MONO_MASTER_VOLUME_REGISTER 0x06 837c478bd9Sstevel@tonic-gate #define MMVR_MASK 0x001f 847c478bd9Sstevel@tonic-gate #define MMVR_0dB_ATTEN 0x0000 857c478bd9Sstevel@tonic-gate #define MMVR_OPTIONAL_MASK 0x003f 867c478bd9Sstevel@tonic-gate #define MMVR_MUTE 0x8000 877c478bd9Sstevel@tonic-gate 887c478bd9Sstevel@tonic-gate /* Master Tone Control Register Index 08h - Optional */ 897c478bd9Sstevel@tonic-gate #define AC97_MASTER_TONE_CONTROL_REGISTER 0x08 907c478bd9Sstevel@tonic-gate #define MTCR_TREBLE_MASK 0x000e 917c478bd9Sstevel@tonic-gate #define MTCR_TREBLE_OPTIONAL_MASK 0x000f 927c478bd9Sstevel@tonic-gate #define MTCR_TREBLE_BYPASS 0x000f 937c478bd9Sstevel@tonic-gate #define MTCR_BASS_MASK 0x0e00 947c478bd9Sstevel@tonic-gate #define MTCR_BASS_OPTIONAL_MASK 0x0f00 957c478bd9Sstevel@tonic-gate #define MTCR_BASS_BYPASS 0x0f00 967c478bd9Sstevel@tonic-gate 977c478bd9Sstevel@tonic-gate /* PC Beep Register Index 0ah - Optional */ 987c478bd9Sstevel@tonic-gate #define AC97_PC_BEEP_REGISTER 0x0a 997c478bd9Sstevel@tonic-gate #define PCBR_VOLUME_MASK 0x001e 1007c478bd9Sstevel@tonic-gate #define PCBR_0dB_ATTEN 0x0000 1017c478bd9Sstevel@tonic-gate #define PCBR_MUTE 0x8000 1027c478bd9Sstevel@tonic-gate 1037c478bd9Sstevel@tonic-gate /* Phone Volume Register Index 0ch - Optional */ 1047c478bd9Sstevel@tonic-gate #define AC97_PHONE_VOLUME_REGISTER 0x0c 1057c478bd9Sstevel@tonic-gate #define PVR_GAIN_MASK 0x001f 1067c478bd9Sstevel@tonic-gate #define PVR_0dB_GAIN 0x0010 1077c478bd9Sstevel@tonic-gate #define PVR_MAX_ATTEN 0x001f 1087c478bd9Sstevel@tonic-gate #define PVR_MUTE 0x8000 1097c478bd9Sstevel@tonic-gate 1107c478bd9Sstevel@tonic-gate /* Mic Volume Register Index 0eh */ 1117c478bd9Sstevel@tonic-gate #define AC97_MIC_VOLUME_REGISTER 0x0e 1127c478bd9Sstevel@tonic-gate #define MICVR_GAIN_MASK 0x001f 1137c478bd9Sstevel@tonic-gate #define MICVR_0dB_GAIN 0x0008 1147c478bd9Sstevel@tonic-gate #define MICVR_MAX_ATTEN 0x001f 1157c478bd9Sstevel@tonic-gate #define MICVR_20dB_BOOST 0x0040 1167c478bd9Sstevel@tonic-gate #define MICVR_20dB_NOBOOST 0x0000 1177c478bd9Sstevel@tonic-gate #define MICVR_MUTE 0x8000 1187c478bd9Sstevel@tonic-gate 1197c478bd9Sstevel@tonic-gate /* Line In Volume Register Index 10h */ 1207c478bd9Sstevel@tonic-gate #define AC97_LINE_IN_VOLUME_REGISTER 0x10 1217c478bd9Sstevel@tonic-gate #define LIVR_RIGHT_GAIN_MASK 0x001f 1227c478bd9Sstevel@tonic-gate #define LIVR_RIGHT_0dB_GAIN 0x0010 1237c478bd9Sstevel@tonic-gate #define LIVR_RIGHT_MAX_ATTEN 0x001f 1247c478bd9Sstevel@tonic-gate #define LIVR_LEFT_GAIN_MASK 0x1f00 1257c478bd9Sstevel@tonic-gate #define LIVR_LEFT_0dB_GAIN 0x1000 1267c478bd9Sstevel@tonic-gate #define LIVR_LEFT_MAX_ATTEN 0x1f00 1277c478bd9Sstevel@tonic-gate #define LIVR_MUTE 0x8000 1287c478bd9Sstevel@tonic-gate 1297c478bd9Sstevel@tonic-gate /* CD Volume Register Index 12h */ 1307c478bd9Sstevel@tonic-gate #define AC97_CD_VOLUME_REGISTER 0x12 1317c478bd9Sstevel@tonic-gate #define CDVR_RIGHT_GAIN_MASK 0x001f 1327c478bd9Sstevel@tonic-gate #define CDVR_RIGHT_0dB_GAIN 0x0010 1337c478bd9Sstevel@tonic-gate #define CDVR_RIGHT_MAX_ATTEN 0x001f 1347c478bd9Sstevel@tonic-gate #define CDVR_LEFT_GAIN_MASK 0x1f00 1357c478bd9Sstevel@tonic-gate #define CDVR_LEFT_0dB_GAIN 0x1000 1367c478bd9Sstevel@tonic-gate #define CDVR_LEFT_MAX_ATTEN 0x1f00 1377c478bd9Sstevel@tonic-gate #define CDVR_MUTE 0x8000 1387c478bd9Sstevel@tonic-gate 1397c478bd9Sstevel@tonic-gate /* Video Volume Register Index 14h - Optional */ 1407c478bd9Sstevel@tonic-gate #define AC97_VIDEO_VOLUME_REGISTER 0x14 1417c478bd9Sstevel@tonic-gate #define VIDVR_RIGHT_GAIN_MASK 0x001f 1427c478bd9Sstevel@tonic-gate #define VIDVR_RIGHT_0dB_GAIN 0x0010 1437c478bd9Sstevel@tonic-gate #define VIDVR_RIGHT_MAX_ATTEN 0x001f 1447c478bd9Sstevel@tonic-gate #define VIDVR_LEFT_GAIN_MASK 0x1f00 1457c478bd9Sstevel@tonic-gate #define VIDVR_LEFT_0dB_GAIN 0x1000 1467c478bd9Sstevel@tonic-gate #define VIDVR_LEFT_MAX_ATTEN 0x1f00 1477c478bd9Sstevel@tonic-gate #define VIDVR_MUTE 0x8000 1487c478bd9Sstevel@tonic-gate 1497c478bd9Sstevel@tonic-gate /* Aux Volume Register Index 16h - Optional */ 1507c478bd9Sstevel@tonic-gate #define AC97_AUX_VOLUME_REGISTER 0x16 1517c478bd9Sstevel@tonic-gate #define AUXVR_RIGHT_GAIN_MASK 0x001f 1527c478bd9Sstevel@tonic-gate #define AUXVR_RIGHT_0dB_GAIN 0x0010 1537c478bd9Sstevel@tonic-gate #define AUXVR_RIGHT_MAX_ATTEN 0x001f 1547c478bd9Sstevel@tonic-gate #define AUXVR_LEFT_GAIN_MASK 0x1f00 1557c478bd9Sstevel@tonic-gate #define AUXVR_LEFT_0dB_GAIN 0x1000 1567c478bd9Sstevel@tonic-gate #define AUXVR_LEFT_MAX_ATTEN 0x1f00 1577c478bd9Sstevel@tonic-gate #define AUXVR_MUTE 0x8000 1587c478bd9Sstevel@tonic-gate 15988447a05SGarrett D'Amore /* PCM Out Volume Register Index 18h */ 1607c478bd9Sstevel@tonic-gate #define AC97_PCM_OUT_VOLUME_REGISTER 0x18 1617c478bd9Sstevel@tonic-gate #define PCMOVR_RIGHT_GAIN_MASK 0x001f 1627c478bd9Sstevel@tonic-gate #define PCMOVR_RIGHT_0dB_GAIN 0x0010 1637c478bd9Sstevel@tonic-gate #define PCMOVR_RIGHT_MAX_ATTEN 0x001f 1647c478bd9Sstevel@tonic-gate #define PCMOVR_LEFT_GAIN_MASK 0x1f00 1657c478bd9Sstevel@tonic-gate #define PCMOVR_LEFT_0dB_GAIN 0x1000 1667c478bd9Sstevel@tonic-gate #define PCMOVR_LEFT_MAX_ATTEN 0x1f00 1677c478bd9Sstevel@tonic-gate #define PCMOVR_MUTE 0x8000 168dfb9e8d7Sfl147353 #define PCMOVR_GAIN_BITS 5 1697c478bd9Sstevel@tonic-gate 1707c478bd9Sstevel@tonic-gate /* Record Select Control Register Index 1ah */ 1717c478bd9Sstevel@tonic-gate #define AC97_RECORD_SELECT_CTRL_REGISTER 0x1a 1727c478bd9Sstevel@tonic-gate #define RSCR_R_MIC 0x0000 1737c478bd9Sstevel@tonic-gate #define RSCR_R_CD 0x0001 1747c478bd9Sstevel@tonic-gate #define RSCR_R_VIDEO 0x0002 1757c478bd9Sstevel@tonic-gate #define RSCR_R_AUX 0x0003 1767c478bd9Sstevel@tonic-gate #define RSCR_R_LINE_IN 0x0004 1777c478bd9Sstevel@tonic-gate #define RSCR_R_STEREO_MIX 0x0005 1787c478bd9Sstevel@tonic-gate #define RSCR_R_MONO_MIX 0x0006 1797c478bd9Sstevel@tonic-gate #define RSCR_R_PHONE 0x0007 1807c478bd9Sstevel@tonic-gate #define RSCR_L_MIC 0x0000 1817c478bd9Sstevel@tonic-gate #define RSCR_L_CD 0x0100 1827c478bd9Sstevel@tonic-gate #define RSCR_L_VIDEO 0x0200 1837c478bd9Sstevel@tonic-gate #define RSCR_L_AUX 0x0300 1847c478bd9Sstevel@tonic-gate #define RSCR_L_LINE_IN 0x0400 1857c478bd9Sstevel@tonic-gate #define RSCR_L_STEREO_MIX 0x0500 1867c478bd9Sstevel@tonic-gate #define RSCR_L_MONO_MIX 0x0600 1877c478bd9Sstevel@tonic-gate #define RSCR_L_PHONE 0x0700 1887c478bd9Sstevel@tonic-gate 1897c478bd9Sstevel@tonic-gate /* Record Gain Register Index 1ch */ 1907c478bd9Sstevel@tonic-gate #define AC97_RECORD_GAIN_REGISTER 0x1c 1917c478bd9Sstevel@tonic-gate #define RGR_RIGHT_MASK 0x000f 1927c478bd9Sstevel@tonic-gate #define RGR_RIGHT_0db_GAIN 0x0000 1937c478bd9Sstevel@tonic-gate #define RGR_RIGHT_MAX_GAIN 0x000f 1947c478bd9Sstevel@tonic-gate #define RGR_LEFT_MASK 0x0f00 1957c478bd9Sstevel@tonic-gate #define RGR_LEFT_0db_GAIN 0x0000 1967c478bd9Sstevel@tonic-gate #define RGR_LEFT_MAX_GAIN 0x0f00 1977c478bd9Sstevel@tonic-gate #define RGR_MUTE 0x8000 1987c478bd9Sstevel@tonic-gate 1997c478bd9Sstevel@tonic-gate /* Record Gain Mic Register Index 1eh - Optional */ 2007c478bd9Sstevel@tonic-gate #define AC97_RECORD_GAIN_MIC_REGISTER 0x1e 2017c478bd9Sstevel@tonic-gate #define RGMR_MASK 0x000f 2027c478bd9Sstevel@tonic-gate #define RGMR_MUTE 0x8000 2037c478bd9Sstevel@tonic-gate #define RGMR_MASK 0x000f 2047c478bd9Sstevel@tonic-gate #define RGMR_0db_GAIN 0x0000 2057c478bd9Sstevel@tonic-gate #define RGMR_MAX_GAIN 0x000f 2067c478bd9Sstevel@tonic-gate 2077c478bd9Sstevel@tonic-gate /* General Purpose Register Index 20h - Optional */ 2087c478bd9Sstevel@tonic-gate #define AC97_GENERAL_PURPOSE_REGISTER 0x20 2097c478bd9Sstevel@tonic-gate #define GPR_LPBK 0x0080 2107c478bd9Sstevel@tonic-gate #define GPR_MS_MIC1 0x0000 2117c478bd9Sstevel@tonic-gate #define GPR_MS_MIC2 0x0100 2127c478bd9Sstevel@tonic-gate #define GPR_MONO_MIX_IN 0x0000 2137c478bd9Sstevel@tonic-gate #define GPR_MONO_MIC_IN 0x0200 2147c478bd9Sstevel@tonic-gate #define GPR_BASS_BOOST 0x1000 2157c478bd9Sstevel@tonic-gate #define GPR_3D_STEREO_ENHANCE 0x2000 2167c478bd9Sstevel@tonic-gate #define GPR_ST 0x4000 2177c478bd9Sstevel@tonic-gate #define GPR_POP_PRE_3D 0x0000 2187c478bd9Sstevel@tonic-gate #define GPR_POP_POST_3D 0x8000 2197c478bd9Sstevel@tonic-gate 2207c478bd9Sstevel@tonic-gate /* 3D Control Regsiter Index 22h - Optional */ 2217c478bd9Sstevel@tonic-gate #define AC97_THREE_D_CONTROL_REGISTER 0x22 2227c478bd9Sstevel@tonic-gate #define TDCR_DEPTH_MASK 0x000f 2237c478bd9Sstevel@tonic-gate #define TDCR_CENTER_MASK 0x0f00 2247c478bd9Sstevel@tonic-gate #define TDCR_NULL 0x0000 2257c478bd9Sstevel@tonic-gate 22688447a05SGarrett D'Amore /* Audio Interrupt and Paging Mechanism Index 24h - r2.3 */ 22788447a05SGarrett D'Amore #define AC97_INTERRUPT_PAGING_REGISTER 0x24 22888447a05SGarrett D'Amore #define IPR_IS 0x8000 22988447a05SGarrett D'Amore #define IPR_CAUSE_MASK 0x6000 23088447a05SGarrett D'Amore #define IPR_SC 0x1000 23188447a05SGarrett D'Amore #define IPR_IE 0x0800 23288447a05SGarrett D'Amore #define IPR_PG_MASK 0x000f 23388447a05SGarrett D'Amore 2347c478bd9Sstevel@tonic-gate /* Powerdown Control Status Register Index 26h */ 2357c478bd9Sstevel@tonic-gate #define AC97_POWERDOWN_CTRL_STAT_REGISTER 0x26 2367c478bd9Sstevel@tonic-gate #define PCSR_ADC 0x0001 2377c478bd9Sstevel@tonic-gate #define PCSR_DAC 0x0002 2387c478bd9Sstevel@tonic-gate #define PCSR_ANL 0x0004 2397c478bd9Sstevel@tonic-gate #define PCSR_REF 0x0008 2407c478bd9Sstevel@tonic-gate #define PCSR_POWERD_UP (PCSR_ADC|PCSR_DAC|\ 2417c478bd9Sstevel@tonic-gate PCSR_ANL|PCSR_REF) 2427c478bd9Sstevel@tonic-gate #define PCSR_PR0 0x0100 2437c478bd9Sstevel@tonic-gate #define PCSR_PR1 0x0200 2447c478bd9Sstevel@tonic-gate #define PCSR_PR2 0x0400 2457c478bd9Sstevel@tonic-gate #define PCSR_PR3 0x0800 2467c478bd9Sstevel@tonic-gate #define PCSR_PR4 0x1000 2477c478bd9Sstevel@tonic-gate #define PCSR_PR5 0x2000 2487c478bd9Sstevel@tonic-gate #define PCSR_PR6 0x4000 2497c478bd9Sstevel@tonic-gate #define PCSR_EAPD 0x8000 2507c478bd9Sstevel@tonic-gate 2517c478bd9Sstevel@tonic-gate /* Extended Audio Register Index 28h - Optional */ 2527c478bd9Sstevel@tonic-gate #define AC97_EXTENDED_AUDIO_REGISTER 0x28 2537c478bd9Sstevel@tonic-gate #define EAR_VRA 0x0001 2547c478bd9Sstevel@tonic-gate #define EAR_DRA 0x0002 25588447a05SGarrett D'Amore #define EAR_SPDIF 0x0004 2567c478bd9Sstevel@tonic-gate #define EAR_VRM 0x0008 25788447a05SGarrett D'Amore #define EAR_DSA_MASK 0x0030 2587c478bd9Sstevel@tonic-gate #define EAR_CDAC 0x0040 2597c478bd9Sstevel@tonic-gate #define EAR_SDAC 0x0080 2607c478bd9Sstevel@tonic-gate #define EAR_LDAC 0x0100 2617c478bd9Sstevel@tonic-gate #define EAR_AMAP 0x0200 26288447a05SGarrett D'Amore #define EAR_REV_MASK 0x0c00 26388447a05SGarrett D'Amore #define EAR_REV_21 0x0000 26488447a05SGarrett D'Amore #define EAR_REV_22 0x0400 26588447a05SGarrett D'Amore #define EAR_REV_23 0x0800 2667c478bd9Sstevel@tonic-gate #define EAR_PRIMARY_CODEC 0x0000 2677c478bd9Sstevel@tonic-gate #define EAR_SECONDARY_01_CODEC 0x4000 2687c478bd9Sstevel@tonic-gate #define EAR_SECONDARY_10_CODEC 0x8000 2697c478bd9Sstevel@tonic-gate #define EAR_SECONDARY_11_CODEC 0xc000 2707c478bd9Sstevel@tonic-gate 2717c478bd9Sstevel@tonic-gate /* Extended Audio Status and Control Register Index 2ah - Optional */ 2727c478bd9Sstevel@tonic-gate #define AC97_EXTENDED_AUDIO_STAT_CTRL_REGISTER 0x2a 2737c478bd9Sstevel@tonic-gate #define EASCR_VRA 0x0001 2747c478bd9Sstevel@tonic-gate #define EASCR_DRA 0x0002 27588447a05SGarrett D'Amore #define EASCR_SPDIF 0x0004 2767c478bd9Sstevel@tonic-gate #define EASCR_VRM 0x0008 27788447a05SGarrett D'Amore #define EASCR_SPSA_MASK 0x0030 27888447a05SGarrett D'Amore #define EASCR_SPSA_3_4 0x0000 27988447a05SGarrett D'Amore #define EASCR_SPSA_7_8 0x0010 28088447a05SGarrett D'Amore #define EASCR_SPSA_6_9 0x0020 28188447a05SGarrett D'Amore #define EASCR_SPSA_10_11 0x0030 2827c478bd9Sstevel@tonic-gate #define EASCR_CDAC 0x0040 2837c478bd9Sstevel@tonic-gate #define EASCR_SDAC 0x0080 2847c478bd9Sstevel@tonic-gate #define EASCR_LDAC 0x0100 2857c478bd9Sstevel@tonic-gate #define EASCR_MADC 0x0200 28688447a05SGarrett D'Amore #define EASCR_SPCV 0x0400 2877c478bd9Sstevel@tonic-gate #define EASCR_PRI 0x0800 2887c478bd9Sstevel@tonic-gate #define EASCR_PRJ 0x1000 2897c478bd9Sstevel@tonic-gate #define EASCR_PRK 0x2000 2907c478bd9Sstevel@tonic-gate #define EASCR_PRL 0x4000 29188447a05SGarrett D'Amore #define EASCR_VCFG 0x8000 2927c478bd9Sstevel@tonic-gate 2937c478bd9Sstevel@tonic-gate /* Extended Front DAC Rate Register 2ch - Optional */ 2947c478bd9Sstevel@tonic-gate #define AC97_EXTENDED_FRONT_DAC_RATE_REGISTER 0x2c 2957c478bd9Sstevel@tonic-gate #define AC97_SAMPLE_RATE_48000 0xbb80 2967c478bd9Sstevel@tonic-gate 2977c478bd9Sstevel@tonic-gate /* Extended Surround DAC Rate Register 2eh - Optional */ 2987c478bd9Sstevel@tonic-gate #define AC97_EXTENDED_SURROUND_DAC_RATE_REGISTER 0x2e 2997c478bd9Sstevel@tonic-gate 3007c478bd9Sstevel@tonic-gate /* Extended LFE DAC Rate Register 30h - Optional */ 3017c478bd9Sstevel@tonic-gate #define AC97_EXTENDED_LFE_DAC_RATE_REGISTER 0x30 3027c478bd9Sstevel@tonic-gate 3037c478bd9Sstevel@tonic-gate /* Extended LR DAC Rate Register 32h - Optional */ 3047c478bd9Sstevel@tonic-gate #define AC97_EXTENDED_LR_DAC_RATE_REGISTER 0x32 3057c478bd9Sstevel@tonic-gate 3067c478bd9Sstevel@tonic-gate /* Extended Mic ADC Rate Register 34h - Optional */ 3077c478bd9Sstevel@tonic-gate #define AC97_EXTENDED_MIC_ADC_RATE_REGISTER 0x34 3087c478bd9Sstevel@tonic-gate 3097c478bd9Sstevel@tonic-gate /* Extended Center and LFE Volume Register 36h - Optional */ 3107c478bd9Sstevel@tonic-gate #define AC97_EXTENDED_C_LFE_VOLUME_REGISTER 0x36 3117c478bd9Sstevel@tonic-gate #define EXLFEVR_CENTER_MASK 0x001f 3127c478bd9Sstevel@tonic-gate #define EXLFEVR_CENTER_OPTIONAL_MASK 0x003f 31388447a05SGarrett D'Amore #define EXLFEVR_CENTER_MUTE 0x0080 3147c478bd9Sstevel@tonic-gate #define EXLFEVR_LFE_MASK 0x1f00 3157c478bd9Sstevel@tonic-gate #define EXLFEVR_LFE_OPTIONAL_MASK 0x3f00 3167c478bd9Sstevel@tonic-gate #define EXLFEVR_LFE_MUTE 0x8000 3177c478bd9Sstevel@tonic-gate 3187c478bd9Sstevel@tonic-gate /* Extended Left and Right Surround Volume Register 38h - Optional */ 3197c478bd9Sstevel@tonic-gate #define AC97_EXTENDED_LRS_VOLUME_REGISTER 0x38 3207c478bd9Sstevel@tonic-gate #define EXLFEVR_RIGHT_MASK 0x001f 3217c478bd9Sstevel@tonic-gate #define EXLFEVR_RIGHT_OPTIONAL_MASK 0x003f 3227c478bd9Sstevel@tonic-gate #define EXLFEVR_RIGHT_MTUE 0x0080 3237c478bd9Sstevel@tonic-gate #define EXLFEVR_LEFT_MASK 0x1f00 3247c478bd9Sstevel@tonic-gate #define EXLFEVR_LEFT_OPTIONAL_MASK 0x3f00 3257c478bd9Sstevel@tonic-gate #define EXLFEVR_LEFT_MUTE 0x8000 3267c478bd9Sstevel@tonic-gate 32788447a05SGarrett D'Amore /* S/PDIF Control Register 3ah - Optional */ 32888447a05SGarrett D'Amore #define AC97_SPDIF_CONTROL_REGISTER 0x3a 32988447a05SGarrett D'Amore #define SPCR_PRO 0x0001 33088447a05SGarrett D'Amore #define SPCR_AUDIO 0x0002 33188447a05SGarrett D'Amore #define SPCR_COPY 0x0004 33288447a05SGarrett D'Amore #define SPCR_PRE 0x0008 33388447a05SGarrett D'Amore #define SPCR_CC_MASK 0x07f0 33488447a05SGarrett D'Amore #define SPCR_L 0x0800 33588447a05SGarrett D'Amore #define SPCR_SPSR_MASK 0x3000 33688447a05SGarrett D'Amore #define SPCR_SPSR_44100 0x0000 33788447a05SGarrett D'Amore #define SPCR_SPSR_48000 0x2000 33888447a05SGarrett D'Amore #define SPCR_SPSR_32000 0x3000 33988447a05SGarrett D'Amore #define SPCR_DRS 0x4000 34088447a05SGarrett D'Amore #define SPCR_V 0x8000 34188447a05SGarrett D'Amore 34288447a05SGarrett D'Amore /* 34388447a05SGarrett D'Amore * Modem only registers from 3ch - 58h. 34488447a05SGarrett D'Amore */ 34588447a05SGarrett D'Amore 3467c478bd9Sstevel@tonic-gate /* Extended Modem ID Register 3ch - Optional */ 3477c478bd9Sstevel@tonic-gate #define AC97_EXTENDED_MODEM_ID_REGISTER 0x3c 3487c478bd9Sstevel@tonic-gate #define EMIDR_LINE1 0x0001 3497c478bd9Sstevel@tonic-gate #define EMIDR_LINE2 0x0002 3507c478bd9Sstevel@tonic-gate #define EMIDR_HSET 0x0004 3517c478bd9Sstevel@tonic-gate #define EMIDR_CID1 0x0008 3527c478bd9Sstevel@tonic-gate #define EMIDR_CID2 0x0010 3537c478bd9Sstevel@tonic-gate #define EMIDR_PRIMARY_CODEC 0x0000 3547c478bd9Sstevel@tonic-gate #define EMIDR_SECONDARY_01_CODEC 0x4000 3557c478bd9Sstevel@tonic-gate #define EMIDR_SECONDARY_10_CODEC 0x8000 3567c478bd9Sstevel@tonic-gate #define EMIDR_SECONDARY_11_CODEC 0xc000 3577c478bd9Sstevel@tonic-gate 3587c478bd9Sstevel@tonic-gate /* Extended Modem Status and Control Register 3eh - Optional */ 3597c478bd9Sstevel@tonic-gate #define AC97_EXTENDED_MODE_STAT_CTRL_REGISTER 0x3e 3607c478bd9Sstevel@tonic-gate #define EMSCR_BPIO 0x0001 3617c478bd9Sstevel@tonic-gate #define EMSCR_MREF 0x0002 3627c478bd9Sstevel@tonic-gate #define EMSCR_ADC1 0x0004 3637c478bd9Sstevel@tonic-gate #define EMSCR_DAC1 0x0008 3647c478bd9Sstevel@tonic-gate #define EMSCR_ADC2 0x0010 3657c478bd9Sstevel@tonic-gate #define EMSCR_DAC2 0x0020 3667c478bd9Sstevel@tonic-gate #define EMSCR_HADC 0x0040 3677c478bd9Sstevel@tonic-gate #define EMSCR_HDAC 0x0080 3687c478bd9Sstevel@tonic-gate #define EMSCR_PRA 0x0100 3697c478bd9Sstevel@tonic-gate #define EMSCR_PRB 0x0200 3707c478bd9Sstevel@tonic-gate #define EMSCR_PRC 0x0400 3717c478bd9Sstevel@tonic-gate #define EMSCR_PRD 0x0800 3727c478bd9Sstevel@tonic-gate #define EMSCR_PRE 0x1000 3737c478bd9Sstevel@tonic-gate #define EMSCR_PRF 0x2000 3747c478bd9Sstevel@tonic-gate #define EMSCR_PRG 0x4000 3757c478bd9Sstevel@tonic-gate #define EMSCR_PRH 0x8000 3767c478bd9Sstevel@tonic-gate 3777c478bd9Sstevel@tonic-gate /* Extended Modem Line 1 DAC/ADC Sample Rate Register 40h - Optional */ 3787c478bd9Sstevel@tonic-gate #define AC97_EXTENDED_MODEM_LINE1_RATE_REGISTER 0x40 3797c478bd9Sstevel@tonic-gate 3807c478bd9Sstevel@tonic-gate /* Extended Modem Line 2 DAC/ADC Sample Rate Register 42h - Optional */ 3817c478bd9Sstevel@tonic-gate #define AC97_EXTENDED_MODEM_LINE2_RATE_REGISTER 0x42 3827c478bd9Sstevel@tonic-gate 3837c478bd9Sstevel@tonic-gate /* Extended Modem Handset Sample Rate Register 44h - Optional */ 3847c478bd9Sstevel@tonic-gate #define AC97_EXTENDED_MODEM_HANDSET_RATE_REGISTER 0x44 3857c478bd9Sstevel@tonic-gate 3867c478bd9Sstevel@tonic-gate /* Extended Modem Line 1 DAC/ADC Level Register 46h - Optional */ 3877c478bd9Sstevel@tonic-gate #define AC97_EXTENDED_MODEM_LINE1_LEVEL_REGISTER 0x46 3887c478bd9Sstevel@tonic-gate #define EML1LR_ADC_LEVEL_MASK 0x000f 3897c478bd9Sstevel@tonic-gate #define EML1LR_ADC_LEVEL_MUTE 0x0080 3907c478bd9Sstevel@tonic-gate #define EML1LR_DAC_LEVEL_MASK 0x0f00 3917c478bd9Sstevel@tonic-gate #define EML1LR_DAC_LEVEL_MUTE 0x8000 3927c478bd9Sstevel@tonic-gate 3937c478bd9Sstevel@tonic-gate /* Extended Modem Line 2 DAC/ADC Level Register 48h - Optional */ 3947c478bd9Sstevel@tonic-gate #define AC97_EXTENDED_MODEM_LINE2_LEVEL_REGISTER 0x48 3957c478bd9Sstevel@tonic-gate #define EML2LR_ADC_LEVEL_MASK 0x000f 3967c478bd9Sstevel@tonic-gate #define EML2LR_ADC_LEVEL_MUTE 0x0080 3977c478bd9Sstevel@tonic-gate #define EML2LR_DAC_LEVEL_MASK 0x0f00 3987c478bd9Sstevel@tonic-gate #define EML2LR_DAC_LEVEL_MUTE 0x8000 3997c478bd9Sstevel@tonic-gate 4007c478bd9Sstevel@tonic-gate /* Extended Modem Handset DAC/ADC Level Register 4ah - Optional */ 4017c478bd9Sstevel@tonic-gate #define AC97_EXTENDED_MODEM_HANDSET_LEVEL_REGISTER 0x4a 4027c478bd9Sstevel@tonic-gate #define EMHLR_ADC_LEVEL_MASK 0x000f 4037c478bd9Sstevel@tonic-gate #define EMHLR_ADC_LEVEL_MUTE 0x0080 4047c478bd9Sstevel@tonic-gate #define EMHLR_DAC_LEVEL_MASK 0x0f00 4057c478bd9Sstevel@tonic-gate #define EMHLR_DAC_LEVEL_MUTE 0x8000 4067c478bd9Sstevel@tonic-gate 4077c478bd9Sstevel@tonic-gate /* Extended Modem GPIO Pin Configuration Register 4ch - Optional */ 4087c478bd9Sstevel@tonic-gate #define AC97_EXTENDED_MODEM_GPIO_PIN_REGISTER 0x4c 4097c478bd9Sstevel@tonic-gate 4107c478bd9Sstevel@tonic-gate /* Extended Modem GPIO Pin Polarity Register 4eh - Optional */ 4117c478bd9Sstevel@tonic-gate #define AC97_EXTENDED_MODEM_GPIO_POLARITY_REGISTER 0x4e 4127c478bd9Sstevel@tonic-gate 4137c478bd9Sstevel@tonic-gate /* Extended Modem GPIO Pin Sticky Register 50h - Optional */ 4147c478bd9Sstevel@tonic-gate #define AC97_EXTENDED_MODEM_GPIO_STICKY_REGISTER 0x50 4157c478bd9Sstevel@tonic-gate 4167c478bd9Sstevel@tonic-gate /* Extended Modem GPIO Pin Wake-up Mask Register 52h - Optional */ 4177c478bd9Sstevel@tonic-gate #define AC97_EXTENDED_MODEM_GPIO_WAKEUP_REGISTER 0x52 4187c478bd9Sstevel@tonic-gate 4197c478bd9Sstevel@tonic-gate /* Extended Modem GPIO Pin Status Mask Register 54h - Optional */ 4207c478bd9Sstevel@tonic-gate #define AC97_EXTENDED_MODEM_GPIO_STATUS_REGISTER 0x54 4217c478bd9Sstevel@tonic-gate 4227c478bd9Sstevel@tonic-gate /* Extended Modem AFE Status and Control Register 56h - Optional */ 4237c478bd9Sstevel@tonic-gate #define AC97_EXTENDED_MODEM_AFE_STAT_CTRL_REGISTER 0x56 4247c478bd9Sstevel@tonic-gate #define EMAFESCR_L1B0 0x0001 4257c478bd9Sstevel@tonic-gate #define EMAFESCR_L1B1 0x0002 4267c478bd9Sstevel@tonic-gate #define EMAFESCR_L1B2 0x0004 4277c478bd9Sstevel@tonic-gate #define EMAFESCR_L2B0 0x0010 4287c478bd9Sstevel@tonic-gate #define EMAFESCR_L2B1 0x0020 4297c478bd9Sstevel@tonic-gate #define EMAFESCR_L2B2 0x0040 4307c478bd9Sstevel@tonic-gate #define EMAFESCR_HSB0 0x0100 4317c478bd9Sstevel@tonic-gate #define EMAFESCR_HSB1 0x0200 4327c478bd9Sstevel@tonic-gate #define EMAFESCR_HSB2 0x0400 4337c478bd9Sstevel@tonic-gate #define EMAFESCR_MLINK_ON 0x0000 4347c478bd9Sstevel@tonic-gate #define EMAFESCR_MLINK_OFF 0x1000 4357c478bd9Sstevel@tonic-gate #define EMAFESCR_CIDR 0x2000 4367c478bd9Sstevel@tonic-gate #define EMAFESCR_CID1 0x4000 4377c478bd9Sstevel@tonic-gate #define EMAFESCR_CID2 0x8000 4387c478bd9Sstevel@tonic-gate 43988447a05SGarrett D'Amore /* Vendor Reserved Registers 5ah - 7ah - Optional */ 44088447a05SGarrett D'Amore /* 44188447a05SGarrett D'Amore * Note that 60h - 6eh is also defined as the extended codec page area in 44288447a05SGarrett D'Amore * AC'97 r2.3. 44388447a05SGarrett D'Amore */ 4447c478bd9Sstevel@tonic-gate #define AC97_VENDOR_REGISTER_01 0x5a 4457c478bd9Sstevel@tonic-gate #define AC97_VENDOR_REGISTER_02 0x5c 4467c478bd9Sstevel@tonic-gate #define AC97_VENDOR_REGISTER_03 0x5e 4477c478bd9Sstevel@tonic-gate #define AC97_VENDOR_REGISTER_04 0x60 4487c478bd9Sstevel@tonic-gate #define AC97_VENDOR_REGISTER_05 0x62 4497c478bd9Sstevel@tonic-gate #define AC97_VENDOR_REGISTER_06 0x64 4507c478bd9Sstevel@tonic-gate #define AC97_VENDOR_REGISTER_07 0x66 4517c478bd9Sstevel@tonic-gate #define AC97_VENDOR_REGISTER_08 0x68 4527c478bd9Sstevel@tonic-gate #define AC97_VENDOR_REGISTER_09 0x6a 4537c478bd9Sstevel@tonic-gate #define AC97_VENDOR_REGISTER_10 0x6c 4547c478bd9Sstevel@tonic-gate #define AC97_VENDOR_REGISTER_11 0x6e 4557c478bd9Sstevel@tonic-gate #define AC97_VENDOR_REGISTER_12 0x70 4567c478bd9Sstevel@tonic-gate #define AC97_VENDOR_REGISTER_13 0x72 4577c478bd9Sstevel@tonic-gate #define AC97_VENDOR_REGISTER_14 0x74 4587c478bd9Sstevel@tonic-gate #define AC97_VENDOR_REGISTER_15 0x76 4597c478bd9Sstevel@tonic-gate #define AC97_VENDOR_REGISTER_16 0x78 4607c478bd9Sstevel@tonic-gate #define AC97_VENDOR_REGISTER_17 0x7a 4617c478bd9Sstevel@tonic-gate 46288447a05SGarrett D'Amore /* 46388447a05SGarrett D'Amore * Page 01 Extended Codec Registers 46488447a05SGarrett D'Amore */ 46588447a05SGarrett D'Amore #define AC97_PAGE01_CODEC_CLASS_REV_REGISTER 0x60 46688447a05SGarrett D'Amore #define AC97_PAGE01_PCI_SVID_REGISTER 0x62 46788447a05SGarrett D'Amore #define AC97_PAGE01_PCI_SID_REGISTER 0x64 46888447a05SGarrett D'Amore #define AC97_PAGE01_FUNCTION_SELECT_REGISTER 0x66 46988447a05SGarrett D'Amore #define AC97_PAGE01_FUNCTION_INFORMATION_REGISTER 0x68 47088447a05SGarrett D'Amore #define AC97_PAGE01_SENSE_DETAILS_REGISTER 0x6a 47188447a05SGarrett D'Amore #define AC97_PAGE01_DAC_SLOT_MAPPING_REGISTER 0x6c 47288447a05SGarrett D'Amore #define AC97_PAGE01_ADC_SLOT_MAPPING_REGISTER 0x6e 47388447a05SGarrett D'Amore 4747c478bd9Sstevel@tonic-gate /* Vendor ID1 Register 7ch */ 4757c478bd9Sstevel@tonic-gate #define AC97_VENDOR_ID1_REGISTER 0x7c 4767c478bd9Sstevel@tonic-gate #define VID1R_CHAR2_MASK 0x00ff 4777c478bd9Sstevel@tonic-gate #define VID1R_CHAR1_MASK 0xff00 4787c478bd9Sstevel@tonic-gate 4797c478bd9Sstevel@tonic-gate /* Vendor ID2 Register 7eh */ 4807c478bd9Sstevel@tonic-gate #define AC97_VENDOR_ID2_REGISTER 0x7e 4817c478bd9Sstevel@tonic-gate #define VID2R_REVISION_MASK 0x00ff 4827c478bd9Sstevel@tonic-gate #define VID2R_CHAR3_MASK 0xff00 4837c478bd9Sstevel@tonic-gate 48488447a05SGarrett D'Amore /* 48588447a05SGarrett D'Amore * Property names used by AC97. We should probably have a better way 48688447a05SGarrett D'Amore * of dealing with some of these. (LINEIN_FUNC and MIC_FUNC should really 48788447a05SGarrett D'Amore * be saved/restored with other global settings.) 48888447a05SGarrett D'Amore */ 48988447a05SGarrett D'Amore #define AC97_PROP_AMPLIFIER "ac97-amplifier" 49088447a05SGarrett D'Amore #define AC97_PROP_SPEAKER "ac97-speaker" 49188447a05SGarrett D'Amore #define AC97_PROP_MICBOOST "ac97-micboost" 49288447a05SGarrett D'Amore #define AC97_PROP_NO_HEADPHONE "ac97-no-headphone" 49388447a05SGarrett D'Amore #define AC97_PROP_NO_AUXOUT "ac97-no-auxout" 49488447a05SGarrett D'Amore #define AC97_PROP_NO_CDROM "ac97-no-cdrom" 49588447a05SGarrett D'Amore #define AC97_PROP_NO_VIDEO "ac97-no-video" 49688447a05SGarrett D'Amore #define AC97_PROP_NO_AUXIN "ac97-no-auxin" 49788447a05SGarrett D'Amore #define AC97_PROP_NO_MIC "ac97-no-mic" 49888447a05SGarrett D'Amore #define AC97_PROP_NO_LINEIN "ac97-no-linein" 49988447a05SGarrett D'Amore #define AC97_PROP_LINEIN_FUNC "ac97-linein-function" /* 1=linein, 2=surr */ 50088447a05SGarrett D'Amore #define AC97_PROP_MIC_FUNC "ac97-mic-function" /* 1=mic, 2=cen/lfe */ 50188447a05SGarrett D'Amore #define AC97_PROP_DOWNMIX "ac97-downmix" 50288447a05SGarrett D'Amore #define AC97_PROP_SPREAD "ac97-spread" 50388447a05SGarrett D'Amore 50488447a05SGarrett D'Amore /* 50588447a05SGarrett D'Amore * Known Codec vendors. 50688447a05SGarrett D'Amore */ 50788447a05SGarrett D'Amore #define AC97_VENDOR_ADS 0x41445300 /* Analog Devices */ 50888447a05SGarrett D'Amore #define AC97_VENDOR_AKM 0x414b4d00 /* Asahi Kasei */ 50988447a05SGarrett D'Amore #define AC97_VENDOR_ALC 0x414c4300 /* Realtek */ 51088447a05SGarrett D'Amore #define AC97_VENDOR_ALG 0x414c4700 /* Realtek */ 511*1cf80175SGarrett D'Amore #define AC97_VENDOR_CMI 0x434d4900 /* Cmedia */ 51288447a05SGarrett D'Amore #define AC97_VENDOR_CRY 0x43525900 /* Cirrus Logic */ 51388447a05SGarrett D'Amore #define AC97_VENDOR_CXT 0x43585400 /* Conexant */ 51488447a05SGarrett D'Amore #define AC97_VENDOR_EMC 0x454d4300 /* eMicro */ 51588447a05SGarrett D'Amore #define AC97_VENDOR_EV 0x000f8300 /* Ectiva */ 51688447a05SGarrett D'Amore #define AC97_VENDOR_ESS 0x45838300 /* ESS */ 517992413f4SGarrett D'Amore #define AC97_VENDOR_HRS 0x48525300 /* Intersil */ 51888447a05SGarrett D'Amore #define AC97_VENDOR_ICE 0x49434500 /* ICEnsemble */ 519992413f4SGarrett D'Amore #define AC97_VENDOR_ITE 0x49544500 /* ITE */ 520992413f4SGarrett D'Amore #define AC97_VENDOR_NSC 0x4e534300 /* National */ 521992413f4SGarrett D'Amore #define AC97_VENDOR_PSC 0x50534300 /* Philips */ 522992413f4SGarrett D'Amore #define AC97_VENDOR_SIL 0x53494c00 /* Silicon Labs */ 52388447a05SGarrett D'Amore #define AC97_VENDOR_ST 0x83847600 /* SigmaTel */ 52488447a05SGarrett D'Amore #define AC97_VENDOR_TRA 0x54524100 /* TriTech */ 525992413f4SGarrett D'Amore #define AC97_VENDOR_TXN 0x54584e00 /* TI */ 52688447a05SGarrett D'Amore #define AC97_VENDOR_VIA 0x56494100 /* VIA */ 52788447a05SGarrett D'Amore #define AC97_VENDOR_WML 0x574d4c00 /* Wolfson */ 52888447a05SGarrett D'Amore #define AC97_VENDOR_YMH 0x594d4800 /* Yamaha */ 52988447a05SGarrett D'Amore 53088447a05SGarrett D'Amore /* 53188447a05SGarrett D'Amore * Known Codec IDs. 53288447a05SGarrett D'Amore */ 53388447a05SGarrett D'Amore #define AC97_CODEC_AD1819B 0x41445303 53488447a05SGarrett D'Amore #define AC97_CODEC_AD1881 0x41445340 53588447a05SGarrett D'Amore #define AC97_CODEC_AD1881A 0x41445348 53688447a05SGarrett D'Amore #define AC97_CODEC_AD1885 0x41445360 53788447a05SGarrett D'Amore #define AC97_CODEC_AD1886 0x41445361 53888447a05SGarrett D'Amore #define AC97_CODEC_AD1887 0x41445362 53988447a05SGarrett D'Amore #define AC97_CODEC_AD1888 0x41445368 54088447a05SGarrett D'Amore #define AC97_CODEC_AD1980 0x41445370 54188447a05SGarrett D'Amore #define AC97_CODEC_AD1981A 0x41445371 54288447a05SGarrett D'Amore #define AC97_CODEC_AD1981 0x41445372 54388447a05SGarrett D'Amore #define AC97_CODEC_AD1981B 0x41445374 54488447a05SGarrett D'Amore #define AC97_CODEC_AD1985 0x41445375 54588447a05SGarrett D'Amore #define AC97_CODEC_AK4540 0x414b4d00 54688447a05SGarrett D'Amore #define AC97_CODEC_ALC100 0x414c4326 54788447a05SGarrett D'Amore #define AC97_CODEC_ALC200P 0x414c4710 54888447a05SGarrett D'Amore #define AC97_CODEC_ALC202 0x414c4740 54988447a05SGarrett D'Amore #define AC97_CODEC_ALC203 0x414c4770 55088447a05SGarrett D'Amore #define AC97_CODEC_ALC250 0x414c4750 55188447a05SGarrett D'Amore #define AC97_CODEC_ALC250_2 0x414c4752 55288447a05SGarrett D'Amore #define AC97_CODEC_ALC650 0x414c4720 55388447a05SGarrett D'Amore #define AC97_CODEC_ALC655 0x414c4760 55488447a05SGarrett D'Amore #define AC97_CODEC_ALC658 0x414c4780 55588447a05SGarrett D'Amore #define AC97_CODEC_ALC850 0x414c4790 55688447a05SGarrett D'Amore #define AC97_CODEC_CMI9738 0x434d4941 55788447a05SGarrett D'Amore #define AC97_CODEC_CMI9739 0x434d4961 55888447a05SGarrett D'Amore #define AC97_CODEC_CMI9780 0x434d4969 55988447a05SGarrett D'Amore #define AC97_CODEC_CMI9761 0x434d4978 56088447a05SGarrett D'Amore #define AC97_CODEC_CMI9761_2 0x434d4982 56188447a05SGarrett D'Amore #define AC97_CODEC_CMI9761_3 0x434d4983 56288447a05SGarrett D'Amore #define AC97_CODEC_CS4202 0x43525970 56388447a05SGarrett D'Amore #define AC97_CODEC_CS4205 0x43525950 56488447a05SGarrett D'Amore #define AC97_CODEC_CS4294 0x43525920 56588447a05SGarrett D'Amore #define AC97_CODEC_CS4297 0x43525900 56688447a05SGarrett D'Amore #define AC97_CODEC_CS4297A 0x43525910 56788447a05SGarrett D'Amore #define AC97_CODEC_CS4299 0x43525930 56888447a05SGarrett D'Amore #define AC97_CODEC_CX20468 0x43585428 56988447a05SGarrett D'Amore #define AC97_CODEC_CX20468_2 0x43585429 57088447a05SGarrett D'Amore #define AC97_CODEC_CX20468_21 0x43585430 57188447a05SGarrett D'Amore #define AC97_CODEC_EM28028 0x454d4328 57288447a05SGarrett D'Amore #define AC97_CODEC_ES1921 0x45838308 57388447a05SGarrett D'Amore #define AC97_CODEC_EV1938 0x000f8384 57488447a05SGarrett D'Amore #define AC97_CODEC_ICE1232 0x49434511 575992413f4SGarrett D'Amore #define AC97_CODEC_LM4550 0x4e534350 57688447a05SGarrett D'Amore #define AC97_CODEC_STAC9700 0x83847600 57788447a05SGarrett D'Amore #define AC97_CODEC_STAC9701 0x83847601 57888447a05SGarrett D'Amore #define AC97_CODEC_STAC9701_2 0xc250c250 57988447a05SGarrett D'Amore #define AC97_CODEC_STAC9704 0x83847604 58088447a05SGarrett D'Amore #define AC97_CODEC_STAC9705 0x83847605 58188447a05SGarrett D'Amore #define AC97_CODEC_STAC9708 0x83847608 58288447a05SGarrett D'Amore #define AC97_CODEC_STAC9721 0x83847609 58388447a05SGarrett D'Amore #define AC97_CODEC_STAC9744 0x83847644 58488447a05SGarrett D'Amore #define AC97_CODEC_STAC9750 0x83847650 58588447a05SGarrett D'Amore #define AC97_CODEC_STAC9752 0x83847652 58688447a05SGarrett D'Amore #define AC97_CODEC_STAC9756 0x83847656 58788447a05SGarrett D'Amore #define AC97_CODEC_STAC9758 0x83847658 58888447a05SGarrett D'Amore #define AC97_CODEC_STAC9766 0x83847666 58988447a05SGarrett D'Amore #define AC97_CODEC_TR28023 0x54524103 59088447a05SGarrett D'Amore #define AC97_CODEC_TR28023_2 0x54524123 59188447a05SGarrett D'Amore #define AC97_CODEC_TR28028 0x54524108 59288447a05SGarrett D'Amore #define AC97_CODEC_TR28028_2 0x54524128 59388447a05SGarrett D'Amore #define AC97_CODEC_VT1612A 0x56494161 59488447a05SGarrett D'Amore #define AC97_CODEC_VT1617A 0x56494170 59588447a05SGarrett D'Amore #define AC97_CODEC_VT1616 0x49434551 59688447a05SGarrett D'Amore #define AC97_CODEC_VT1616A 0x49434552 59788447a05SGarrett D'Amore #define AC97_CODEC_VT1618 0x56494182 59888447a05SGarrett D'Amore #define AC97_CODEC_WM9701A 0x574d4c00 59988447a05SGarrett D'Amore #define AC97_CODEC_WM9703 0x574d4c03 60088447a05SGarrett D'Amore #define AC97_CODEC_WM9704 0x574d4c04 60188447a05SGarrett D'Amore #define AC97_CODEC_YMF743 0x594d4800 60288447a05SGarrett D'Amore #define AC97_CODEC_YMF753 0x594d4803 60388447a05SGarrett D'Amore 60488447a05SGarrett D'Amore /* 60588447a05SGarrett D'Amore * Functions for drivers to interact with the common ac97 module. 60688447a05SGarrett D'Amore */ 60788447a05SGarrett D'Amore typedef struct ac97 ac97_t; 60888447a05SGarrett D'Amore typedef void (*ac97_wr_t)(void *, uint8_t, uint16_t); 60988447a05SGarrett D'Amore typedef uint16_t (*ac97_rd_t)(void *, uint8_t); 61033ab04abSGarrett D'Amore typedef struct ac97_ctrl ac97_ctrl_t; 61133ab04abSGarrett D'Amore typedef boolean_t (*ac97_ctrl_walk_t)(ac97_ctrl_t *, void *); 61288447a05SGarrett D'Amore 61333ab04abSGarrett D'Amore /* 61433ab04abSGarrett D'Amore * Old style initialization. The driver simply calls ac97_alloc() 61533ab04abSGarrett D'Amore * followed by ac97_init(). These interfaces should not be used in 61633ab04abSGarrett D'Amore * new drivers. 61733ab04abSGarrett D'Amore */ 61888447a05SGarrett D'Amore ac97_t *ac97_alloc(dev_info_t *, ac97_rd_t, ac97_wr_t, void *); 61988447a05SGarrett D'Amore int ac97_init(ac97_t *, audio_dev_t *); 62033ab04abSGarrett D'Amore 62133ab04abSGarrett D'Amore /* 62233ab04abSGarrett D'Amore * New style initialization. The driver will call ac97_allocate(), 62333ab04abSGarrett D'Amore * then it can call ac97_register_controls() to register controls. 62433ab04abSGarrett D'Amore * Or, if it doesn't want all controls registered, it can find 62533ab04abSGarrett D'Amore * controls with ac97_find_control(), and register them individually 62633ab04abSGarrett D'Amore * with ac97_register_control(). ac97_alloc() 62733ab04abSGarrett D'Amore * 62833ab04abSGarrett D'Amore * Note that adjusting the set of controls should only be performed 62933ab04abSGarrett D'Amore * while the driver is single threaded, during attach or detach 63033ab04abSGarrett D'Amore * processing. The AC'97 framework does not provide any locks 63133ab04abSGarrett D'Amore * surrounding its internal list of controls. Note however that 63233ab04abSGarrett D'Amore * changes to the controls made from within the framework (e.g. by 63333ab04abSGarrett D'Amore * someone accessing the control via the audio framework) are safe. 63433ab04abSGarrett D'Amore */ 63533ab04abSGarrett D'Amore ac97_t *ac97_allocate(audio_dev_t *, dev_info_t *, ac97_rd_t, ac97_wr_t, 63633ab04abSGarrett D'Amore void *); 63733ab04abSGarrett D'Amore void ac97_probe_controls(ac97_t *); 63833ab04abSGarrett D'Amore void ac97_register_controls(ac97_t *); 63933ab04abSGarrett D'Amore void ac97_unregister_controls(ac97_t *); 64033ab04abSGarrett D'Amore 64133ab04abSGarrett D'Amore void ac97_walk_controls(ac97_t *, ac97_ctrl_walk_t, void *); 64233ab04abSGarrett D'Amore ac97_ctrl_t *ac97_control_find(ac97_t *, const char *); 64333ab04abSGarrett D'Amore void ac97_control_register(ac97_ctrl_t *); 64433ab04abSGarrett D'Amore void ac97_control_unregister(ac97_ctrl_t *); 64533ab04abSGarrett D'Amore void ac97_control_remove(ac97_ctrl_t *); 64633ab04abSGarrett D'Amore const char *ac97_control_name(ac97_ctrl_t *); 64733ab04abSGarrett D'Amore const audio_ctrl_desc_t *ac97_control_desc(ac97_ctrl_t *); 64833ab04abSGarrett D'Amore int ac97_control_get(ac97_ctrl_t *, uint64_t *); 64933ab04abSGarrett D'Amore int ac97_control_set(ac97_ctrl_t *, uint64_t); 65033ab04abSGarrett D'Amore 65133ab04abSGarrett D'Amore /* 65233ab04abSGarrett D'Amore * Bits common to both new style and old style initialization. 65333ab04abSGarrett D'Amore */ 65433ab04abSGarrett D'Amore void ac97_free(ac97_t *); 65588447a05SGarrett D'Amore void ac97_reset(ac97_t *); 6560e7a77f3SGarrett D'Amore int ac97_num_channels(ac97_t *); 65788447a05SGarrett D'Amore 6587c478bd9Sstevel@tonic-gate #endif /* _KERNEL */ 6597c478bd9Sstevel@tonic-gate 6607c478bd9Sstevel@tonic-gate #ifdef __cplusplus 6617c478bd9Sstevel@tonic-gate } 6627c478bd9Sstevel@tonic-gate #endif 6637c478bd9Sstevel@tonic-gate 6647c478bd9Sstevel@tonic-gate #endif /* _SYS_AC97_H */ 665