2
* Purpose: Definitions for the AC97 codec support library
4
* This header file must be included by all low level drivers that support
9
* This file is part of Open Sound System.
11
* Copyright (C) 4Front Technologies 1996-2008.
13
* This this source file is released under GPL v2 license (no other versions).
14
* See the COPYING file included in the main directory of this source
15
* distribution for the license terms and conditions.
19
typedef int (*ac97_ext_ioctl) (int dev, int audiodev, unsigned int cmd,
28
ac97_writefunc_t write;
29
unsigned short ac97_id; /* Register 0x00 */
32
/* Detected mixer capabilities */
39
int enh_bits; /* number of bits for the 3D enhance */
40
int micboost; /* 20db Mic boost on/off */
43
ac97_ext_ioctl overrides[SOUND_MIXER_NRDEVICES];
49
int playrate_support; /* ac97 2.4 codec */
55
#define CS_SPDIFOUT 1 /* Cirrus Logic */
56
#define AD_SPDIFOUT 2 /* Analog Devices */
57
#define STAC_SPDIFOUT 3 /* Sigmatel */
58
#define ALC_SPDIFOUT 4 /* Avance Logic */
59
#define VIA_SPDIFOUT 5 /* VIA Technologies */
60
#define CMI_SPDIFOUT 6 /* CMedia */
61
#define YMF_SPDIFOUT 7 /* Yamaha */
62
#define CX_SPDIFOUT 8 /* Conexant */
64
#define SPDIF_SLOT34 0x00 /*slot3/4 = bits 5/6 = 0 */
65
#define SPDIF_SLOT78 0x10
66
#define SPDIF_SLOT69 0x20
67
#define SPDIF_SLOT1011 0x30
69
#define ALC_SPDIFIN 1 /* Avance Logic SPDIF Input */
70
#define CMI_SPDIFIN 2 /* CMedia SPDIF Input */
73
#define ALC650_MIXER_EXT 1
74
#define AD1980_MIXER_EXT 2
75
#define VIA1616_MIXER_EXT 3
76
#define CMI9739_MIXER_EXT 4
77
#define CMI9780_MIXER_EXT 5
78
#define STAC9758_MIXER_EXT 6
79
#define WM9704_MIXER_EXT 7
83
* From AC97 register 0x00:
86
* 0x01=Analog Devices Phat Stereo
87
* 0x02=Creative Stereo Enhancement
88
* 0x03=National Semiconductor 3D Stereo Enhancement
89
* 0x04=Yamaha Ymersion
90
* 0x06=Crystal 3D Stereo Enhancement
91
* 0x07=Qsound QXpander
92
* 0x08=Spatializer 3D Stereo Enhancement
93
* 0x09=SRS 3D Stereo Enhancement
95
* 0x0c=Aureal Stereo Enhancement
96
* 0x0d=Aztech 3D Audio Enhancement
97
* 0x0e=Binaura 3D Audio Enhancement
99
* 0x10=Harman International VMAx
100
* 0x11=NVidea 3D Stereo Enhancement
101
* 0x12=Philips Incredible Sound
102
* 0x13=Texas Instruments 3D Stereo Enhancement
103
* 0x14=VLSI Technology 3D Stereo Enhancement
104
* 0x18=Wolfson Analoque 3D stereo enhancement
105
* 0x1a=Sigmatel 3D Stereo enhancement (SS3D)
107
int extmixlevels[10]; /* volume controls for Rear/Center/additional chans */
111
mixer_create_controls_t client_mixer_init;
115
extern int ac97_install (ac97_devc * devc, char *name, ac97_readfunc_t readfn,
116
ac97_writefunc_t writefn, void *hostparms,
117
oss_device_t * osdev);
118
#define AC97_INVERTED 0x1
119
#define AC97_FORCE_SENSE 0x2
120
extern int ac97_install_full (ac97_devc * devc, char *name,
121
ac97_readfunc_t readfn, ac97_writefunc_t writefn,
122
void *hostparms, oss_device_t * osdev, int flags);
123
extern int ac97_init_ext (int dev, ac97_devc * devc,
124
mixer_create_controls_t func, int nextra);
125
extern int ac97_varrate (ac97_devc * devc);
126
extern int ac97_recrate (ac97_devc * devc, int srate);
127
extern int ac97_playrate (ac97_devc * devc, int srate);
128
extern void ac97_remove_control (ac97_devc * devc, int mask, int level);
129
extern void ac97_override_control (ac97_devc * devc, int ctrl,
130
ac97_ext_ioctl func, int level);
132
/* AC97 V2.2 mixer functions */
133
extern int ac97_spdifin_ctl (int dev, int ctrl, unsigned int cmd, int value);
134
extern int ac97_spdifout_ctl (int dev, int ctrl, unsigned int cmd, int value);
135
extern void ac97_spdif_setup (int dev, int speed, int bits);
136
extern int ac97_mixext_ctl (int dev, int ctrl, unsigned int cmd, int value);
137
extern int ac97_mixer_set (ac97_devc * devc, int dev, int value);
139
/* AC97 V2.2 Mixer extensions */
148
#define DOWNMIX_LFE 9
149
#define DOWNMIX_REAR 10
151
/* SPDIF OUT Mixer Register Definitions */
152
#define SPDIFOUT_ENABLE 1
153
#define SPDIFOUT_PRO 2
154
#define SPDIFOUT_AUDIO 3
155
#define SPDIFOUT_COPY 4
156
#define SPDIFOUT_PREEMPH 5
157
#define SPDIFOUT_CATEGORY 6
158
#define SPDIFOUT_GENERATION 7
159
#define SPDIFOUT_RATE 8
160
#define SPDIFOUT_VBIT 9
161
#define SPDIFOUT_ADC 10
163
/* SPDIF IN Mixer register Definitions */
164
#define SPDIFIN_ENABLE 1
165
#define SPDIFIN_PRO 2
166
#define SPDIFIN_AUDIO 3
167
#define SPDIFIN_COPY 4
168
#define SPDIFIN_PREEMPH 5
169
#define SPDIFIN_MODE 6
170
#define SPDIFIN_CATEGORY 7
171
#define SPDIFIN_GENERATION 8
172
#define SPDIFIN_SOURCE 9
173
#define SPDIFIN_CHAN 10
174
#define SPDIFIN_RATE 11
175
#define SPDIFIN_CLOCK 12
176
#define SPDIFIN_SIGNAL 13
177
#define SPDIFIN_VBIT 14
178
#define SPDIFIN_MON 15
179
#define SPDIFIN_LOOP 16