1*4882a593Smuzhiyun /* 2*4882a593Smuzhiyun * This file is subject to the terms and conditions of the GNU General Public 3*4882a593Smuzhiyun * License. See the file "COPYING" in the main directory of this archive 4*4882a593Smuzhiyun * for more details. 5*4882a593Smuzhiyun * 6*4882a593Smuzhiyun * Copyright 2003 Vivien Chappelier <vivien.chappelier@linux-mips.org> 7*4882a593Smuzhiyun * Copyright 2008 Thomas Bogendoerfer <tsbogend@franken.de> 8*4882a593Smuzhiyun */ 9*4882a593Smuzhiyun 10*4882a593Smuzhiyun #ifndef __SOUND_AD1843_H 11*4882a593Smuzhiyun #define __SOUND_AD1843_H 12*4882a593Smuzhiyun 13*4882a593Smuzhiyun struct snd_ad1843 { 14*4882a593Smuzhiyun void *chip; 15*4882a593Smuzhiyun int (*read)(void *chip, int reg); 16*4882a593Smuzhiyun int (*write)(void *chip, int reg, int val); 17*4882a593Smuzhiyun }; 18*4882a593Smuzhiyun 19*4882a593Smuzhiyun #define AD1843_GAIN_RECLEV 0 20*4882a593Smuzhiyun #define AD1843_GAIN_LINE 1 21*4882a593Smuzhiyun #define AD1843_GAIN_LINE_2 2 22*4882a593Smuzhiyun #define AD1843_GAIN_MIC 3 23*4882a593Smuzhiyun #define AD1843_GAIN_PCM_0 4 24*4882a593Smuzhiyun #define AD1843_GAIN_PCM_1 5 25*4882a593Smuzhiyun #define AD1843_GAIN_SIZE (AD1843_GAIN_PCM_1+1) 26*4882a593Smuzhiyun 27*4882a593Smuzhiyun int ad1843_get_gain_max(struct snd_ad1843 *ad1843, int id); 28*4882a593Smuzhiyun int ad1843_get_gain(struct snd_ad1843 *ad1843, int id); 29*4882a593Smuzhiyun int ad1843_set_gain(struct snd_ad1843 *ad1843, int id, int newval); 30*4882a593Smuzhiyun int ad1843_get_recsrc(struct snd_ad1843 *ad1843); 31*4882a593Smuzhiyun int ad1843_set_recsrc(struct snd_ad1843 *ad1843, int newsrc); 32*4882a593Smuzhiyun void ad1843_setup_dac(struct snd_ad1843 *ad1843, 33*4882a593Smuzhiyun unsigned int id, 34*4882a593Smuzhiyun unsigned int framerate, 35*4882a593Smuzhiyun snd_pcm_format_t fmt, 36*4882a593Smuzhiyun unsigned int channels); 37*4882a593Smuzhiyun void ad1843_shutdown_dac(struct snd_ad1843 *ad1843, 38*4882a593Smuzhiyun unsigned int id); 39*4882a593Smuzhiyun void ad1843_setup_adc(struct snd_ad1843 *ad1843, 40*4882a593Smuzhiyun unsigned int framerate, 41*4882a593Smuzhiyun snd_pcm_format_t fmt, 42*4882a593Smuzhiyun unsigned int channels); 43*4882a593Smuzhiyun void ad1843_shutdown_adc(struct snd_ad1843 *ad1843); 44*4882a593Smuzhiyun int ad1843_init(struct snd_ad1843 *ad1843); 45*4882a593Smuzhiyun 46*4882a593Smuzhiyun #endif /* __SOUND_AD1843_H */ 47