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

TOMOYO Linux Cross Reference
Linux/include/sound/ak4xxx-adda.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ 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 #ifndef __SOUND_AK4XXX_ADDA_H
  3 #define __SOUND_AK4XXX_ADDA_H
  4 
  5 /*
  6  *   ALSA driver for AK4524 / AK4528 / AK4529 / AK4355 / AK4381
  7  *   AD and DA converters
  8  *
  9  *      Copyright (c) 2000 Jaroslav Kysela <perex@perex.cz>
 10  */      
 11 
 12 #ifndef AK4XXX_MAX_CHIPS
 13 #define AK4XXX_MAX_CHIPS        4
 14 #endif
 15 
 16 struct snd_akm4xxx;
 17 
 18 struct snd_ak4xxx_ops {
 19         void (*lock)(struct snd_akm4xxx *ak, int chip);
 20         void (*unlock)(struct snd_akm4xxx *ak, int chip);
 21         void (*write)(struct snd_akm4xxx *ak, int chip, unsigned char reg,
 22                       unsigned char val);
 23         void (*set_rate_val)(struct snd_akm4xxx *ak, unsigned int rate);
 24 };
 25 
 26 #define AK4XXX_IMAGE_SIZE       (AK4XXX_MAX_CHIPS * 16) /* 64 bytes */
 27 
 28 /* DAC label and channels */
 29 struct snd_akm4xxx_dac_channel {
 30         char *name;             /* mixer volume name */
 31         unsigned int num_channels;
 32         char *switch_name;              /* mixer switch*/
 33 };
 34 
 35 /* ADC labels and channels */
 36 struct snd_akm4xxx_adc_channel {
 37         char *name;             /* capture gain volume label */
 38         char *switch_name;      /* capture switch */
 39         unsigned int num_channels;
 40         char *selector_name;    /* capture source select label */
 41         const char **input_names; /* capture source names (NULL terminated) */
 42 };
 43 
 44 struct snd_akm4xxx {
 45         struct snd_card *card;
 46         unsigned int num_adcs;                  /* AK4524 or AK4528 ADCs */
 47         unsigned int num_dacs;                  /* AK4524 or AK4528 DACs */
 48         unsigned char images[AK4XXX_IMAGE_SIZE]; /* saved register image */
 49         unsigned char volumes[AK4XXX_IMAGE_SIZE]; /* saved volume values */
 50         unsigned long private_value[AK4XXX_MAX_CHIPS];  /* helper for driver */
 51         void *private_data[AK4XXX_MAX_CHIPS];           /* helper for driver */
 52         /* template should fill the following fields */
 53         unsigned int idx_offset;                /* control index offset */
 54         enum {
 55                 SND_AK4524, SND_AK4528, SND_AK4529,
 56                 SND_AK4355, SND_AK4358, SND_AK4381,
 57                 SND_AK5365, SND_AK4620,
 58         } type;
 59 
 60         /* (array) information of combined codecs */
 61         const struct snd_akm4xxx_dac_channel *dac_info;
 62         const struct snd_akm4xxx_adc_channel *adc_info;
 63 
 64         struct snd_ak4xxx_ops ops;
 65         unsigned int num_chips;
 66         unsigned int total_regs;
 67         const char *name;
 68 };
 69 
 70 void snd_akm4xxx_write(struct snd_akm4xxx *ak, int chip, unsigned char reg,
 71                        unsigned char val);
 72 void snd_akm4xxx_reset(struct snd_akm4xxx *ak, int state);
 73 void snd_akm4xxx_init(struct snd_akm4xxx *ak);
 74 int snd_akm4xxx_build_controls(struct snd_akm4xxx *ak);
 75 
 76 #define snd_akm4xxx_get(ak,chip,reg) \
 77         (ak)->images[(chip) * 16 + (reg)]
 78 #define snd_akm4xxx_set(ak,chip,reg,val) \
 79         ((ak)->images[(chip) * 16 + (reg)] = (val))
 80 #define snd_akm4xxx_get_vol(ak,chip,reg) \
 81         (ak)->volumes[(chip) * 16 + (reg)]
 82 #define snd_akm4xxx_set_vol(ak,chip,reg,val) \
 83         ((ak)->volumes[(chip) * 16 + (reg)] = (val))
 84 
 85 #endif /* __SOUND_AK4XXX_ADDA_H */
 86 

~ [ 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