#include <linux/init.h>
#include <linux/slab.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/pcm.h>
#include <sound/tlv.h>
#include "ice1712.h"
#include "envy24ht.h"
#include "maya44.h"
#define WM8776_REG_HEADPHONE_L …
#define WM8776_REG_HEADPHONE_R …
#define WM8776_REG_HEADPHONE_MASTER …
#define WM8776_REG_DAC_ATTEN_L …
#define WM8776_REG_DAC_ATTEN_R …
#define WM8776_REG_DAC_ATTEN_MASTER …
#define WM8776_REG_DAC_PHASE …
#define WM8776_REG_DAC_CONTROL …
#define WM8776_REG_DAC_MUTE …
#define WM8776_REG_DAC_DEEMPH …
#define WM8776_REG_DAC_IF_CONTROL …
#define WM8776_REG_ADC_IF_CONTROL …
#define WM8776_REG_MASTER_MODE_CONTROL …
#define WM8776_REG_POWERDOWN …
#define WM8776_REG_ADC_ATTEN_L …
#define WM8776_REG_ADC_ATTEN_R …
#define WM8776_REG_ADC_ALC1 …
#define WM8776_REG_ADC_ALC2 …
#define WM8776_REG_ADC_ALC3 …
#define WM8776_REG_ADC_NOISE_GATE …
#define WM8776_REG_ADC_LIMITER …
#define WM8776_REG_ADC_MUX …
#define WM8776_REG_OUTPUT_MUX …
#define WM8776_REG_RESET …
#define WM8776_NUM_REGS …
#define WM8776_CLOCK_RATIO_128FS …
#define WM8776_CLOCK_RATIO_192FS …
#define WM8776_CLOCK_RATIO_256FS …
#define WM8776_CLOCK_RATIO_384FS …
#define WM8776_CLOCK_RATIO_512FS …
#define WM8776_CLOCK_RATIO_768FS …
enum { … };
enum { … };
struct snd_wm8776 { … };
struct snd_maya44 { … };
static void wm8776_write(struct snd_ice1712 *ice, struct snd_wm8776 *wm,
unsigned char reg, unsigned short val)
{ … }
static int wm8776_write_bits(struct snd_ice1712 *ice, struct snd_wm8776 *wm,
unsigned char reg,
unsigned short mask, unsigned short val)
{ … }
struct maya_vol_info { … };
static const struct maya_vol_info vol_info[WM_NUM_VOLS] = …;
static const DECLARE_TLV_DB_SCALE(db_scale_hp, -7400, 100, 1);
static const DECLARE_TLV_DB_SCALE(db_scale_dac, -12750, 50, 1);
static const DECLARE_TLV_DB_SCALE(db_scale_adc, -2100, 50, 1);
static int maya_vol_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ … }
static int maya_vol_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int maya_vol_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
#define COMPOSE_SW_VAL(idx, reg, mask) …
#define GET_SW_VAL_IDX(val) …
#define GET_SW_VAL_REG(val) …
#define GET_SW_VAL_MASK(val) …
#define maya_sw_info …
static int maya_sw_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int maya_sw_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
#define GPIO_PHANTOM_OFF …
#define GPIO_MIC_RELAY …
#define GPIO_SPDIF_IN_INV …
#define GPIO_MUST_BE_0 …
#define COMPOSE_GPIO_VAL(shift, inv) …
#define GET_GPIO_VAL_SHIFT(val) …
#define GET_GPIO_VAL_INV(val) …
static int maya_set_gpio_bits(struct snd_ice1712 *ice, unsigned int mask,
unsigned int bits)
{ … }
#define maya_gpio_sw_info …
static int maya_gpio_sw_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int maya_gpio_sw_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
#define MAYA_LINE_IN …
#define MAYA_MIC_IN …
static void wm8776_select_input(struct snd_maya44 *chip, int idx, int line)
{ … }
static int maya_rec_src_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ … }
static int maya_rec_src_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int maya_rec_src_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int maya_pb_route_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ … }
static int maya_pb_route_shift(int idx)
{ … }
static int maya_pb_route_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int maya_pb_route_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new maya_controls[] = …;
static int maya44_add_controls(struct snd_ice1712 *ice)
{ … }
static void wm8776_init(struct snd_ice1712 *ice,
struct snd_wm8776 *wm, unsigned int addr)
{ … }
static void set_rate(struct snd_ice1712 *ice, unsigned int rate)
{ … }
static const unsigned int rates[] = …;
static const struct snd_pcm_hw_constraint_list dac_rates = …;
static const unsigned char wm8776_addr[2] = …;
static int maya44_init(struct snd_ice1712 *ice)
{ … }
static const unsigned char maya44_eeprom[] = …;
struct snd_ice1712_card_info snd_vt1724_maya44_cards[] = …;