162306a36Sopenharmony_ci/*
262306a36Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public
362306a36Sopenharmony_ci * License.  See the file "COPYING" in the main directory of this archive
462306a36Sopenharmony_ci * for more details.
562306a36Sopenharmony_ci *
662306a36Sopenharmony_ci * Copyright 2003 Vivien Chappelier <vivien.chappelier@linux-mips.org>
762306a36Sopenharmony_ci * Copyright 2008 Thomas Bogendoerfer <tsbogend@franken.de>
862306a36Sopenharmony_ci */
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ci#ifndef __SOUND_AD1843_H
1162306a36Sopenharmony_ci#define __SOUND_AD1843_H
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_cistruct snd_ad1843 {
1462306a36Sopenharmony_ci	void *chip;
1562306a36Sopenharmony_ci	int (*read)(void *chip, int reg);
1662306a36Sopenharmony_ci	int (*write)(void *chip, int reg, int val);
1762306a36Sopenharmony_ci};
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci#define AD1843_GAIN_RECLEV 0
2062306a36Sopenharmony_ci#define AD1843_GAIN_LINE   1
2162306a36Sopenharmony_ci#define AD1843_GAIN_LINE_2 2
2262306a36Sopenharmony_ci#define AD1843_GAIN_MIC    3
2362306a36Sopenharmony_ci#define AD1843_GAIN_PCM_0  4
2462306a36Sopenharmony_ci#define AD1843_GAIN_PCM_1  5
2562306a36Sopenharmony_ci#define AD1843_GAIN_SIZE   (AD1843_GAIN_PCM_1+1)
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_ciint ad1843_get_gain_max(struct snd_ad1843 *ad1843, int id);
2862306a36Sopenharmony_ciint ad1843_get_gain(struct snd_ad1843 *ad1843, int id);
2962306a36Sopenharmony_ciint ad1843_set_gain(struct snd_ad1843 *ad1843, int id, int newval);
3062306a36Sopenharmony_ciint ad1843_get_recsrc(struct snd_ad1843 *ad1843);
3162306a36Sopenharmony_ciint ad1843_set_recsrc(struct snd_ad1843 *ad1843, int newsrc);
3262306a36Sopenharmony_civoid ad1843_setup_dac(struct snd_ad1843 *ad1843,
3362306a36Sopenharmony_ci		      unsigned int id,
3462306a36Sopenharmony_ci		      unsigned int framerate,
3562306a36Sopenharmony_ci		      snd_pcm_format_t fmt,
3662306a36Sopenharmony_ci		      unsigned int channels);
3762306a36Sopenharmony_civoid ad1843_shutdown_dac(struct snd_ad1843 *ad1843,
3862306a36Sopenharmony_ci			 unsigned int id);
3962306a36Sopenharmony_civoid ad1843_setup_adc(struct snd_ad1843 *ad1843,
4062306a36Sopenharmony_ci		      unsigned int framerate,
4162306a36Sopenharmony_ci		      snd_pcm_format_t fmt,
4262306a36Sopenharmony_ci		      unsigned int channels);
4362306a36Sopenharmony_civoid ad1843_shutdown_adc(struct snd_ad1843 *ad1843);
4462306a36Sopenharmony_ciint ad1843_init(struct snd_ad1843 *ad1843);
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ci#endif /* __SOUND_AD1843_H */
47