~ubuntu-branches/ubuntu/oneiric/oss4/oneiric-proposed

« back to all changes in this revision

Viewing changes to kernel/framework/include/ac97.h

  • Committer: Bazaar Package Importer
  • Author(s): Stefano Rivera
  • Date: 2011-06-16 20:37:48 UTC
  • mfrom: (5.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110616203748-jbrxik6ql33z54co
Tags: 4.2-build2004-1ubuntu1
* Merge from Debian unstable.
  - Supports our current kernel (LP: #746048)
  Remaining changes:
  - debian/oss4-dkms.dkms.in: s/source/build/ in Kernel headers paths.
* ld-as-needed.patch: Re-order CC arguments to enable building with ld
  --as-needed (LP: #770972)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Purpose: Definitions for the AC97 codec support library
 
3
 *
 
4
 * This header file must be included by all low level drivers that support
 
5
 * AC97 based devices.
 
6
 */
 
7
/*
 
8
 *
 
9
 * This file is part of Open Sound System.
 
10
 *
 
11
 * Copyright (C) 4Front Technologies 1996-2008.
 
12
 *
 
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.
 
16
 *
 
17
 */
 
18
 
 
19
typedef int (*ac97_ext_ioctl) (int dev, int audiodev, unsigned int cmd,
 
20
                               int arg);
 
21
typedef struct
 
22
{
 
23
  int is_ok;
 
24
  char name[30];
 
25
  void *host_parms;
 
26
  oss_device_t *osdev;
 
27
  ac97_readfunc_t read;
 
28
  ac97_writefunc_t write;
 
29
  unsigned short ac97_id;       /* Register 0x00 */
 
30
  int mixer_dev;
 
31
 
 
32
  /* Detected mixer capabilities */
 
33
  int mastervol_bits;
 
34
  int pcmvol_bits;
 
35
  int rearvol_bits;
 
36
  int centervol_bits;
 
37
  int sidevol_bits;
 
38
  int auxvol_bits;
 
39
  int enh_bits;                 /* number of bits for the 3D enhance */
 
40
  int micboost;                 /* 20db Mic boost on/off */
 
41
  int *levels;
 
42
  int recdevs;
 
43
  ac97_ext_ioctl overrides[SOUND_MIXER_NRDEVICES];
 
44
 
 
45
  int devmask;
 
46
  int recmask;
 
47
  int var_rate_support;
 
48
  int fixed_rate;
 
49
  int playrate_support;         /* ac97 2.4 codec */
 
50
#define PLAY_2CHAN              0
 
51
#define PLAY_4CHAN              1
 
52
#define PLAY_6CHAN              2
 
53
#define PLAY_8CHAN              3
 
54
  int spdifout_support;
 
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 */
 
63
  int spdif_slot;
 
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
 
68
  int spdifin_support;
 
69
#define ALC_SPDIFIN             1       /* Avance Logic SPDIF Input */
 
70
#define CMI_SPDIFIN             2       /* CMedia SPDIF Input */
 
71
 
 
72
  int mixer_ext;
 
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
 
80
 
 
81
  int enh_3d;
 
82
/*
 
83
 * From AC97 register 0x00:
 
84
 *
 
85
 *      0x00=No enhancement
 
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
 
94
 *      0x0b=AKM 3D Audio
 
95
 *      0x0c=Aureal Stereo Enhancement
 
96
 *      0x0d=Aztech 3D Audio Enhancement
 
97
 *      0x0e=Binaura 3D Audio Enhancement
 
98
 *      0x0f=ESS Technology
 
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)
 
106
 */
 
107
  int extmixlevels[10];         /* volume controls for Rear/Center/additional chans */
 
108
#define CENTER_VOL              0
 
109
#define REAR_VOL                1
 
110
#define SIDE_VOL                2
 
111
  mixer_create_controls_t client_mixer_init;
 
112
}
 
113
ac97_devc;
 
114
 
 
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);
 
131
 
 
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);
 
138
 
 
139
/* AC97 V2.2 Mixer extensions */
 
140
#define VOL_CENTER              1
 
141
#define VOL_REAR                2
 
142
#define VOL_SIDE                3
 
143
#define CENTER2MIC              4
 
144
#define REAR2LINE               5
 
145
#define SPREAD                  6
 
146
#define MICBOOST                7
 
147
#define JACKSENSE               8
 
148
#define DOWNMIX_LFE             9
 
149
#define DOWNMIX_REAR            10
 
150
 
 
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
 
162
 
 
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