linux/sound/pci/hda/patch_ca0132.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * HD audio interface patch for Creative CA0132 chip
 *
 * Copyright (c) 2011, Creative Technology Ltd.
 *
 * Based on patch_ca0110.c
 * Copyright (c) 2008 Takashi Iwai <[email protected]>
 */

#include <linux/init.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/mutex.h>
#include <linux/module.h>
#include <linux/firmware.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/io.h>
#include <linux/pci.h>
#include <asm/io.h>
#include <sound/core.h>
#include <sound/hda_codec.h>
#include "hda_local.h"
#include "hda_auto_parser.h"
#include "hda_jack.h"

#include "ca0132_regs.h"

/* Enable this to see controls for tuning purpose. */
/*#define ENABLE_TUNING_CONTROLS*/

#ifdef ENABLE_TUNING_CONTROLS
#include <sound/tlv.h>
#endif

#define FLOAT_ZERO
#define FLOAT_ONE
#define FLOAT_TWO
#define FLOAT_THREE
#define FLOAT_FIVE
#define FLOAT_SIX
#define FLOAT_EIGHT
#define FLOAT_MINUS_5

#define UNSOL_TAG_DSP

#define DSP_DMA_WRITE_BUFLEN_INIT
#define DSP_DMA_WRITE_BUFLEN_OVLY

#define DMA_TRANSFER_FRAME_SIZE_NWORDS
#define DMA_TRANSFER_MAX_FRAME_SIZE_NWORDS
#define DMA_OVERLAY_FRAME_SIZE_NWORDS

#define MASTERCONTROL
#define MASTERCONTROL_ALLOC_DMA_CHAN
#define MASTERCONTROL_QUERY_SPEAKER_EQ_ADDRESS

#define WIDGET_CHIP_CTRL
#define WIDGET_DSP_CTRL

#define MEM_CONNID_MICIN1
#define MEM_CONNID_MICIN2
#define MEM_CONNID_MICOUT1
#define MEM_CONNID_MICOUT2
#define MEM_CONNID_WUH
#define MEM_CONNID_DSP
#define MEM_CONNID_DMIC

#define SCP_SET
#define SCP_GET

#define EFX_FILE
#define DESKTOP_EFX_FILE
#define R3DI_EFX_FILE

#ifdef CONFIG_SND_HDA_CODEC_CA0132_DSP
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
#endif

static const char *const dirstr[2] =;

#define NUM_OF_OUTPUTS
static const char *const out_type_str[2] =;
enum {};

enum {};

/* Strings for Input Source Enum Control */
static const char *const in_src_str[3] =;
#define IN_SRC_NUM_OF_INPUTS
enum {};

enum {};

/* Effects values size*/
#define EFFECT_VALS_MAX_COUNT

/*
 * Default values for the effect slider controls, they are in order of their
 * effect NID's. Surround, Crystalizer, Dialog Plus, Smart Volume, and then
 * X-bass.
 */
static const unsigned int effect_slider_defaults[] =;
/* Amount of effect level sliders for ca0132_alt controls. */
#define EFFECT_LEVEL_SLIDERS

/* Latency introduced by DSP blocks in milliseconds. */
#define DSP_CAPTURE_INIT_LATENCY
#define DSP_CRYSTAL_VOICE_LATENCY
#define DSP_PLAYBACK_INIT_LATENCY
#define DSP_PLAY_ENHANCEMENT_LATENCY
#define DSP_SPEAKER_OUT_LATENCY

struct ct_effect {};

#define EFX_DIR_OUT
#define EFX_DIR_IN

static const struct ct_effect ca0132_effects[EFFECTS_COUNT] =;

/* Tuning controls */
#ifdef ENABLE_TUNING_CONTROLS

enum {
#define TUNING_CTL_START_NID
	WEDGE_ANGLE = TUNING_CTL_START_NID,
	SVM_LEVEL,
	EQUALIZER_BAND_0,
	EQUALIZER_BAND_1,
	EQUALIZER_BAND_2,
	EQUALIZER_BAND_3,
	EQUALIZER_BAND_4,
	EQUALIZER_BAND_5,
	EQUALIZER_BAND_6,
	EQUALIZER_BAND_7,
	EQUALIZER_BAND_8,
	EQUALIZER_BAND_9,
	TUNING_CTL_END_NID
#define TUNING_CTLS_COUNT
};

struct ct_tuning_ctl {
	char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
	hda_nid_t parent_nid;
	hda_nid_t nid;
	int mid; /*effect module ID*/
	int req; /*effect module request*/
	int direct; /* 0:output; 1:input*/
	unsigned int def_val;/*effect default values*/
};

static const struct ct_tuning_ctl ca0132_tuning_ctls[] = {
	{ .name = "Wedge Angle",
	  .parent_nid = VOICE_FOCUS,
	  .nid = WEDGE_ANGLE,
	  .mid = 0x95,
	  .req = 8,
	  .direct = EFX_DIR_IN,
	  .def_val = 0x41F00000
	},
	{ .name = "SVM Level",
	  .parent_nid = MIC_SVM,
	  .nid = SVM_LEVEL,
	  .mid = 0x95,
	  .req = 45,
	  .direct = EFX_DIR_IN,
	  .def_val = 0x3F3D70A4
	},
	{ .name = "EQ Band0",
	  .parent_nid = EQUALIZER,
	  .nid = EQUALIZER_BAND_0,
	  .mid = 0x96,
	  .req = 11,
	  .direct = EFX_DIR_OUT,
	  .def_val = 0x00000000
	},
	{ .name = "EQ Band1",
	  .parent_nid = EQUALIZER,
	  .nid = EQUALIZER_BAND_1,
	  .mid = 0x96,
	  .req = 12,
	  .direct = EFX_DIR_OUT,
	  .def_val = 0x00000000
	},
	{ .name = "EQ Band2",
	  .parent_nid = EQUALIZER,
	  .nid = EQUALIZER_BAND_2,
	  .mid = 0x96,
	  .req = 13,
	  .direct = EFX_DIR_OUT,
	  .def_val = 0x00000000
	},
	{ .name = "EQ Band3",
	  .parent_nid = EQUALIZER,
	  .nid = EQUALIZER_BAND_3,
	  .mid = 0x96,
	  .req = 14,
	  .direct = EFX_DIR_OUT,
	  .def_val = 0x00000000
	},
	{ .name = "EQ Band4",
	  .parent_nid = EQUALIZER,
	  .nid = EQUALIZER_BAND_4,
	  .mid = 0x96,
	  .req = 15,
	  .direct = EFX_DIR_OUT,
	  .def_val = 0x00000000
	},
	{ .name = "EQ Band5",
	  .parent_nid = EQUALIZER,
	  .nid = EQUALIZER_BAND_5,
	  .mid = 0x96,
	  .req = 16,
	  .direct = EFX_DIR_OUT,
	  .def_val = 0x00000000
	},
	{ .name = "EQ Band6",
	  .parent_nid = EQUALIZER,
	  .nid = EQUALIZER_BAND_6,
	  .mid = 0x96,
	  .req = 17,
	  .direct = EFX_DIR_OUT,
	  .def_val = 0x00000000
	},
	{ .name = "EQ Band7",
	  .parent_nid = EQUALIZER,
	  .nid = EQUALIZER_BAND_7,
	  .mid = 0x96,
	  .req = 18,
	  .direct = EFX_DIR_OUT,
	  .def_val = 0x00000000
	},
	{ .name = "EQ Band8",
	  .parent_nid = EQUALIZER,
	  .nid = EQUALIZER_BAND_8,
	  .mid = 0x96,
	  .req = 19,
	  .direct = EFX_DIR_OUT,
	  .def_val = 0x00000000
	},
	{ .name = "EQ Band9",
	  .parent_nid = EQUALIZER,
	  .nid = EQUALIZER_BAND_9,
	  .mid = 0x96,
	  .req = 20,
	  .direct = EFX_DIR_OUT,
	  .def_val = 0x00000000
	}
};
#endif

/* Voice FX Presets */
#define VOICEFX_MAX_PARAM_COUNT

struct ct_voicefx {};

struct ct_voicefx_preset {};

static const struct ct_voicefx ca0132_voicefx =;

static const struct ct_voicefx_preset ca0132_voicefx_presets[] =;

/* ca0132 EQ presets, taken from Windows Sound Blaster Z Driver */

#define EQ_PRESET_MAX_PARAM_COUNT

struct ct_eq {};

struct ct_eq_preset {};

static const struct ct_eq ca0132_alt_eq_enum =;


static const struct ct_eq_preset ca0132_alt_eq_presets[] =;

/*
 * DSP reqs for handling full-range speakers/bass redirection. If a speaker is
 * set as not being full range, and bass redirection is enabled, all
 * frequencies below the crossover frequency are redirected to the LFE
 * channel. If the surround configuration has no LFE channel, this can't be
 * enabled. X-Bass must be disabled when using these.
 */
enum speaker_range_reqs {};

/*
 * Definitions for the DSP req's to handle speaker tuning. These all belong to
 * module ID 0x96, the output effects module.
 */
enum speaker_tuning_reqs {};

/* Surround output channel count configuration structures. */
#define SPEAKER_CHANNEL_CFG_COUNT
enum {};

struct ca0132_alt_speaker_channel_cfg {};

static const struct ca0132_alt_speaker_channel_cfg speaker_channel_cfgs[] =;

/*
 * DSP volume setting structs. Req 1 is left volume, req 2 is right volume,
 * and I don't know what the third req is, but it's always zero. I assume it's
 * some sort of update or set command to tell the DSP there's new volume info.
 */
#define DSP_VOL_OUT
#define DSP_VOL_IN

struct ct_dsp_volume_ctl {};

static const struct ct_dsp_volume_ctl ca0132_alt_vol_ctls[] =;

/* Values for ca0113_mmio_command_set for selecting output. */
#define AE_CA0113_OUT_SET_COMMANDS
struct ae_ca0113_output_set {};

static const struct ae_ca0113_output_set ae5_ca0113_output_presets =;

static const struct ae_ca0113_output_set ae7_ca0113_output_presets =;

/* ae5 ca0113 command sequences to set headphone gain levels. */
#define AE5_HEADPHONE_GAIN_PRESET_MAX_COMMANDS
struct ae5_headphone_gain_set {};

static const struct ae5_headphone_gain_set ae5_headphone_gain_presets[] =;

struct ae5_filter_set {};

static const struct ae5_filter_set ae5_filter_presets[] =;

/*
 * Data structures for storing audio router remapping data. These are used to
 * remap a currently active streams ports.
 */
struct chipio_stream_remap_data {};

static const struct chipio_stream_remap_data stream_remap_data[] =;

enum hda_cmd_vendor_io {};

/*
 *  Control flag IDs
 */
enum control_flag_id {};

/*
 * Control parameter IDs
 */
enum control_param_id {};

/*
 *  Dsp Io Status codes
 */
enum hda_vendor_status_dspio {};

/*
 *  Chip Io Status codes
 */
enum hda_vendor_status_chipio {};

/*
 *  CA0132 sample rate
 */
enum ca0132_sample_rate {};

enum dsp_download_state {};

/* retrieve parameters from hda format */
#define get_hdafmt_chs(fmt)
#define get_hdafmt_bits(fmt)
#define get_hdafmt_rate(fmt)
#define get_hdafmt_type(fmt)

/*
 * CA0132 specific
 */

struct ca0132_spec {};

/*
 * CA0132 quirks table
 */
enum {};

#ifdef CONFIG_PCI
#define ca0132_quirk(spec)
#define ca0132_use_pci_mmio(spec)
#define ca0132_use_alt_functions(spec)
#define ca0132_use_alt_controls(spec)
#else
#define ca0132_quirk
#define ca0132_use_alt_functions
#define ca0132_use_pci_mmio
#define ca0132_use_alt_controls
#endif

static const struct hda_pintbl alienware_pincfgs[] =;

/* Sound Blaster Z pin configs taken from Windows Driver */
static const struct hda_pintbl sbz_pincfgs[] =;

/* Sound Blaster ZxR pin configs taken from Windows Driver */
static const struct hda_pintbl zxr_pincfgs[] =;

/* Recon3D pin configs taken from Windows Driver */
static const struct hda_pintbl r3d_pincfgs[] =;

/* Sound Blaster AE-5 pin configs taken from Windows Driver */
static const struct hda_pintbl ae5_pincfgs[] =;

/* Recon3D integrated pin configs taken from Windows Driver */
static const struct hda_pintbl r3di_pincfgs[] =;

static const struct hda_pintbl ae7_pincfgs[] =;

static const struct snd_pci_quirk ca0132_quirks[] =;

/* Output selection quirk info structures. */
#define MAX_QUIRK_MMIO_GPIO_SET_VALS
#define MAX_QUIRK_SCP_SET_VALS
struct ca0132_alt_out_set_info {};

struct ca0132_alt_out_set_quirk_data {};

static const struct ca0132_alt_out_set_quirk_data quirk_out_set_data[] =;

/*
 * CA0132 codec access
 */
static unsigned int codec_send_command(struct hda_codec *codec, hda_nid_t nid,
		unsigned int verb, unsigned int parm, unsigned int *res)
{}

static int codec_set_converter_format(struct hda_codec *codec, hda_nid_t nid,
		unsigned short converter_format, unsigned int *res)
{}

static int codec_set_converter_stream_channel(struct hda_codec *codec,
				hda_nid_t nid, unsigned char stream,
				unsigned char channel, unsigned int *res)
{}

/* Chip access helper function */
static int chipio_send(struct hda_codec *codec,
		       unsigned int reg,
		       unsigned int data)
{}

/*
 * Write chip address through the vendor widget -- NOT protected by the Mutex!
 */
static int chipio_write_address(struct hda_codec *codec,
				unsigned int chip_addx)
{}

/*
 * Write data through the vendor widget -- NOT protected by the Mutex!
 */
static int chipio_write_data(struct hda_codec *codec, unsigned int data)
{}

/*
 * Write multiple data through the vendor widget -- NOT protected by the Mutex!
 */
static int chipio_write_data_multiple(struct hda_codec *codec,
				      const u32 *data,
				      unsigned int count)
{}


/*
 * Read data through the vendor widget -- NOT protected by the Mutex!
 */
static int chipio_read_data(struct hda_codec *codec, unsigned int *data)
{}

/*
 * Write given value to the given address through the chip I/O widget.
 * protected by the Mutex
 */
static int chipio_write(struct hda_codec *codec,
		unsigned int chip_addx, const unsigned int data)
{}

/*
 * Write given value to the given address through the chip I/O widget.
 * not protected by the Mutex
 */
static int chipio_write_no_mutex(struct hda_codec *codec,
		unsigned int chip_addx, const unsigned int data)
{}

/*
 * Write multiple values to the given address through the chip I/O widget.
 * protected by the Mutex
 */
static int chipio_write_multiple(struct hda_codec *codec,
				 u32 chip_addx,
				 const u32 *data,
				 unsigned int count)
{}

/*
 * Read the given address through the chip I/O widget
 * protected by the Mutex
 */
static int chipio_read(struct hda_codec *codec,
		unsigned int chip_addx, unsigned int *data)
{}

/*
 * Set chip control flags through the chip I/O widget.
 */
static void chipio_set_control_flag(struct hda_codec *codec,
				    enum control_flag_id flag_id,
				    bool flag_state)
{}

/*
 * Set chip parameters through the chip I/O widget.
 */
static void chipio_set_control_param(struct hda_codec *codec,
		enum control_param_id param_id, int param_val)
{}

/*
 * Set chip parameters through the chip I/O widget. NO MUTEX.
 */
static void chipio_set_control_param_no_mutex(struct hda_codec *codec,
		enum control_param_id param_id, int param_val)
{}
/*
 * Connect stream to a source point, and then connect
 * that source point to a destination point.
 */
static void chipio_set_stream_source_dest(struct hda_codec *codec,
				int streamid, int source_point, int dest_point)
{}

/*
 * Set number of channels in the selected stream.
 */
static void chipio_set_stream_channels(struct hda_codec *codec,
				int streamid, unsigned int channels)
{}

/*
 * Enable/Disable audio stream.
 */
static void chipio_set_stream_control(struct hda_codec *codec,
				int streamid, int enable)
{}

/*
 * Get ChipIO audio stream's status.
 */
static void chipio_get_stream_control(struct hda_codec *codec,
				int streamid, unsigned int *enable)
{}

/*
 * Set sampling rate of the connection point. NO MUTEX.
 */
static void chipio_set_conn_rate_no_mutex(struct hda_codec *codec,
				int connid, enum ca0132_sample_rate rate)
{}

/*
 * Set sampling rate of the connection point.
 */
static void chipio_set_conn_rate(struct hda_codec *codec,
				int connid, enum ca0132_sample_rate rate)
{}

/*
 * Writes to the 8051's internal address space directly instead of indirectly,
 * giving access to the special function registers located at addresses
 * 0x80-0xFF.
 */
static void chipio_8051_write_direct(struct hda_codec *codec,
		unsigned int addr, unsigned int data)
{}

/*
 * Writes to the 8051's exram, which has 16-bits of address space.
 * Data at addresses 0x2000-0x7fff is mirrored to 0x8000-0xdfff.
 * Data at 0x8000-0xdfff can also be used as program memory for the 8051 by
 * setting the pmem bank selection SFR.
 * 0xe000-0xffff is always mapped as program memory, with only 0xf000-0xffff
 * being writable.
 */
static void chipio_8051_set_address(struct hda_codec *codec, unsigned int addr)
{}

static void chipio_8051_set_data(struct hda_codec *codec, unsigned int data)
{}

static unsigned int chipio_8051_get_data(struct hda_codec *codec)
{}

/* PLL_PMU writes share the lower address register of the 8051 exram writes. */
static void chipio_8051_set_data_pll(struct hda_codec *codec, unsigned int data)
{}

static void chipio_8051_write_exram(struct hda_codec *codec,
		unsigned int addr, unsigned int data)
{}

static void chipio_8051_write_exram_no_mutex(struct hda_codec *codec,
		unsigned int addr, unsigned int data)
{}

/* Readback data from the 8051's exram. No mutex. */
static void chipio_8051_read_exram(struct hda_codec *codec,
		unsigned int addr, unsigned int *data)
{}

static void chipio_8051_write_pll_pmu(struct hda_codec *codec,
		unsigned int addr, unsigned int data)
{}

static void chipio_8051_write_pll_pmu_no_mutex(struct hda_codec *codec,
		unsigned int addr, unsigned int data)
{}

/*
 * Enable clocks.
 */
static void chipio_enable_clocks(struct hda_codec *codec)
{}

/*
 * CA0132 DSP IO stuffs
 */
static int dspio_send(struct hda_codec *codec, unsigned int reg,
		      unsigned int data)
{}

/*
 * Wait for DSP to be ready for commands
 */
static void dspio_write_wait(struct hda_codec *codec)
{}

/*
 * Write SCP data to DSP
 */
static int dspio_write(struct hda_codec *codec, unsigned int scp_data)
{}

/*
 * Write multiple SCP data to DSP
 */
static int dspio_write_multiple(struct hda_codec *codec,
				unsigned int *buffer, unsigned int size)
{}

static int dspio_read(struct hda_codec *codec, unsigned int *data)
{}

static int dspio_read_multiple(struct hda_codec *codec, unsigned int *buffer,
			       unsigned int *buf_size, unsigned int size_count)
{}

/*
 * Construct the SCP header using corresponding fields
 */
static inline unsigned int
make_scp_header(unsigned int target_id, unsigned int source_id,
		unsigned int get_flag, unsigned int req,
		unsigned int device_flag, unsigned int resp_flag,
		unsigned int error_flag, unsigned int data_size)
{}

/*
 * Extract corresponding fields from SCP header
 */
static inline void
extract_scp_header(unsigned int header,
		   unsigned int *target_id, unsigned int *source_id,
		   unsigned int *get_flag, unsigned int *req,
		   unsigned int *device_flag, unsigned int *resp_flag,
		   unsigned int *error_flag, unsigned int *data_size)
{}

#define SCP_MAX_DATA_WORDS

/* Structure to contain any SCP message */
struct scp_msg {};

static void dspio_clear_response_queue(struct hda_codec *codec)
{}

static int dspio_get_response_data(struct hda_codec *codec)
{}

/*
 * Send SCP message to DSP
 */
static int dspio_send_scp_message(struct hda_codec *codec,
				  unsigned char *send_buf,
				  unsigned int send_buf_size,
				  unsigned char *return_buf,
				  unsigned int return_buf_size,
				  unsigned int *bytes_returned)
{}

/**
 * dspio_scp - Prepare and send the SCP message to DSP
 * @codec: the HDA codec
 * @mod_id: ID of the DSP module to send the command
 * @src_id: ID of the source
 * @req: ID of request to send to the DSP module
 * @dir: SET or GET
 * @data: pointer to the data to send with the request, request specific
 * @len: length of the data, in bytes
 * @reply: point to the buffer to hold data returned for a reply
 * @reply_len: length of the reply buffer returned from GET
 *
 * Returns zero or a negative error code.
 */
static int dspio_scp(struct hda_codec *codec,
		int mod_id, int src_id, int req, int dir, const void *data,
		unsigned int len, void *reply, unsigned int *reply_len)
{}

/*
 * Set DSP parameters
 */
static int dspio_set_param(struct hda_codec *codec, int mod_id,
			int src_id, int req, const void *data, unsigned int len)
{}

static int dspio_set_uint_param(struct hda_codec *codec, int mod_id,
			int req, const unsigned int data)
{}

/*
 * Allocate a DSP DMA channel via an SCP message
 */
static int dspio_alloc_dma_chan(struct hda_codec *codec, unsigned int *dma_chan)
{}

/*
 * Free a DSP DMA via an SCP message
 */
static int dspio_free_dma_chan(struct hda_codec *codec, unsigned int dma_chan)
{}

/*
 * (Re)start the DSP
 */
static int dsp_set_run_state(struct hda_codec *codec)
{}

/*
 * Reset the DSP
 */
static int dsp_reset(struct hda_codec *codec)
{}

/*
 * Convert chip address to DSP address
 */
static unsigned int dsp_chip_to_dsp_addx(unsigned int chip_addx,
					bool *code, bool *yram)
{}

/*
 * Check if the DSP DMA is active
 */
static bool dsp_is_dma_active(struct hda_codec *codec, unsigned int dma_chan)
{}

static int dsp_dma_setup_common(struct hda_codec *codec,
				unsigned int chip_addx,
				unsigned int dma_chan,
				unsigned int port_map_mask,
				bool ovly)
{}

/*
 * Setup the DSP DMA per-transfer-specific registers
 */
static int dsp_dma_setup(struct hda_codec *codec,
			unsigned int chip_addx,
			unsigned int count,
			unsigned int dma_chan)
{}

/*
 * Start the DSP DMA
 */
static int dsp_dma_start(struct hda_codec *codec,
			 unsigned int dma_chan, bool ovly)
{}

/*
 * Stop the DSP DMA
 */
static int dsp_dma_stop(struct hda_codec *codec,
			unsigned int dma_chan, bool ovly)
{}

/**
 * dsp_allocate_router_ports - Allocate router ports
 *
 * @codec: the HDA codec
 * @num_chans: number of channels in the stream
 * @ports_per_channel: number of ports per channel
 * @start_device: start device
 * @port_map: pointer to the port list to hold the allocated ports
 *
 * Returns zero or a negative error code.
 */
static int dsp_allocate_router_ports(struct hda_codec *codec,
				     unsigned int num_chans,
				     unsigned int ports_per_channel,
				     unsigned int start_device,
				     unsigned int *port_map)
{}

/*
 * Free router ports
 */
static int dsp_free_router_ports(struct hda_codec *codec)
{}

/*
 * Allocate DSP ports for the download stream
 */
static int dsp_allocate_ports(struct hda_codec *codec,
			unsigned int num_chans,
			unsigned int rate_multi, unsigned int *port_map)
{}

static int dsp_allocate_ports_format(struct hda_codec *codec,
			const unsigned short fmt,
			unsigned int *port_map)
{}

/*
 * free DSP ports
 */
static int dsp_free_ports(struct hda_codec *codec)
{}

/*
 *  HDA DMA engine stuffs for DSP code download
 */
struct dma_engine {};


enum dma_state {};

static int dma_convert_to_hda_format(struct hda_codec *codec,
		unsigned int sample_rate,
		unsigned short channels,
		unsigned short *hda_format)
{}

/*
 *  Reset DMA for DSP download
 */
static int dma_reset(struct dma_engine *dma)
{}

static int dma_set_state(struct dma_engine *dma, enum dma_state state)
{}

static unsigned int dma_get_buffer_size(struct dma_engine *dma)
{}

static unsigned char *dma_get_buffer_addr(struct dma_engine *dma)
{}

static int dma_xfer(struct dma_engine *dma,
		const unsigned int *data,
		unsigned int count)
{}

static void dma_get_converter_format(
		struct dma_engine *dma,
		unsigned short *format)
{}

static unsigned int dma_get_stream_id(struct dma_engine *dma)
{}

struct dsp_image_seg {};

static const u32 g_magic_value =;
static const u32 g_chip_addr_magic_value =;

static bool is_valid(const struct dsp_image_seg *p)
{}

static bool is_hci_prog_list_seg(const struct dsp_image_seg *p)
{}

static bool is_last(const struct dsp_image_seg *p)
{}

static size_t dsp_sizeof(const struct dsp_image_seg *p)
{}

static const struct dsp_image_seg *get_next_seg_ptr(
				const struct dsp_image_seg *p)
{}

/*
 * CA0132 chip DSP transfer stuffs.  For DSP download.
 */
#define INVALID_DMA_CHANNEL

/*
 * Program a list of address/data pairs via the ChipIO widget.
 * The segment data is in the format of successive pairs of words.
 * These are repeated as indicated by the segment's count field.
 */
static int dspxfr_hci_write(struct hda_codec *codec,
			const struct dsp_image_seg *fls)
{}

/**
 * dspxfr_one_seg - Write a block of data into DSP code or data RAM using pre-allocated DMA engine.
 *
 * @codec: the HDA codec
 * @fls: pointer to a fast load image
 * @reloc: Relocation address for loading single-segment overlays, or 0 for
 *	   no relocation
 * @dma_engine: pointer to DMA engine to be used for DSP download
 * @dma_chan: The number of DMA channels used for DSP download
 * @port_map_mask: port mapping
 * @ovly: TRUE if overlay format is required
 *
 * Returns zero or a negative error code.
 */
static int dspxfr_one_seg(struct hda_codec *codec,
			const struct dsp_image_seg *fls,
			unsigned int reloc,
			struct dma_engine *dma_engine,
			unsigned int dma_chan,
			unsigned int port_map_mask,
			bool ovly)
{}

/**
 * dspxfr_image - Write the entire DSP image of a DSP code/data overlay to DSP memories
 *
 * @codec: the HDA codec
 * @fls_data: pointer to a fast load image
 * @reloc: Relocation address for loading single-segment overlays, or 0 for
 *	   no relocation
 * @sample_rate: sampling rate of the stream used for DSP download
 * @channels: channels of the stream used for DSP download
 * @ovly: TRUE if overlay format is required
 *
 * Returns zero or a negative error code.
 */
static int dspxfr_image(struct hda_codec *codec,
			const struct dsp_image_seg *fls_data,
			unsigned int reloc,
			unsigned int sample_rate,
			unsigned short channels,
			bool ovly)
{}

/*
 * CA0132 DSP download stuffs.
 */
static void dspload_post_setup(struct hda_codec *codec)
{}

/**
 * dspload_image - Download DSP from a DSP Image Fast Load structure.
 *
 * @codec: the HDA codec
 * @fls: pointer to a fast load image
 * @ovly: TRUE if overlay format is required
 * @reloc: Relocation address for loading single-segment overlays, or 0 for
 *	   no relocation
 * @autostart: TRUE if DSP starts after loading; ignored if ovly is TRUE
 * @router_chans: number of audio router channels to be allocated (0 means use
 *		  internal defaults; max is 32)
 *
 * Download DSP from a DSP Image Fast Load structure. This structure is a
 * linear, non-constant sized element array of structures, each of which
 * contain the count of the data to be loaded, the data itself, and the
 * corresponding starting chip address of the starting data location.
 * Returns zero or a negative error code.
 */
static int dspload_image(struct hda_codec *codec,
			const struct dsp_image_seg *fls,
			bool ovly,
			unsigned int reloc,
			bool autostart,
			int router_chans)
{}

#ifdef CONFIG_SND_HDA_CODEC_CA0132_DSP
static bool dspload_is_loaded(struct hda_codec *codec)
{}
#else
#define dspload_is_loaded
#endif

static bool dspload_wait_loaded(struct hda_codec *codec)
{}

/*
 * ca0113 related functions. The ca0113 acts as the HDA bus for the pci-e
 * based cards, and has a second mmio region, region2, that's used for special
 * commands.
 */

/*
 * For cards with PCI-E region2 (Sound Blaster Z/ZxR, Recon3D, and AE-5)
 * the mmio address 0x320 is used to set GPIO pins. The format for the data
 * The first eight bits are just the number of the pin. So far, I've only seen
 * this number go to 7.
 * AE-5 note: The AE-5 seems to use pins 2 and 3 to somehow set the color value
 * of the on-card LED. It seems to use pin 2 for data, then toggles 3 to on and
 * then off to send that bit.
 */
static void ca0113_mmio_gpio_set(struct hda_codec *codec, unsigned int gpio_pin,
		bool enable)
{}

/*
 * Special pci region2 commands that are only used by the AE-5. They follow
 * a set format, and require reads at certain points to seemingly 'clear'
 * the response data. My first tests didn't do these reads, and would cause
 * the card to get locked up until the memory was read. These commands
 * seem to work with three distinct values that I've taken to calling group,
 * target-id, and value.
 */
static void ca0113_mmio_command_set(struct hda_codec *codec, unsigned int group,
		unsigned int target, unsigned int value)
{}

/*
 * This second type of command is used for setting the sound filter type.
 */
static void ca0113_mmio_command_set_type2(struct hda_codec *codec,
		unsigned int group, unsigned int target, unsigned int value)
{}

/*
 * Setup GPIO for the other variants of Core3D.
 */

/*
 * Sets up the GPIO pins so that they are discoverable. If this isn't done,
 * the card shows as having no GPIO pins.
 */
static void ca0132_gpio_init(struct hda_codec *codec)
{}

/* Sets the GPIO for audio output. */
static void ca0132_gpio_setup(struct hda_codec *codec)
{}

/*
 * GPIO control functions for the Recon3D integrated.
 */

enum r3di_gpio_bit {};

enum r3di_mic_select {};

enum r3di_out_select {};
enum r3di_dsp_status {};


static void r3di_gpio_mic_set(struct hda_codec *codec,
		enum r3di_mic_select cur_mic)
{}

static void r3di_gpio_dsp_status_set(struct hda_codec *codec,
		enum r3di_dsp_status dsp_status)
{}

/*
 * PCM callbacks
 */
static int ca0132_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
			struct hda_codec *codec,
			unsigned int stream_tag,
			unsigned int format,
			struct snd_pcm_substream *substream)
{}

static int ca0132_playback_pcm_cleanup(struct hda_pcm_stream *hinfo,
			struct hda_codec *codec,
			struct snd_pcm_substream *substream)
{}

static unsigned int ca0132_playback_pcm_delay(struct hda_pcm_stream *info,
			struct hda_codec *codec,
			struct snd_pcm_substream *substream)
{}

/*
 * Digital out
 */
static int ca0132_dig_playback_pcm_open(struct hda_pcm_stream *hinfo,
					struct hda_codec *codec,
					struct snd_pcm_substream *substream)
{}

static int ca0132_dig_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
			struct hda_codec *codec,
			unsigned int stream_tag,
			unsigned int format,
			struct snd_pcm_substream *substream)
{}

static int ca0132_dig_playback_pcm_cleanup(struct hda_pcm_stream *hinfo,
			struct hda_codec *codec,
			struct snd_pcm_substream *substream)
{}

static int ca0132_dig_playback_pcm_close(struct hda_pcm_stream *hinfo,
					 struct hda_codec *codec,
					 struct snd_pcm_substream *substream)
{}

/*
 * Analog capture
 */
static int ca0132_capture_pcm_prepare(struct hda_pcm_stream *hinfo,
					struct hda_codec *codec,
					unsigned int stream_tag,
					unsigned int format,
					struct snd_pcm_substream *substream)
{}

static int ca0132_capture_pcm_cleanup(struct hda_pcm_stream *hinfo,
			struct hda_codec *codec,
			struct snd_pcm_substream *substream)
{}

static unsigned int ca0132_capture_pcm_delay(struct hda_pcm_stream *info,
			struct hda_codec *codec,
			struct snd_pcm_substream *substream)
{}

/*
 * Controls stuffs.
 */

/*
 * Mixer controls helpers.
 */
#define CA0132_CODEC_VOL_MONO(xname, nid, channel, dir)

/*
 * Creates a mixer control that uses defaults of HDA_CODEC_VOL except for the
 * volume put, which is used for setting the DSP volume. This was done because
 * the ca0132 functions were taking too much time and causing lag.
 */
#define CA0132_ALT_CODEC_VOL_MONO(xname, nid, channel, dir)

#define CA0132_CODEC_MUTE_MONO(xname, nid, channel, dir)

/* stereo */
#define CA0132_CODEC_VOL(xname, nid, dir)
#define CA0132_ALT_CODEC_VOL(xname, nid, dir)
#define CA0132_CODEC_MUTE(xname, nid, dir)

/* lookup tables */
/*
 * Lookup table with decibel values for the DSP. When volume is changed in
 * Windows, the DSP is also sent the dB value in floating point. In Windows,
 * these values have decimal points, probably because the Windows driver
 * actually uses floating point. We can't here, so I made a lookup table of
 * values -90 to 9. -90 is the lowest decibel value for both the ADC's and the
 * DAC's, and 9 is the maximum.
 */
static const unsigned int float_vol_db_lookup[] =;

/*
 * This table counts from float 0 to 1 in increments of .01, which is
 * useful for a few different sliders.
 */
static const unsigned int float_zero_to_one_lookup[] =;

/*
 * This table counts from float 10 to 1000, which is the range of the x-bass
 * crossover slider in Windows.
 */
static const unsigned int float_xbass_xover_lookup[] =;

/* The following are for tuning of products */
#ifdef ENABLE_TUNING_CONTROLS

static const unsigned int voice_focus_vals_lookup[] = {
0x41A00000, 0x41A80000, 0x41B00000, 0x41B80000, 0x41C00000, 0x41C80000,
0x41D00000, 0x41D80000, 0x41E00000, 0x41E80000, 0x41F00000, 0x41F80000,
0x42000000, 0x42040000, 0x42080000, 0x420C0000, 0x42100000, 0x42140000,
0x42180000, 0x421C0000, 0x42200000, 0x42240000, 0x42280000, 0x422C0000,
0x42300000, 0x42340000, 0x42380000, 0x423C0000, 0x42400000, 0x42440000,
0x42480000, 0x424C0000, 0x42500000, 0x42540000, 0x42580000, 0x425C0000,
0x42600000, 0x42640000, 0x42680000, 0x426C0000, 0x42700000, 0x42740000,
0x42780000, 0x427C0000, 0x42800000, 0x42820000, 0x42840000, 0x42860000,
0x42880000, 0x428A0000, 0x428C0000, 0x428E0000, 0x42900000, 0x42920000,
0x42940000, 0x42960000, 0x42980000, 0x429A0000, 0x429C0000, 0x429E0000,
0x42A00000, 0x42A20000, 0x42A40000, 0x42A60000, 0x42A80000, 0x42AA0000,
0x42AC0000, 0x42AE0000, 0x42B00000, 0x42B20000, 0x42B40000, 0x42B60000,
0x42B80000, 0x42BA0000, 0x42BC0000, 0x42BE0000, 0x42C00000, 0x42C20000,
0x42C40000, 0x42C60000, 0x42C80000, 0x42CA0000, 0x42CC0000, 0x42CE0000,
0x42D00000, 0x42D20000, 0x42D40000, 0x42D60000, 0x42D80000, 0x42DA0000,
0x42DC0000, 0x42DE0000, 0x42E00000, 0x42E20000, 0x42E40000, 0x42E60000,
0x42E80000, 0x42EA0000, 0x42EC0000, 0x42EE0000, 0x42F00000, 0x42F20000,
0x42F40000, 0x42F60000, 0x42F80000, 0x42FA0000, 0x42FC0000, 0x42FE0000,
0x43000000, 0x43010000, 0x43020000, 0x43030000, 0x43040000, 0x43050000,
0x43060000, 0x43070000, 0x43080000, 0x43090000, 0x430A0000, 0x430B0000,
0x430C0000, 0x430D0000, 0x430E0000, 0x430F0000, 0x43100000, 0x43110000,
0x43120000, 0x43130000, 0x43140000, 0x43150000, 0x43160000, 0x43170000,
0x43180000, 0x43190000, 0x431A0000, 0x431B0000, 0x431C0000, 0x431D0000,
0x431E0000, 0x431F0000, 0x43200000, 0x43210000, 0x43220000, 0x43230000,
0x43240000, 0x43250000, 0x43260000, 0x43270000, 0x43280000, 0x43290000,
0x432A0000, 0x432B0000, 0x432C0000, 0x432D0000, 0x432E0000, 0x432F0000,
0x43300000, 0x43310000, 0x43320000, 0x43330000, 0x43340000
};

static const unsigned int mic_svm_vals_lookup[] = {
0x00000000, 0x3C23D70A, 0x3CA3D70A, 0x3CF5C28F, 0x3D23D70A, 0x3D4CCCCD,
0x3D75C28F, 0x3D8F5C29, 0x3DA3D70A, 0x3DB851EC, 0x3DCCCCCD, 0x3DE147AE,
0x3DF5C28F, 0x3E051EB8, 0x3E0F5C29, 0x3E19999A, 0x3E23D70A, 0x3E2E147B,
0x3E3851EC, 0x3E428F5C, 0x3E4CCCCD, 0x3E570A3D, 0x3E6147AE, 0x3E6B851F,
0x3E75C28F, 0x3E800000, 0x3E851EB8, 0x3E8A3D71, 0x3E8F5C29, 0x3E947AE1,
0x3E99999A, 0x3E9EB852, 0x3EA3D70A, 0x3EA8F5C3, 0x3EAE147B, 0x3EB33333,
0x3EB851EC, 0x3EBD70A4, 0x3EC28F5C, 0x3EC7AE14, 0x3ECCCCCD, 0x3ED1EB85,
0x3ED70A3D, 0x3EDC28F6, 0x3EE147AE, 0x3EE66666, 0x3EEB851F, 0x3EF0A3D7,
0x3EF5C28F, 0x3EFAE148, 0x3F000000, 0x3F028F5C, 0x3F051EB8, 0x3F07AE14,
0x3F0A3D71, 0x3F0CCCCD, 0x3F0F5C29, 0x3F11EB85, 0x3F147AE1, 0x3F170A3D,
0x3F19999A, 0x3F1C28F6, 0x3F1EB852, 0x3F2147AE, 0x3F23D70A, 0x3F266666,
0x3F28F5C3, 0x3F2B851F, 0x3F2E147B, 0x3F30A3D7, 0x3F333333, 0x3F35C28F,
0x3F3851EC, 0x3F3AE148, 0x3F3D70A4, 0x3F400000, 0x3F428F5C, 0x3F451EB8,
0x3F47AE14, 0x3F4A3D71, 0x3F4CCCCD, 0x3F4F5C29, 0x3F51EB85, 0x3F547AE1,
0x3F570A3D, 0x3F59999A, 0x3F5C28F6, 0x3F5EB852, 0x3F6147AE, 0x3F63D70A,
0x3F666666, 0x3F68F5C3, 0x3F6B851F, 0x3F6E147B, 0x3F70A3D7, 0x3F733333,
0x3F75C28F, 0x3F7851EC, 0x3F7AE148, 0x3F7D70A4, 0x3F800000
};

static const unsigned int equalizer_vals_lookup[] = {
0xC1C00000, 0xC1B80000, 0xC1B00000, 0xC1A80000, 0xC1A00000, 0xC1980000,
0xC1900000, 0xC1880000, 0xC1800000, 0xC1700000, 0xC1600000, 0xC1500000,
0xC1400000, 0xC1300000, 0xC1200000, 0xC1100000, 0xC1000000, 0xC0E00000,
0xC0C00000, 0xC0A00000, 0xC0800000, 0xC0400000, 0xC0000000, 0xBF800000,
0x00000000, 0x3F800000, 0x40000000, 0x40400000, 0x40800000, 0x40A00000,
0x40C00000, 0x40E00000, 0x41000000, 0x41100000, 0x41200000, 0x41300000,
0x41400000, 0x41500000, 0x41600000, 0x41700000, 0x41800000, 0x41880000,
0x41900000, 0x41980000, 0x41A00000, 0x41A80000, 0x41B00000, 0x41B80000,
0x41C00000
};

static int tuning_ctl_set(struct hda_codec *codec, hda_nid_t nid,
			  const unsigned int *lookup, int idx)
{
	int i = 0;

	for (i = 0; i < TUNING_CTLS_COUNT; i++)
		if (nid == ca0132_tuning_ctls[i].nid)
			goto found;

	return -EINVAL;
found:
	snd_hda_power_up(codec);
	dspio_set_param(codec, ca0132_tuning_ctls[i].mid, 0x20,
			ca0132_tuning_ctls[i].req,
			&(lookup[idx]), sizeof(unsigned int));
	snd_hda_power_down(codec);

	return 1;
}

static int tuning_ctl_get(struct snd_kcontrol *kcontrol,
			  struct snd_ctl_elem_value *ucontrol)
{
	struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
	struct ca0132_spec *spec = codec->spec;
	hda_nid_t nid = get_amp_nid(kcontrol);
	long *valp = ucontrol->value.integer.value;
	int idx = nid - TUNING_CTL_START_NID;

	*valp = spec->cur_ctl_vals[idx];
	return 0;
}

static int voice_focus_ctl_info(struct snd_kcontrol *kcontrol,
			      struct snd_ctl_elem_info *uinfo)
{
	int chs = get_amp_channels(kcontrol);
	uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
	uinfo->count = chs == 3 ? 2 : 1;
	uinfo->value.integer.min = 20;
	uinfo->value.integer.max = 180;
	uinfo->value.integer.step = 1;

	return 0;
}

static int voice_focus_ctl_put(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
{
	struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
	struct ca0132_spec *spec = codec->spec;
	hda_nid_t nid = get_amp_nid(kcontrol);
	long *valp = ucontrol->value.integer.value;
	int idx;

	idx = nid - TUNING_CTL_START_NID;
	/* any change? */
	if (spec->cur_ctl_vals[idx] == *valp)
		return 0;

	spec->cur_ctl_vals[idx] = *valp;

	idx = *valp - 20;
	tuning_ctl_set(codec, nid, voice_focus_vals_lookup, idx);

	return 1;
}

static int mic_svm_ctl_info(struct snd_kcontrol *kcontrol,
			      struct snd_ctl_elem_info *uinfo)
{
	int chs = get_amp_channels(kcontrol);
	uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
	uinfo->count = chs == 3 ? 2 : 1;
	uinfo->value.integer.min = 0;
	uinfo->value.integer.max = 100;
	uinfo->value.integer.step = 1;

	return 0;
}

static int mic_svm_ctl_put(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
{
	struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
	struct ca0132_spec *spec = codec->spec;
	hda_nid_t nid = get_amp_nid(kcontrol);
	long *valp = ucontrol->value.integer.value;
	int idx;

	idx = nid - TUNING_CTL_START_NID;
	/* any change? */
	if (spec->cur_ctl_vals[idx] == *valp)
		return 0;

	spec->cur_ctl_vals[idx] = *valp;

	idx = *valp;
	tuning_ctl_set(codec, nid, mic_svm_vals_lookup, idx);

	return 0;
}

static int equalizer_ctl_info(struct snd_kcontrol *kcontrol,
			      struct snd_ctl_elem_info *uinfo)
{
	int chs = get_amp_channels(kcontrol);
	uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
	uinfo->count = chs == 3 ? 2 : 1;
	uinfo->value.integer.min = 0;
	uinfo->value.integer.max = 48;
	uinfo->value.integer.step = 1;

	return 0;
}

static int equalizer_ctl_put(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
{
	struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
	struct ca0132_spec *spec = codec->spec;
	hda_nid_t nid = get_amp_nid(kcontrol);
	long *valp = ucontrol->value.integer.value;
	int idx;

	idx = nid - TUNING_CTL_START_NID;
	/* any change? */
	if (spec->cur_ctl_vals[idx] == *valp)
		return 0;

	spec->cur_ctl_vals[idx] = *valp;

	idx = *valp;
	tuning_ctl_set(codec, nid, equalizer_vals_lookup, idx);

	return 1;
}

static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(voice_focus_db_scale, 2000, 100, 0);
static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(eq_db_scale, -2400, 100, 0);

static int add_tuning_control(struct hda_codec *codec,
				hda_nid_t pnid, hda_nid_t nid,
				const char *name, int dir)
{
	char namestr[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
	int type = dir ? HDA_INPUT : HDA_OUTPUT;
	struct snd_kcontrol_new knew =
		HDA_CODEC_VOLUME_MONO(namestr, nid, 1, 0, type);

	knew.access = SNDRV_CTL_ELEM_ACCESS_READWRITE |
			SNDRV_CTL_ELEM_ACCESS_TLV_READ;
	knew.tlv.c = 0;
	knew.tlv.p = 0;
	switch (pnid) {
	case VOICE_FOCUS:
		knew.info = voice_focus_ctl_info;
		knew.get = tuning_ctl_get;
		knew.put = voice_focus_ctl_put;
		knew.tlv.p = voice_focus_db_scale;
		break;
	case MIC_SVM:
		knew.info = mic_svm_ctl_info;
		knew.get = tuning_ctl_get;
		knew.put = mic_svm_ctl_put;
		break;
	case EQUALIZER:
		knew.info = equalizer_ctl_info;
		knew.get = tuning_ctl_get;
		knew.put = equalizer_ctl_put;
		knew.tlv.p = eq_db_scale;
		break;
	default:
		return 0;
	}
	knew.private_value =
		HDA_COMPOSE_AMP_VAL(nid, 1, 0, type);
	sprintf(namestr, "%s %s Volume", name, dirstr[dir]);
	return snd_hda_ctl_add(codec, nid, snd_ctl_new1(&knew, codec));
}

static int add_tuning_ctls(struct hda_codec *codec)
{
	int i;
	int err;

	for (i = 0; i < TUNING_CTLS_COUNT; i++) {
		err = add_tuning_control(codec,
					ca0132_tuning_ctls[i].parent_nid,
					ca0132_tuning_ctls[i].nid,
					ca0132_tuning_ctls[i].name,
					ca0132_tuning_ctls[i].direct);
		if (err < 0)
			return err;
	}

	return 0;
}

static void ca0132_init_tuning_defaults(struct hda_codec *codec)
{
	struct ca0132_spec *spec = codec->spec;
	int i;

	/* Wedge Angle defaults to 30.  10 below is 30 - 20.  20 is min. */
	spec->cur_ctl_vals[WEDGE_ANGLE - TUNING_CTL_START_NID] = 10;
	/* SVM level defaults to 0.74. */
	spec->cur_ctl_vals[SVM_LEVEL - TUNING_CTL_START_NID] = 74;

	/* EQ defaults to 0dB. */
	for (i = 2; i < TUNING_CTLS_COUNT; i++)
		spec->cur_ctl_vals[i] = 24;
}
#endif /*ENABLE_TUNING_CONTROLS*/

/*
 * Select the active output.
 * If autodetect is enabled, output will be selected based on jack detection.
 * If jack inserted, headphone will be selected, else built-in speakers
 * If autodetect is disabled, output will be selected based on selection.
 */
static int ca0132_select_out(struct hda_codec *codec)
{}

static int ae5_headphone_gain_set(struct hda_codec *codec, long val);
static int zxr_headphone_gain_set(struct hda_codec *codec, long val);
static int ca0132_effects_set(struct hda_codec *codec, hda_nid_t nid, long val);

static void ae5_mmio_select_out(struct hda_codec *codec)
{}

static int ca0132_alt_set_full_range_speaker(struct hda_codec *codec)
{}

static int ca0132_alt_surround_set_bass_redirection(struct hda_codec *codec,
		bool val)
{}

/*
 * These are the commands needed to setup output on each of the different card
 * types.
 */
static void ca0132_alt_select_out_get_quirk_data(struct hda_codec *codec,
		const struct ca0132_alt_out_set_quirk_data **quirk_data)
{}

static int ca0132_alt_select_out_quirk_set(struct hda_codec *codec)
{}

static void ca0132_set_out_node_pincfg(struct hda_codec *codec, hda_nid_t nid,
		bool out_enable, bool hp_enable)
{}

/*
 * This function behaves similarly to the ca0132_select_out funciton above,
 * except with a few differences. It adds the ability to select the current
 * output with an enumerated control "output source" if the auto detect
 * mute switch is set to off. If the auto detect mute switch is enabled, it
 * will detect either headphone or lineout(SPEAKER_OUT) from jack detection.
 * It also adds the ability to auto-detect the front headphone port.
 */
static int ca0132_alt_select_out(struct hda_codec *codec)
{}

static void ca0132_unsol_hp_delayed(struct work_struct *work)
{}

static void ca0132_set_dmic(struct hda_codec *codec, int enable);
static int ca0132_mic_boost_set(struct hda_codec *codec, long val);
static void resume_mic1(struct hda_codec *codec, unsigned int oldval);
static int stop_mic1(struct hda_codec *codec);
static int ca0132_cvoice_switch_set(struct hda_codec *codec);
static int ca0132_alt_mic_boost_set(struct hda_codec *codec, long val);

/*
 * Select the active VIP source
 */
static int ca0132_set_vipsource(struct hda_codec *codec, int val)
{}

static int ca0132_alt_set_vipsource(struct hda_codec *codec, int val)
{}

/*
 * Select the active microphone.
 * If autodetect is enabled, mic will be selected based on jack detection.
 * If jack inserted, ext.mic will be selected, else built-in mic
 * If autodetect is disabled, mic will be selected based on selection.
 */
static int ca0132_select_mic(struct hda_codec *codec)
{}

/*
 * Select the active input.
 * Mic detection isn't used, because it's kind of pointless on the SBZ.
 * The front mic has no jack-detection, so the only way to switch to it
 * is to do it manually in alsamixer.
 */
static int ca0132_alt_select_in(struct hda_codec *codec)
{}

/*
 * Check if VNODE settings take effect immediately.
 */
static bool ca0132_is_vnode_effective(struct hda_codec *codec,
				     hda_nid_t vnid,
				     hda_nid_t *shared_nid)
{}

/*
* The following functions are control change helpers.
* They return 0 if no changed.  Return 1 if changed.
*/
static int ca0132_voicefx_set(struct hda_codec *codec, int enable)
{}

/*
 * Set the effects parameters
 */
static int ca0132_effects_set(struct hda_codec *codec, hda_nid_t nid, long val)
{}

/*
 * Turn on/off Playback Enhancements
 */
static int ca0132_pe_switch_set(struct hda_codec *codec)
{}

/* Check if Mic1 is streaming, if so, stop streaming */
static int stop_mic1(struct hda_codec *codec)
{}

/* Resume Mic1 streaming if it was stopped. */
static void resume_mic1(struct hda_codec *codec, unsigned int oldval)
{}

/*
 * Turn on/off CrystalVoice
 */
static int ca0132_cvoice_switch_set(struct hda_codec *codec)
{}

static int ca0132_mic_boost_set(struct hda_codec *codec, long val)
{}

static int ca0132_alt_mic_boost_set(struct hda_codec *codec, long val)
{}

static int ae5_headphone_gain_set(struct hda_codec *codec, long val)
{}

/*
 * gpio pin 1 is a relay that switches on/off, apparently setting the headphone
 * amplifier to handle a 600 ohm load.
 */
static int zxr_headphone_gain_set(struct hda_codec *codec, long val)
{}

static int ca0132_vnode_switch_set(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
{}
/* End of control change helpers. */

static void ca0132_alt_bass_redirection_xover_set(struct hda_codec *codec,
		long idx)
{}

/*
 * Below I've added controls to mess with the effect levels, I've only enabled
 * them on the Sound Blaster Z, but they would probably also work on the
 * Chromebook. I figured they were probably tuned specifically for it, and left
 * out for a reason.
 */

/* Sets DSP effect level from the sliders above the controls */

static int ca0132_alt_slider_ctl_set(struct hda_codec *codec, hda_nid_t nid,
			  const unsigned int *lookup, int idx)
{}

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

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

/*
 * The X-bass crossover starts at 10hz, so the min is 1. The
 * frequency is set in multiples of 10.
 */
static int ca0132_alt_xbass_xover_slider_info(struct snd_kcontrol *kcontrol,
		struct snd_ctl_elem_info *uinfo)
{}

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

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

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


/*
 * Mic Boost Enum for alternative ca0132 codecs. I didn't like that the original
 * only has off or full 30 dB, and didn't like making a volume slider that has
 * traditional 0-100 in alsamixer that goes in big steps. I like enum better.
 */
#define MIC_BOOST_NUM_OF_STEPS
#define MIC_BOOST_ENUM_MAX_STRLEN

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

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

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

/*
 * Sound BlasterX AE-5 Headphone Gain Controls.
 */
#define AE5_HEADPHONE_GAIN_MAX
static int ae5_headphone_gain_info(struct snd_kcontrol *kcontrol,
				 struct snd_ctl_elem_info *uinfo)
{}

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

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

/*
 * Sound BlasterX AE-5 sound filter enumerated control.
 */
#define AE5_SOUND_FILTER_MAX

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

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

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

/*
 * Input Select Control for alternative ca0132 codecs. This exists because
 * front microphone has no auto-detect, and we need a way to set the rear
 * as line-in
 */
static int ca0132_alt_input_source_info(struct snd_kcontrol *kcontrol,
				 struct snd_ctl_elem_info *uinfo)
{}

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

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

/* Sound Blaster Z Output Select Control */
static int ca0132_alt_output_select_get_info(struct snd_kcontrol *kcontrol,
				 struct snd_ctl_elem_info *uinfo)
{}

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

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

/* Select surround output type: 2.1, 4.0, 4.1, or 5.1. */
static int ca0132_alt_speaker_channel_cfg_get_info(struct snd_kcontrol *kcontrol,
				 struct snd_ctl_elem_info *uinfo)
{}

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

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

/*
 * Smart Volume output setting control. Three different settings, Normal,
 * which takes the value from the smart volume slider. The two others, loud
 * and night, disregard the slider value and have uneditable values.
 */
#define NUM_OF_SVM_SETTINGS
static const char *const out_svm_set_enum_str[3] =;

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

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

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

/* Sound Blaster Z EQ preset controls */
static int ca0132_alt_eq_preset_info(struct snd_kcontrol *kcontrol,
				 struct snd_ctl_elem_info *uinfo)
{}

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

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

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

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

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

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

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

/*
 * Volume related
 */
/*
 * Sets the internal DSP decibel level to match the DAC for output, and the
 * ADC for input. Currently only the SBZ sets dsp capture volume level, and
 * all alternative codecs set DSP playback volume.
 */
static void ca0132_alt_dsp_volume_put(struct hda_codec *codec, hda_nid_t nid)
{}

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

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

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

/*
 * This function is the same as the one above, because using an if statement
 * inside of the above volume control for the DSP volume would cause too much
 * lag. This is a lot more smooth.
 */
static int ca0132_alt_volume_put(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
{}

static int ca0132_volume_tlv(struct snd_kcontrol *kcontrol, int op_flag,
			     unsigned int size, unsigned int __user *tlv)
{}

/* Add volume slider control for effect level */
static int ca0132_alt_add_effect_slider(struct hda_codec *codec, hda_nid_t nid,
					const char *pfx, int dir)
{}

/*
 * Added FX: prefix for the alternative codecs, because otherwise the surround
 * effect would conflict with the Surround sound volume control. Also seems more
 * clear as to what the switches do. Left alone for others.
 */
static int add_fx_switch(struct hda_codec *codec, hda_nid_t nid,
			 const char *pfx, int dir)
{}

static int add_voicefx(struct hda_codec *codec)
{}

/* Create the EQ Preset control */
static int add_ca0132_alt_eq_presets(struct hda_codec *codec)
{}

/*
 * Add enumerated control for the three different settings of the smart volume
 * output effect. Normal just uses the slider value, and loud and night are
 * their own things that ignore that value.
 */
static int ca0132_alt_add_svm_enum(struct hda_codec *codec)
{}

/*
 * Create an Output Select enumerated control for codecs with surround
 * out capabilities.
 */
static int ca0132_alt_add_output_enum(struct hda_codec *codec)
{}

/*
 * Add a control for selecting channel count on speaker output. Setting this
 * allows the DSP to do bass redirection and channel upmixing on surround
 * configurations.
 */
static int ca0132_alt_add_speaker_channel_cfg_enum(struct hda_codec *codec)
{}

/*
 * Full range front stereo and rear surround switches. When these are set to
 * full range, the lower frequencies from these channels are no longer
 * redirected to the LFE channel.
 */
static int ca0132_alt_add_front_full_range_switch(struct hda_codec *codec)
{}

static int ca0132_alt_add_rear_full_range_switch(struct hda_codec *codec)
{}

/*
 * Bass redirection redirects audio below the crossover frequency to the LFE
 * channel on speakers that are set as not being full-range. On configurations
 * without an LFE channel, it does nothing. Bass redirection seems to be the
 * replacement for X-Bass on configurations with an LFE channel.
 */
static int ca0132_alt_add_bass_redirection_crossover(struct hda_codec *codec)
{}

static int ca0132_alt_add_bass_redirection_switch(struct hda_codec *codec)
{}

/*
 * Create an Input Source enumerated control for the alternate ca0132 codecs
 * because the front microphone has no auto-detect, and Line-in has to be set
 * somehow.
 */
static int ca0132_alt_add_input_enum(struct hda_codec *codec)
{}

/*
 * Add mic boost enumerated control. Switches through 0dB to 30dB. This adds
 * more control than the original mic boost, which is either full 30dB or off.
 */
static int ca0132_alt_add_mic_boost_enum(struct hda_codec *codec)
{}

/*
 * Add headphone gain enumerated control for the AE-5. This switches between
 * three modes, low, medium, and high. When non-headphone outputs are selected,
 * it is automatically set to high. This is the same behavior as Windows.
 */
static int ae5_add_headphone_gain_enum(struct hda_codec *codec)
{}

/*
 * Add sound filter enumerated control for the AE-5. This adds three different
 * settings: Slow Roll Off, Minimum Phase, and Fast Roll Off. From what I've
 * read into it, it changes the DAC's interpolation filter.
 */
static int ae5_add_sound_filter_enum(struct hda_codec *codec)
{}

static int zxr_add_headphone_gain_switch(struct hda_codec *codec)
{}

/*
 * Need to create follower controls for the alternate codecs that have surround
 * capabilities.
 */
static const char * const ca0132_alt_follower_pfxs[] =;

/*
 * Also need special channel map, because the default one is incorrect.
 * I think this has to do with the pin for rear surround being 0x11,
 * and the center/lfe being 0x10. Usually the pin order is the opposite.
 */
static const struct snd_pcm_chmap_elem ca0132_alt_chmaps[] =;

/* Add the correct chmap for streams with 6 channels. */
static void ca0132_alt_add_chmap_ctls(struct hda_codec *codec)
{}

/*
 * When changing Node IDs for Mixer Controls below, make sure to update
 * Node IDs in ca0132_config() as well.
 */
static const struct snd_kcontrol_new ca0132_mixer[] =;

/*
 * Desktop specific control mixer. Removes auto-detect for mic, and adds
 * surround controls. Also sets both the Front Playback and Capture Volume
 * controls to alt so they set the DSP's decibel level.
 */
static const struct snd_kcontrol_new desktop_mixer[] =;

/*
 * Same as the Sound Blaster Z, except doesn't use the alt volume for capture
 * because it doesn't set decibel levels for the DSP for capture.
 */
static const struct snd_kcontrol_new r3di_mixer[] =;

static int ca0132_build_controls(struct hda_codec *codec)
{}

static int dbpro_build_controls(struct hda_codec *codec)
{}

/*
 * PCM
 */
static const struct hda_pcm_stream ca0132_pcm_analog_playback =;

static const struct hda_pcm_stream ca0132_pcm_analog_capture =;

static const struct hda_pcm_stream ca0132_pcm_digital_playback =;

static const struct hda_pcm_stream ca0132_pcm_digital_capture =;

static int ca0132_build_pcms(struct hda_codec *codec)
{}

static int dbpro_build_pcms(struct hda_codec *codec)
{}

static void init_output(struct hda_codec *codec, hda_nid_t pin, hda_nid_t dac)
{}

static void init_input(struct hda_codec *codec, hda_nid_t pin, hda_nid_t adc)
{}

static void refresh_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir)
{}

/*
 * Switch between Digital built-in mic and analog mic.
 */
static void ca0132_set_dmic(struct hda_codec *codec, int enable)
{}

/*
 * Initialization for Digital Mic.
 */
static void ca0132_init_dmic(struct hda_codec *codec)
{}

/*
 * Initialization for Analog Mic 2
 */
static void ca0132_init_analog_mic2(struct hda_codec *codec)
{}

static void ca0132_refresh_widget_caps(struct hda_codec *codec)
{}


/* If there is an active channel for some reason, find it and free it. */
static void ca0132_alt_free_active_dma_channels(struct hda_codec *codec)
{}

/*
 * In the case of CT_EXTENSIONS_ENABLE being set to 1, and the DSP being in
 * use, audio is no longer routed directly to the DAC/ADC from the HDA stream.
 * Instead, audio is now routed through the DSP's DMA controllers, which
 * the DSP is tasked with setting up itself. Through debugging, it seems the
 * cause of most of the no-audio on startup issues were due to improperly
 * configured DSP DMA channels.
 *
 * Normally, the DSP configures these the first time an HDA audio stream is
 * started post DSP firmware download. That is why creating a 'dummy' stream
 * worked in fixing the audio in some cases. This works most of the time, but
 * sometimes if a stream is started/stopped before the DSP can setup the DMA
 * configuration registers, it ends up in a broken state. Issues can also
 * arise if streams are started in an unusual order, i.e the audio output dma
 * channel being sandwiched between the mic1 and mic2 dma channels.
 *
 * The solution to this is to make sure that the DSP has no DMA channels
 * in use post DSP firmware download, and then to manually start each default
 * DSP stream that uses the DMA channels. These are 0x0c, the audio output
 * stream, 0x03, analog mic 1, and 0x04, analog mic 2.
 */
static void ca0132_alt_start_dsp_audio_streams(struct hda_codec *codec)
{}

/*
 * The region of ChipIO memory from 0x190000-0x1903fc is a sort of 'audio
 * router', where each entry represents a 48khz audio channel, with a format
 * of an 8-bit destination, an 8-bit source, and an unknown 2-bit number
 * value. The 2-bit number value is seemingly 0 if inactive, 1 if active,
 * and 3 if it's using Sample Rate Converter ports.
 * An example is:
 * 0x0001f8c0
 * In this case, f8 is the destination, and c0 is the source. The number value
 * is 1.
 * This region of memory is normally managed internally by the 8051, where
 * the region of exram memory from 0x1477-0x1575 has each byte represent an
 * entry within the 0x190000 range, and when a range of entries is in use, the
 * ending value is overwritten with 0xff.
 * 0x1578 in exram is a table of 0x25 entries, corresponding to the ChipIO
 * streamID's, where each entry is a starting 0x190000 port offset.
 * 0x159d in exram is the same as 0x1578, except it contains the ending port
 * offset for the corresponding streamID.
 *
 * On certain cards, such as the SBZ/ZxR/AE7, these are originally setup by
 * the 8051, then manually overwritten to remap the ports to work with the
 * new DACs.
 *
 * Currently known portID's:
 * 0x00-0x1f: HDA audio stream input/output ports.
 * 0x80-0xbf: Sample rate converter input/outputs. Only valid ports seem to
 *            have the lower-nibble set to 0x1, 0x2, and 0x9.
 * 0xc0-0xdf: DSP DMA input/output ports. Dynamically assigned.
 * 0xe0-0xff: DAC/ADC audio input/output ports.
 *
 * Currently known streamID's:
 * 0x03: Mic1 ADC to DSP.
 * 0x04: Mic2 ADC to DSP.
 * 0x05: HDA node 0x02 audio stream to DSP.
 * 0x0f: DSP Mic exit to HDA node 0x07.
 * 0x0c: DSP processed audio to DACs.
 * 0x14: DAC0, front L/R.
 *
 * It is possible to route the HDA audio streams directly to the DAC and
 * bypass the DSP entirely, with the only downside being that since the DSP
 * does volume control, the only volume control you'll get is through PCM on
 * the PC side, in the same way volume is handled for optical out. This may be
 * useful for debugging.
 */
static void chipio_remap_stream(struct hda_codec *codec,
		const struct chipio_stream_remap_data *remap_data)
{}

/*
 * Default speaker tuning values setup for alternative codecs.
 */
static const unsigned int sbz_default_delay_values[] =;

static const unsigned int zxr_default_delay_values[] =;

static const unsigned int ae5_default_delay_values[] =;

/*
 * If we never change these, probably only need them on initialization.
 */
static void ca0132_alt_init_speaker_tuning(struct hda_codec *codec)
{}

/*
 * Initialize mic for non-chromebook ca0132 implementations.
 */
static void ca0132_alt_init_analog_mics(struct hda_codec *codec)
{}

/*
 * Sets the source of stream 0x14 to connpointID 0x48, and the destination
 * connpointID to 0x91. If this isn't done, the destination is 0x71, and
 * you get no sound. I'm guessing this has to do with the Sound Blaster Z
 * having an updated DAC, which changes the destination to that DAC.
 */
static void sbz_connect_streams(struct hda_codec *codec)
{}

/*
 * Write data through ChipIO to setup proper stream destinations.
 * Not sure how it exactly works, but it seems to direct data
 * to different destinations. Example is f8 to c0, e0 to c0.
 * All I know is, if you don't set these, you get no sound.
 */
static void sbz_chipio_startup_data(struct hda_codec *codec)
{}

static void ca0132_alt_dsp_initial_mic_setup(struct hda_codec *codec)
{}

static void ae5_post_dsp_register_set(struct hda_codec *codec)
{}

static void ae5_post_dsp_param_setup(struct hda_codec *codec)
{}

static void ae5_post_dsp_pll_setup(struct hda_codec *codec)
{}

static void ae5_post_dsp_stream_setup(struct hda_codec *codec)
{}

static void ae5_post_dsp_startup_data(struct hda_codec *codec)
{}

static void ae7_post_dsp_setup_ports(struct hda_codec *codec)
{}

static void ae7_post_dsp_asi_stream_setup(struct hda_codec *codec)
{}

static void ae7_post_dsp_pll_setup(struct hda_codec *codec)
{}

static void ae7_post_dsp_asi_setup_ports(struct hda_codec *codec)
{}

/*
 * The Windows driver has commands that seem to setup ASI, which I believe to
 * be some sort of audio serial interface. My current speculation is that it's
 * related to communicating with the new DAC.
 */
static void ae7_post_dsp_asi_setup(struct hda_codec *codec)
{}

/*
 * Setup default parameters for DSP
 */
static void ca0132_setup_defaults(struct hda_codec *codec)
{}

/*
 * Setup default parameters for Recon3D/Recon3Di DSP.
 */

static void r3d_setup_defaults(struct hda_codec *codec)
{}

/*
 * Setup default parameters for the Sound Blaster Z DSP. A lot more going on
 * than the Chromebook setup.
 */
static void sbz_setup_defaults(struct hda_codec *codec)
{}

/*
 * Setup default parameters for the Sound BlasterX AE-5 DSP.
 */
static void ae5_setup_defaults(struct hda_codec *codec)
{}

/*
 * Setup default parameters for the Sound Blaster AE-7 DSP.
 */
static void ae7_setup_defaults(struct hda_codec *codec)
{}

/*
 * Initialization of flags in chip
 */
static void ca0132_init_flags(struct hda_codec *codec)
{}

/*
 * Initialization of parameters in chip
 */
static void ca0132_init_params(struct hda_codec *codec)
{}

static void ca0132_set_dsp_msr(struct hda_codec *codec, bool is96k)
{}

static bool ca0132_download_dsp_images(struct hda_codec *codec)
{}

static void ca0132_download_dsp(struct hda_codec *codec)
{}

static void ca0132_process_dsp_response(struct hda_codec *codec,
					struct hda_jack_callback *callback)
{}

static void hp_callback(struct hda_codec *codec, struct hda_jack_callback *cb)
{}

static void amic_callback(struct hda_codec *codec, struct hda_jack_callback *cb)
{}

static void ca0132_setup_unsol(struct hda_codec *codec)
{}

/*
 * Verbs tables.
 */

/* Sends before DSP download. */
static const struct hda_verb ca0132_base_init_verbs[] =;

/* Send at exit. */
static const struct hda_verb ca0132_base_exit_verbs[] =;

/* Other verbs tables. Sends after DSP download. */

static const struct hda_verb ca0132_init_verbs0[] =;

/* Extra init verbs for desktop cards. */
static const struct hda_verb ca0132_init_verbs1[] =;

static void ca0132_init_chip(struct hda_codec *codec)
{}

/*
 * Recon3Di exit specific commands.
 */
/* prevents popping noise on shutdown */
static void r3di_gpio_shutdown(struct hda_codec *codec)
{}

/*
 * Sound Blaster Z exit specific commands.
 */
static void sbz_region2_exit(struct hda_codec *codec)
{}

static void sbz_set_pin_ctl_default(struct hda_codec *codec)
{}

static void ca0132_clear_unsolicited(struct hda_codec *codec)
{}

/* On shutdown, sends commands in sets of three */
static void sbz_gpio_shutdown_commands(struct hda_codec *codec, int dir,
							int mask, int data)
{}

static void zxr_dbpro_power_state_shutdown(struct hda_codec *codec)
{}

static void sbz_exit_chip(struct hda_codec *codec)
{}

static void r3d_exit_chip(struct hda_codec *codec)
{}

static void ae5_exit_chip(struct hda_codec *codec)
{}

static void ae7_exit_chip(struct hda_codec *codec)
{}

static void zxr_exit_chip(struct hda_codec *codec)
{}

static void ca0132_exit_chip(struct hda_codec *codec)
{}

/*
 * This fixes a problem that was hard to reproduce. Very rarely, I would
 * boot up, and there would be no sound, but the DSP indicated it had loaded
 * properly. I did a few memory dumps to see if anything was different, and
 * there were a few areas of memory uninitialized with a1a2a3a4. This function
 * checks if those areas are uninitialized, and if they are, it'll attempt to
 * reload the card 3 times. Usually it fixes by the second.
 */
static void sbz_dsp_startup_check(struct hda_codec *codec)
{}

/*
 * This is for the extra volume verbs 0x797 (left) and 0x798 (right). These add
 * extra precision for decibel values. If you had the dB value in floating point
 * you would take the value after the decimal point, multiply by 64, and divide
 * by 2. So for 8.59, it's (59 * 64) / 100. Useful if someone wanted to
 * implement fixed point or floating point dB volumes. For now, I'll set them
 * to 0 just incase a value has lingered from a boot into Windows.
 */
static void ca0132_alt_vol_setup(struct hda_codec *codec)
{}

/*
 * Extra commands that don't really fit anywhere else.
 */
static void sbz_pre_dsp_setup(struct hda_codec *codec)
{}

static void r3d_pre_dsp_setup(struct hda_codec *codec)
{}

static void r3di_pre_dsp_setup(struct hda_codec *codec)
{}

/*
 * The ZxR seems to use alternative DAC's for the surround channels, which
 * require PLL PMU setup for the clock rate, I'm guessing. Without setting
 * this up, we get no audio out of the surround jacks.
 */
static void zxr_pre_dsp_setup(struct hda_codec *codec)
{}

/*
 * These are sent before the DSP is downloaded. Not sure
 * what they do, or if they're necessary. Could possibly
 * be removed. Figure they're better to leave in.
 */
static const unsigned int ca0113_mmio_init_address_sbz[] =;

static const unsigned int ca0113_mmio_init_data_sbz[] =;

static const unsigned int ca0113_mmio_init_data_zxr[] =;

static const unsigned int ca0113_mmio_init_address_ae5[] =;

static const unsigned int ca0113_mmio_init_data_ae5[] =;

static void ca0132_mmio_init_sbz(struct hda_codec *codec)
{}

static void ca0132_mmio_init_ae5(struct hda_codec *codec)
{}

static void ca0132_mmio_init(struct hda_codec *codec)
{}

static const unsigned int ca0132_ae5_register_set_addresses[] =;

static const unsigned char ca0132_ae5_register_set_data[] =;

/*
 * This function writes to some SFR's, does some region2 writes, and then
 * eventually resets the codec with the 0x7ff verb. Not quite sure why it does
 * what it does.
 */
static void ae5_register_set(struct hda_codec *codec)
{}

/*
 * Extra init functions for alternative ca0132 codecs. Done
 * here so they don't clutter up the main ca0132_init function
 * anymore than they have to.
 */
static void ca0132_alt_init(struct hda_codec *codec)
{}

static int ca0132_init(struct hda_codec *codec)
{}

static int dbpro_init(struct hda_codec *codec)
{}

static void ca0132_free(struct hda_codec *codec)
{}

static void dbpro_free(struct hda_codec *codec)
{}

static int ca0132_suspend(struct hda_codec *codec)
{}

static const struct hda_codec_ops ca0132_patch_ops =;

static const struct hda_codec_ops dbpro_patch_ops =;

static void ca0132_config(struct hda_codec *codec)
{}

static int ca0132_prepare_verbs(struct hda_codec *codec)
{}

/*
 * The Sound Blaster ZxR shares the same PCI subsystem ID as some regular
 * Sound Blaster Z cards. However, they have different HDA codec subsystem
 * ID's. So, we check for the ZxR's subsystem ID, as well as the DBPro
 * daughter boards ID.
 */
static void sbz_detect_quirk(struct hda_codec *codec)
{}

static int patch_ca0132(struct hda_codec *codec)
{}

/*
 * patch entries
 */
static const struct hda_device_id snd_hda_id_ca0132[] =;
MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_ca0132);

MODULE_LICENSE();
MODULE_DESCRIPTION();

static struct hda_codec_driver ca0132_driver =;

module_hda_codec_driver();