aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ac97/ac97_local.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /sound/pci/ac97/ac97_local.h
Linux-2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'sound/pci/ac97/ac97_local.h')
-rw-r--r--sound/pci/ac97/ac97_local.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/sound/pci/ac97/ac97_local.h b/sound/pci/ac97/ac97_local.h
new file mode 100644
index 000000000000..536a4d4793af
--- /dev/null
+++ b/sound/pci/ac97/ac97_local.h
@@ -0,0 +1,83 @@
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) | ((shift) << 12) | ((mask) << 16) | ((invert) << 24))
26#define AC97_PAGE_SINGLE_VALUE(reg,shift,mask,invert,page) (AC97_SINGLE_VALUE(reg,shift,mask,invert) | (1<<25) | ((page) << 26))
27#define AC97_SINGLE(xname, reg, shift, mask, invert) \
28{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .info = snd_ac97_info_volsw, \
29 .get = snd_ac97_get_volsw, .put = snd_ac97_put_volsw, \
30 .private_value = AC97_SINGLE_VALUE(reg, shift, mask, invert) }
31#define AC97_PAGE_SINGLE(xname, reg, shift, mask, invert, page) \
32{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .info = snd_ac97_info_volsw, \
33 .get = snd_ac97_get_volsw, .put = snd_ac97_put_volsw, \
34 .private_value = AC97_PAGE_SINGLE_VALUE(reg, shift, mask, invert, page) }
35#define AC97_DOUBLE(xname, reg, shift_left, shift_right, mask, invert) \
36{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), .info = snd_ac97_info_volsw, \
37 .get = snd_ac97_get_volsw, .put = snd_ac97_put_volsw, \
38 .private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) | ((mask) << 16) | ((invert) << 24) }
39#define AC97_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, xtexts) \
40{ .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \
41 .mask = xmask, .texts = xtexts }
42#define AC97_ENUM_SINGLE(xreg, xshift, xmask, xtexts) \
43 AC97_ENUM_DOUBLE(xreg, xshift, xshift, xmask, xtexts)
44#define AC97_ENUM(xname, xenum) \
45{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .info = snd_ac97_info_enum_double, \
46 .get = snd_ac97_get_enum_double, .put = snd_ac97_put_enum_double, \
47 .private_value = (unsigned long)&xenum }
48
49/* ac97_codec.c */
50extern const char *snd_ac97_stereo_enhancements[];
51extern const snd_kcontrol_new_t snd_ac97_controls_3d[];
52extern const snd_kcontrol_new_t snd_ac97_controls_spdif[];
53snd_kcontrol_t *snd_ac97_cnew(const snd_kcontrol_new_t *_template, ac97_t * ac97);
54void snd_ac97_get_name(ac97_t *ac97, unsigned int id, char *name, int modem);
55int snd_ac97_info_volsw(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo);
56int snd_ac97_get_volsw(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol);
57int snd_ac97_put_volsw(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol);
58int snd_ac97_try_bit(ac97_t * ac97, int reg, int bit);
59int snd_ac97_remove_ctl(ac97_t *ac97, const char *name, const char *suffix);
60int snd_ac97_rename_ctl(ac97_t *ac97, const char *src, const char *dst, const char *suffix);
61int snd_ac97_swap_ctl(ac97_t *ac97, const char *s1, const char *s2, const char *suffix);
62void snd_ac97_rename_vol_ctl(ac97_t *ac97, const char *src, const char *dst);
63void snd_ac97_restore_status(ac97_t *ac97);
64void snd_ac97_restore_iec958(ac97_t *ac97);
65int snd_ac97_info_enum_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo);
66int snd_ac97_get_enum_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol);
67int snd_ac97_put_enum_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol);
68
69int snd_ac97_update_bits_nolock(ac97_t *ac97, unsigned short reg,
70 unsigned short mask, unsigned short value);
71
72/* ac97_proc.c */
73#ifdef CONFIG_PROC_FS
74void snd_ac97_bus_proc_init(ac97_bus_t * ac97);
75void snd_ac97_bus_proc_done(ac97_bus_t * ac97);
76void snd_ac97_proc_init(ac97_t * ac97);
77void snd_ac97_proc_done(ac97_t * ac97);
78#else
79#define snd_ac97_bus_proc_init(ac97_bus_t) do { } while (0)
80#define snd_ac97_bus_proc_done(ac97_bus_t) do { } while (0)
81#define snd_ac97_proc_init(ac97_t) do { } while (0)
82#define snd_ac97_proc_done(ac97_t) do { } while (0)
83#endif