linux/sound/pci/ice1712/prodigy_hifi.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *   ALSA driver for ICEnsemble VT1724 (Envy24HT)
 *
 *   Lowlevel functions for Audiotrak Prodigy 7.1 Hifi
 *   based on pontis.c
 *
 *      Copyright (c) 2007 Julian Scheel <[email protected]>
 *      Copyright (c) 2007 allank
 *      Copyright (c) 2004 Takashi Iwai <[email protected]>
 */


#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/mutex.h>

#include <sound/core.h>
#include <sound/info.h>
#include <sound/tlv.h>

#include "ice1712.h"
#include "envy24ht.h"
#include "prodigy_hifi.h"

struct prodigy_hifi_spec {};

/* I2C addresses */
#define WM_DEV

/* WM8776 registers */
#define WM_HP_ATTEN_L
#define WM_HP_ATTEN_R
#define WM_HP_MASTER
#define WM_DAC_ATTEN_L
#define WM_DAC_ATTEN_R
#define WM_DAC_MASTER
#define WM_PHASE_SWAP
#define WM_DAC_CTRL1
#define WM_DAC_MUTE
#define WM_DAC_CTRL2
#define WM_DAC_INT
#define WM_ADC_INT
#define WM_MASTER_CTRL
#define WM_POWERDOWN
#define WM_ADC_ATTEN_L
#define WM_ADC_ATTEN_R
#define WM_ALC_CTRL1
#define WM_ALC_CTRL2
#define WM_ALC_CTRL3
#define WM_NOISE_GATE
#define WM_LIMITER
#define WM_ADC_MUX
#define WM_OUT_MUX
#define WM_RESET

/* Analog Recording Source :- Mic, LineIn, CD/Video, */

/* implement capture source select control for WM8776 */

#define WM_AIN1
#define WM_AIN2
#define WM_AIN3
#define WM_AIN4
#define WM_AIN5

/* GPIO pins of envy24ht connected to wm8766 */
#define WM8766_SPI_CLK
#define WM8766_SPI_MD
#define WM8766_SPI_ML

/* WM8766 registers */
#define WM8766_DAC_CTRL
#define WM8766_INT_CTRL
#define WM8766_DAC_CTRL2
#define WM8766_DAC_CTRL3
#define WM8766_RESET
#define WM8766_LDA1
#define WM8766_LDA2
#define WM8766_LDA3
#define WM8766_RDA1
#define WM8766_RDA2
#define WM8766_RDA3
#define WM8766_MUTE1
#define WM8766_MUTE2


/*
 * Prodigy HD2
 */
#define AK4396_ADDR
#define AK4396_CSN
#define AK4396_CCLK
#define AK4396_CDTI

/* ak4396 registers */
#define AK4396_CTRL1
#define AK4396_CTRL2
#define AK4396_CTRL3
#define AK4396_LCH_ATT
#define AK4396_RCH_ATT


/*
 * get the current register value of WM codec
 */
static unsigned short wm_get(struct snd_ice1712 *ice, int reg)
{}

/*
 * set the register value of WM codec and remember it
 */
static void wm_put_nocache(struct snd_ice1712 *ice, int reg, unsigned short val)
{}

static void wm_put(struct snd_ice1712 *ice, int reg, unsigned short val)
{}

/*
 * write data in the SPI mode
 */

static void set_gpio_bit(struct snd_ice1712 *ice, unsigned int bit, int val)
{}

/*
 * SPI implementation for WM8766 codec - only writing supported, no readback
 */

static void wm8766_spi_send_word(struct snd_ice1712 *ice, unsigned int data)
{}

static void wm8766_spi_write(struct snd_ice1712 *ice, unsigned int reg,
			     unsigned int data)
{}


/*
 * serial interface for ak4396 - only writing supported, no readback
 */

static void ak4396_send_word(struct snd_ice1712 *ice, unsigned int data)
{}

static void ak4396_write(struct snd_ice1712 *ice, unsigned int reg,
			 unsigned int data)
{}


/*
 * ak4396 mixers
 */



/*
 * DAC volume attenuation mixer control (-64dB to 0dB)
 */

static int ak4396_dac_vol_info(struct snd_kcontrol *kcontrol,
			       struct snd_ctl_elem_info *uinfo)
{}

static int ak4396_dac_vol_get(struct snd_kcontrol *kcontrol,
			      struct snd_ctl_elem_value *ucontrol)
{}

static int ak4396_dac_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{}

static const DECLARE_TLV_DB_SCALE(db_scale_wm_dac, -12700, 100, 1);
static const DECLARE_TLV_DB_LINEAR(ak4396_db_scale, TLV_DB_GAIN_MUTE, 0);

static const struct snd_kcontrol_new prodigy_hd2_controls[] =;


/* --------------- */

#define WM_VOL_MAX
#define WM_VOL_MUTE


#define DAC_0dB
#define DAC_RES
#define DAC_MIN


static void wm_set_vol(struct snd_ice1712 *ice, unsigned int index,
		       unsigned short vol, unsigned short master)
{}

static void wm8766_set_vol(struct snd_ice1712 *ice, unsigned int index,
			   unsigned short vol, unsigned short master)
{}


/*
 * DAC volume attenuation mixer control (-64dB to 0dB)
 */

static int wm_dac_vol_info(struct snd_kcontrol *kcontrol,
			   struct snd_ctl_elem_info *uinfo)
{}

static int wm_dac_vol_get(struct snd_kcontrol *kcontrol,
			  struct snd_ctl_elem_value *ucontrol)
{}

static int wm_dac_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{}


/*
 * WM8766 DAC volume attenuation mixer control
 */
static int wm8766_vol_info(struct snd_kcontrol *kcontrol,
			   struct snd_ctl_elem_info *uinfo)
{}

static int wm8766_vol_get(struct snd_kcontrol *kcontrol,
			  struct snd_ctl_elem_value *ucontrol)
{}

static int wm8766_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{}

/*
 * Master volume attenuation mixer control / applied to WM8776+WM8766
 */
static int wm_master_vol_info(struct snd_kcontrol *kcontrol,
			      struct snd_ctl_elem_info *uinfo)
{}

static int wm_master_vol_get(struct snd_kcontrol *kcontrol,
			     struct snd_ctl_elem_value *ucontrol)
{}

static int wm_master_vol_put(struct snd_kcontrol *kcontrol,
			     struct snd_ctl_elem_value *ucontrol)
{}


/* KONSTI */

static int wm_adc_mux_enum_info(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_info *uinfo)
{}

static int wm_adc_mux_enum_get(struct snd_kcontrol *kcontrol,
			       struct snd_ctl_elem_value *ucontrol)
{}

static int wm_adc_mux_enum_put(struct snd_kcontrol *kcontrol,
			       struct snd_ctl_elem_value *ucontrol)
{}

/* KONSTI */

/*
 * ADC gain mixer control (-64dB to 0dB)
 */

#define ADC_0dB
#define ADC_RES
#define ADC_MIN

static int wm_adc_vol_info(struct snd_kcontrol *kcontrol,
			   struct snd_ctl_elem_info *uinfo)
{}

static int wm_adc_vol_get(struct snd_kcontrol *kcontrol,
			  struct snd_ctl_elem_value *ucontrol)
{}

static int wm_adc_vol_put(struct snd_kcontrol *kcontrol,
			  struct snd_ctl_elem_value *ucontrol)
{}

/*
 * ADC input mux mixer control
 */
#define wm_adc_mux_info

static int wm_adc_mux_get(struct snd_kcontrol *kcontrol,
			  struct snd_ctl_elem_value *ucontrol)
{}

static int wm_adc_mux_put(struct snd_kcontrol *kcontrol,
			  struct snd_ctl_elem_value *ucontrol)
{}

/*
 * Analog bypass (In -> Out)
 */
#define wm_bypass_info

static int wm_bypass_get(struct snd_kcontrol *kcontrol,
			 struct snd_ctl_elem_value *ucontrol)
{}

static int wm_bypass_put(struct snd_kcontrol *kcontrol,
			 struct snd_ctl_elem_value *ucontrol)
{}

/*
 * Left/Right swap
 */
#define wm_chswap_info

static int wm_chswap_get(struct snd_kcontrol *kcontrol,
			 struct snd_ctl_elem_value *ucontrol)
{}

static int wm_chswap_put(struct snd_kcontrol *kcontrol,
			 struct snd_ctl_elem_value *ucontrol)
{}


/*
 * mixers
 */

static const struct snd_kcontrol_new prodigy_hifi_controls[] =;

/*
 * WM codec registers
 */
static void wm_proc_regs_write(struct snd_info_entry *entry,
			       struct snd_info_buffer *buffer)
{}

static void wm_proc_regs_read(struct snd_info_entry *entry,
			      struct snd_info_buffer *buffer)
{}

static void wm_proc_init(struct snd_ice1712 *ice)
{}

static int prodigy_hifi_add_controls(struct snd_ice1712 *ice)
{}

static int prodigy_hd2_add_controls(struct snd_ice1712 *ice)
{}

static void wm8766_init(struct snd_ice1712 *ice)
{}

static void wm8776_init(struct snd_ice1712 *ice)
{}

#ifdef CONFIG_PM_SLEEP
static int prodigy_hifi_resume(struct snd_ice1712 *ice)
{}
#endif

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


/*
 * initialize the chip
 */
static void ak4396_init(struct snd_ice1712 *ice)
{}

#ifdef CONFIG_PM_SLEEP
static int prodigy_hd2_resume(struct snd_ice1712 *ice)
{}
#endif

static int prodigy_hd2_init(struct snd_ice1712 *ice)
{}


static const unsigned char prodigy71hifi_eeprom[] =;

static const unsigned char prodigyhd2_eeprom[] =;

static const unsigned char fortissimo4_eeprom[] =;

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