#include <linux/delay.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/slab.h>
#include <linux/ioport.h>
#include <linux/io.h>
#include <sound/core.h>
#include <sound/tlv.h>
#include <sound/ad1816a.h>
#include <asm/dma.h>
static inline int snd_ad1816a_busy_wait(struct snd_ad1816a *chip)
{ … }
static inline unsigned char snd_ad1816a_in(struct snd_ad1816a *chip, unsigned char reg)
{ … }
static inline void snd_ad1816a_out(struct snd_ad1816a *chip, unsigned char reg,
unsigned char value)
{ … }
static inline void snd_ad1816a_out_mask(struct snd_ad1816a *chip, unsigned char reg,
unsigned char mask, unsigned char value)
{ … }
static unsigned short snd_ad1816a_read(struct snd_ad1816a *chip, unsigned char reg)
{ … }
static void snd_ad1816a_write(struct snd_ad1816a *chip, unsigned char reg,
unsigned short value)
{ … }
static void snd_ad1816a_write_mask(struct snd_ad1816a *chip, unsigned char reg,
unsigned short mask, unsigned short value)
{ … }
static unsigned char snd_ad1816a_get_format(struct snd_ad1816a *chip,
snd_pcm_format_t format,
int channels)
{ … }
static int snd_ad1816a_open(struct snd_ad1816a *chip, unsigned int mode)
{ … }
static void snd_ad1816a_close(struct snd_ad1816a *chip, unsigned int mode)
{ … }
static int snd_ad1816a_trigger(struct snd_ad1816a *chip, unsigned char what,
int channel, int cmd, int iscapture)
{ … }
static int snd_ad1816a_playback_trigger(struct snd_pcm_substream *substream, int cmd)
{ … }
static int snd_ad1816a_capture_trigger(struct snd_pcm_substream *substream, int cmd)
{ … }
static int snd_ad1816a_playback_prepare(struct snd_pcm_substream *substream)
{ … }
static int snd_ad1816a_capture_prepare(struct snd_pcm_substream *substream)
{ … }
static snd_pcm_uframes_t snd_ad1816a_playback_pointer(struct snd_pcm_substream *substream)
{ … }
static snd_pcm_uframes_t snd_ad1816a_capture_pointer(struct snd_pcm_substream *substream)
{ … }
static irqreturn_t snd_ad1816a_interrupt(int irq, void *dev_id)
{ … }
static const struct snd_pcm_hardware snd_ad1816a_playback = …;
static const struct snd_pcm_hardware snd_ad1816a_capture = …;
static int snd_ad1816a_timer_close(struct snd_timer *timer)
{ … }
static int snd_ad1816a_timer_open(struct snd_timer *timer)
{ … }
static unsigned long snd_ad1816a_timer_resolution(struct snd_timer *timer)
{ … }
static int snd_ad1816a_timer_start(struct snd_timer *timer)
{ … }
static int snd_ad1816a_timer_stop(struct snd_timer *timer)
{ … }
static const struct snd_timer_hardware snd_ad1816a_timer_table = …;
static int snd_ad1816a_playback_open(struct snd_pcm_substream *substream)
{ … }
static int snd_ad1816a_capture_open(struct snd_pcm_substream *substream)
{ … }
static int snd_ad1816a_playback_close(struct snd_pcm_substream *substream)
{ … }
static int snd_ad1816a_capture_close(struct snd_pcm_substream *substream)
{ … }
static void snd_ad1816a_init(struct snd_ad1816a *chip)
{ … }
#ifdef CONFIG_PM
void snd_ad1816a_suspend(struct snd_ad1816a *chip)
{ … }
void snd_ad1816a_resume(struct snd_ad1816a *chip)
{ … }
#endif
static int snd_ad1816a_probe(struct snd_ad1816a *chip)
{ … }
static const char *snd_ad1816a_chip_id(struct snd_ad1816a *chip)
{ … }
int snd_ad1816a_create(struct snd_card *card,
unsigned long port, int irq, int dma1, int dma2,
struct snd_ad1816a *chip)
{ … }
static const struct snd_pcm_ops snd_ad1816a_playback_ops = …;
static const struct snd_pcm_ops snd_ad1816a_capture_ops = …;
int snd_ad1816a_pcm(struct snd_ad1816a *chip, int device)
{ … }
int snd_ad1816a_timer(struct snd_ad1816a *chip, int device)
{ … }
static int snd_ad1816a_info_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{ … }
static int snd_ad1816a_get_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ … }
static int snd_ad1816a_put_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ … }
#define AD1816A_SINGLE_TLV(xname, reg, shift, mask, invert, xtlv) …
#define AD1816A_SINGLE(xname, reg, shift, mask, invert) …
static int snd_ad1816a_info_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{ … }
static int snd_ad1816a_get_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ … }
static int snd_ad1816a_put_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ … }
#define AD1816A_DOUBLE_TLV(xname, reg, shift_left, shift_right, mask, invert, xtlv) …
#define AD1816A_DOUBLE(xname, reg, shift_left, shift_right, mask, invert) …
static int snd_ad1816a_info_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{ … }
static int snd_ad1816a_get_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ … }
static int snd_ad1816a_put_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ … }
static const DECLARE_TLV_DB_SCALE(db_scale_4bit, -4500, 300, 0);
static const DECLARE_TLV_DB_SCALE(db_scale_5bit, -4650, 150, 0);
static const DECLARE_TLV_DB_SCALE(db_scale_6bit, -9450, 150, 0);
static const DECLARE_TLV_DB_SCALE(db_scale_5bit_12db_max, -3450, 150, 0);
static const DECLARE_TLV_DB_SCALE(db_scale_rec_gain, 0, 150, 0);
static const struct snd_kcontrol_new snd_ad1816a_controls[] = …;
int snd_ad1816a_mixer(struct snd_ad1816a *chip)
{ … }