linux/sound/pci/ice1712/maya44.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *   ALSA driver for ICEnsemble VT1724 (Envy24HT)
 *
 *   Lowlevel functions for ESI Maya44 cards
 *
 *	Copyright (c) 2009 Takashi Iwai <[email protected]>
 *	Based on the patches by Rainer Zimmermann <[email protected]>
 */

#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"

/* WM8776 register indexes */
#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

/* clock ratio identifiers for snd_wm8776_set_rate() */
#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 {};


/* write the given register and save the data to the cache */
static void wm8776_write(struct snd_ice1712 *ice, struct snd_wm8776 *wm,
			 unsigned char reg, unsigned short val)
{}

/*
 * update the given register with and/or mask and save the data to the cache
 */
static int wm8776_write_bits(struct snd_ice1712 *ice, struct snd_wm8776 *wm,
			     unsigned char reg,
			     unsigned short mask, unsigned short val)
{}


/*
 * WM8776 volume controls
 */

struct maya_vol_info {};

static const struct maya_vol_info vol_info[WM_NUM_VOLS] =;

/*
 * dB tables
 */
/* headphone output: mute, -73..+6db (1db step) */
static const DECLARE_TLV_DB_SCALE(db_scale_hp, -7400, 100, 1);
/* DAC output: mute, -127..0db (0.5db step) */
static const DECLARE_TLV_DB_SCALE(db_scale_dac, -12750, 50, 1);
/* ADC gain: mute, -21..+24db (0.5db step) */
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)
{}

/*
 * WM8776 switch controls
 */

#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)
{}

/*
 * GPIO pins (known ones for maya44)
 */
#define GPIO_PHANTOM_OFF
#define GPIO_MIC_RELAY
#define GPIO_SPDIF_IN_INV
#define GPIO_MUST_BE_0

/*
 * GPIO switch controls
 */

#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)
{}

/*
 * capture source selection
 */

/* known working input slots (0-4) */
#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)
{}

/*
 * Maya44 routing switch settings have different meanings than the standard
 * ice1724 switches as defined in snd_vt1724_pro_route_info (ice1724.c).
 */
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)
{}


/*
 * controls to be added
 */

static const struct snd_kcontrol_new maya_controls[] =;

static int maya44_add_controls(struct snd_ice1712 *ice)
{}


/*
 * initialize a wm8776 chip
 */
static void wm8776_init(struct snd_ice1712 *ice,
			struct snd_wm8776 *wm, unsigned int addr)
{}


/*
 * change the rate on the WM8776 codecs.
 * this assumes that the VT17xx's rate is changed by the calling function.
 * NOTE: even though the WM8776's are running in slave mode and rate
 * selection is automatic, we need to call snd_wm8776_set_rate() here
 * to make sure some flags are set correctly.
 */
static void set_rate(struct snd_ice1712 *ice, unsigned int rate)
{}

/*
 * supported sample rates (to override the default one)
 */

static const unsigned int rates[] =;

/* playback rates: 32..192 kHz */
static const struct snd_pcm_hw_constraint_list dac_rates =;


/*
 * chip addresses on I2C bus
 */
static const unsigned char wm8776_addr[2] =;

/*
 * initialize the chip
 */
static int maya44_init(struct snd_ice1712 *ice)
{}


/*
 * Maya44 boards don't provide the EEPROM data except for the vendor IDs.
 * hence the driver needs to sets up it properly.
 */

static const unsigned char maya44_eeprom[] =;

/* entry point */
struct snd_ice1712_card_info snd_vt1724_maya44_cards[] =;