linux/sound/pci/ice1712/prodigy192.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *   ALSA driver for ICEnsemble VT1724 (Envy24HT)
 *
 *   Lowlevel functions for AudioTrak Prodigy 192 cards
 *   Supported IEC958 input from optional MI/ODI/O add-on card.
 *
 *   Specifics (SW, HW):
 *   -------------------
 *   	* 49.5MHz crystal
 *   	* SPDIF-OUT on the card:
 *  	  - coax (through isolation transformer)/toslink supplied by
 *          74HC04 gates - 3 in parallel
 *   	  - output switched between on-board CD drive dig-out connector
 *          and ice1724 SPDTX pin, using 74HC02 NOR gates, controlled
 *          by GPIO20 (0 = CD dig-out, 1 = SPDTX)
 *   	* SPDTX goes straight to MI/ODI/O card's SPDIF-OUT coax
 *
 *   	* MI/ODI/O card: AK4114 based, used for iec958 input only
 *   		- toslink input -> RX0
 *   		- coax input -> RX1
 *   		- 4wire protocol:
 *   			AK4114		ICE1724
 *   			------------------------------
 * 			CDTO (pin 32) -- GPIO11 pin 86
 * 			CDTI (pin 33) -- GPIO10 pin 77
 * 			CCLK (pin 34) -- GPIO9 pin 76
 * 			CSN  (pin 35) -- GPIO8 pin 75
 *   		- output data Mode 7 (24bit, I2S, slave)
 *		- both MCKO1 and MCKO2 of ak4114 are fed to FPGA, which
 *		  outputs master clock to SPMCLKIN of ice1724.
 *		  Experimentally I found out that only a combination of
 *		  OCKS0=1, OCKS1=1 (128fs, 64fs output) and ice1724 -
 *		  VT1724_MT_I2S_MCLK_128X=0 (256fs input) yields correct
 *		  sampling rate. That means that the FPGA doubles the
 *		  MCK01 rate.
 *
 *	Copyright (c) 2003 Takashi Iwai <[email protected]>
 *      Copyright (c) 2003 Dimitromanolakis Apostolos <[email protected]>
 *      Copyright (c) 2004 Kouichi ONO <[email protected]>
 */      

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

#include "ice1712.h"
#include "envy24ht.h"
#include "prodigy192.h"
#include "stac946x.h"
#include <sound/tlv.h>

struct prodigy192_spec {};

static inline void stac9460_put(struct snd_ice1712 *ice, int reg, unsigned char val)
{}

static inline unsigned char stac9460_get(struct snd_ice1712 *ice, int reg)
{}

/*
 * DAC mute control
 */

/*
 * idx = STAC9460 volume register number, mute: 0 = mute, 1 = unmute
 */
static int stac9460_dac_mute(struct snd_ice1712 *ice, int idx,
		unsigned char mute)
{}

#define stac9460_dac_mute_info

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

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

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

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

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

/*
 * ADC mute control
 */
#define stac9460_adc_mute_info

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

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

/*
 * ADC gain mixer control
 */
static int stac9460_adc_vol_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{}

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

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

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


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

static int stac9460_mic_sw_put(struct snd_kcontrol *kcontrol,
	       		struct snd_ctl_elem_value *ucontrol)
{}
/*
 * Handler for setting correct codec rate - called when rate change is detected
 */
static void stac9460_set_rate_val(struct snd_ice1712 *ice, unsigned int rate)
{}


static const DECLARE_TLV_DB_SCALE(db_scale_dac, -19125, 75, 0);
static const DECLARE_TLV_DB_SCALE(db_scale_adc, 0, 150, 0);

/*
 * mixers
 */

static const struct snd_kcontrol_new stac_controls[] =;

/* AK4114 - ICE1724 connections on Prodigy192 + MI/ODI/O */
/* CDTO (pin 32) -- GPIO11 pin 86
 * CDTI (pin 33) -- GPIO10 pin 77
 * CCLK (pin 34) -- GPIO9 pin 76
 * CSN  (pin 35) -- GPIO8 pin 75
 */
#define AK4114_ADDR

/*
 * 4wire ak4114 protocol - writing data
 */
static void write_data(struct snd_ice1712 *ice, unsigned int gpio,
		       unsigned int data, int idx)
{}

/*
 * 4wire ak4114 protocol - reading data
 */
static unsigned char read_data(struct snd_ice1712 *ice, unsigned int gpio,
			       int idx)
{}
/*
 * 4wire ak4114 protocol - starting sequence
 */
static unsigned int prodigy192_4wire_start(struct snd_ice1712 *ice)
{}

/*
 * 4wire ak4114 protocol - final sequence
 */
static void prodigy192_4wire_finish(struct snd_ice1712 *ice, unsigned int tmp)
{}

/*
 * Write data to addr register of ak4114
 */
static void prodigy192_ak4114_write(void *private_data, unsigned char addr,
			       unsigned char data)
{}

/*
 * Read data from addr register of ak4114
 */
static unsigned char prodigy192_ak4114_read(void *private_data,
					    unsigned char addr)
{}


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


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

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


static const struct snd_kcontrol_new ak4114_controls[] =;


static int prodigy192_ak4114_init(struct snd_ice1712 *ice)
{}

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


static void stac9460_proc_init(struct snd_ice1712 *ice)
{}


static int prodigy192_add_controls(struct snd_ice1712 *ice)
{}

/*
 * check for presence of MI/ODI/O add-on card with digital inputs
 */
static int prodigy192_miodio_exists(struct snd_ice1712 *ice)
{}

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


/*
 * Aureon 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 prodigy71_eeprom[] =;


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