patch-2_6_7-vs1_9_1_12
[linux-2.6.git] / sound / pci / ac97 / ac97_local.h
1 /*
2  *  Copyright (c) by Jaroslav Kysela <perex@suse.cz>
3  *  Universal interface for Audio Codec '97
4  *
5  *  For more details look to AC '97 component specification revision 2.2
6  *  by Intel Corporation (http://developer.intel.com).
7  *
8  *
9  *   This program is free software; you can redistribute it and/or modify
10  *   it under the terms of the GNU General Public License as published by
11  *   the Free Software Foundation; either version 2 of the License, or
12  *   (at your option) any later version.
13  *
14  *   This program is distributed in the hope that it will be useful,
15  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  *   GNU General Public License for more details.
18  *
19  *   You should have received a copy of the GNU General Public License
20  *   along with this program; if not, write to the Free Software
21  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
22  *
23  */
24
25 #define AC97_SINGLE_VALUE(reg,shift,mask,invert) ((reg) | ((shift) << 8) | ((mask) << 16) | ((invert) << 24))
26 #define AC97_SINGLE(xname, reg, shift, mask, invert) \
27 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .info = snd_ac97_info_single, \
28   .get = snd_ac97_get_single, .put = snd_ac97_put_single, \
29   .private_value =  AC97_SINGLE_VALUE(reg, shift, mask, invert) }
30
31 /* ac97_codec.c */
32 extern const char *snd_ac97_stereo_enhancements[];
33 extern const snd_kcontrol_new_t snd_ac97_controls_3d[];
34 extern const snd_kcontrol_new_t snd_ac97_controls_spdif[];
35 snd_kcontrol_t *snd_ac97_cnew(const snd_kcontrol_new_t *_template, ac97_t * ac97);
36 void snd_ac97_get_name(ac97_t *ac97, unsigned int id, char *name, int modem);
37 int snd_ac97_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo);
38 int snd_ac97_get_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol);
39 int snd_ac97_put_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol);
40 int snd_ac97_try_bit(ac97_t * ac97, int reg, int bit);
41 int snd_ac97_remove_ctl(ac97_t *ac97, const char *name);
42 int snd_ac97_rename_ctl(ac97_t *ac97, const char *src, const char *dst);
43 int snd_ac97_swap_ctl(ac97_t *ac97, const char *s1, const char *s2);
44
45 /* ac97_proc.c */
46 void snd_ac97_bus_proc_init(ac97_bus_t * ac97);
47 void snd_ac97_bus_proc_done(ac97_bus_t * ac97);
48 void snd_ac97_proc_init(ac97_t * ac97);
49 void snd_ac97_proc_done(ac97_t * ac97);