~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/sound/pci/ac97/ac97_patch.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 /*
  3  *  Copyright (c) by Jaroslav Kysela <perex@perex.cz>
  4  *  Universal interface for Audio Codec '97
  5  *
  6  *  For more details look to AC '97 component specification revision 2.2
  7  *  by Intel Corporation (http://developer.intel.com).
  8  */
  9 
 10 #define AC97_SINGLE_VALUE(reg,shift,mask,invert) \
 11         ((reg) | ((shift) << 8) | ((shift) << 12) | ((mask) << 16) | \
 12          ((invert) << 24))
 13 #define AC97_PAGE_SINGLE_VALUE(reg,shift,mask,invert,page) \
 14         (AC97_SINGLE_VALUE(reg,shift,mask,invert) | (1<<25) | ((page) << 26))
 15 #define AC97_SINGLE(xname, reg, shift, mask, invert) \
 16 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
 17   .info = snd_ac97_info_volsw,          \
 18   .get = snd_ac97_get_volsw, .put = snd_ac97_put_volsw, \
 19   .private_value =  AC97_SINGLE_VALUE(reg, shift, mask, invert) }
 20 #define AC97_PAGE_SINGLE(xname, reg, shift, mask, invert, page)         \
 21 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
 22   .info = snd_ac97_info_volsw,          \
 23   .get = snd_ac97_get_volsw, .put = snd_ac97_put_volsw, \
 24   .private_value =  AC97_PAGE_SINGLE_VALUE(reg, shift, mask, invert, page) }
 25 #define AC97_DOUBLE(xname, reg, shift_left, shift_right, mask, invert) \
 26 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
 27   .info = snd_ac97_info_volsw,          \
 28   .get = snd_ac97_get_volsw, .put = snd_ac97_put_volsw, \
 29   .private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) | ((mask) << 16) | ((invert) << 24) }
 30 
 31 /* enum control */
 32 struct ac97_enum {
 33         unsigned char reg;
 34         unsigned char shift_l;
 35         unsigned char shift_r;
 36         unsigned short mask;
 37         const char * const *texts;
 38 };
 39 
 40 #define AC97_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, xtexts) \
 41 { .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \
 42   .mask = xmask, .texts = xtexts }
 43 #define AC97_ENUM_SINGLE(xreg, xshift, xmask, xtexts) \
 44         AC97_ENUM_DOUBLE(xreg, xshift, xshift, xmask, xtexts)
 45 #define AC97_ENUM(xname, xenum) \
 46 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
 47   .info = snd_ac97_info_enum_double,                \
 48   .get = snd_ac97_get_enum_double, .put = snd_ac97_put_enum_double, \
 49   .private_value = (unsigned long)&xenum }
 50 
 51 /* ac97_codec.c */
 52 static const struct snd_kcontrol_new snd_ac97_controls_3d[];
 53 static const struct snd_kcontrol_new snd_ac97_controls_spdif[];
 54 static struct snd_kcontrol *snd_ac97_cnew(const struct snd_kcontrol_new *_template,
 55                                           struct snd_ac97 * ac97);
 56 static int snd_ac97_info_volsw(struct snd_kcontrol *kcontrol,
 57                                struct snd_ctl_elem_info *uinfo);
 58 static int snd_ac97_get_volsw(struct snd_kcontrol *kcontrol,
 59                               struct snd_ctl_elem_value *ucontrol);
 60 static int snd_ac97_put_volsw(struct snd_kcontrol *kcontrol,
 61                               struct snd_ctl_elem_value *ucontrol);
 62 static int snd_ac97_try_bit(struct snd_ac97 * ac97, int reg, int bit);
 63 static int snd_ac97_remove_ctl(struct snd_ac97 *ac97, const char *name,
 64                                const char *suffix);
 65 static int snd_ac97_rename_ctl(struct snd_ac97 *ac97, const char *src,
 66                                const char *dst, const char *suffix);
 67 static int snd_ac97_swap_ctl(struct snd_ac97 *ac97, const char *s1,
 68                              const char *s2, const char *suffix);
 69 static void snd_ac97_rename_vol_ctl(struct snd_ac97 *ac97, const char *src,
 70                                     const char *dst);
 71 #ifdef CONFIG_PM
 72 static void snd_ac97_restore_status(struct snd_ac97 *ac97);
 73 static void snd_ac97_restore_iec958(struct snd_ac97 *ac97);
 74 #endif
 75 static int snd_ac97_info_enum_double(struct snd_kcontrol *kcontrol,
 76                                      struct snd_ctl_elem_info *uinfo);
 77 static int snd_ac97_get_enum_double(struct snd_kcontrol *kcontrol,
 78                                     struct snd_ctl_elem_value *ucontrol);
 79 static int snd_ac97_put_enum_double(struct snd_kcontrol *kcontrol,
 80                                     struct snd_ctl_elem_value *ucontrol);
 81 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php