#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"
#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 { … };
static const char *const in_src_str[3] = …;
#define IN_SRC_NUM_OF_INPUTS …
enum { … };
enum { … };
#define EFFECT_VALS_MAX_COUNT …
static const unsigned int effect_slider_defaults[] = …;
#define EFFECT_LEVEL_SLIDERS …
#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] = …;
#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;
int req;
int direct;
unsigned int def_val;
};
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
#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[] = …;
#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[] = …;
enum speaker_range_reqs { … };
enum speaker_tuning_reqs { … };
#define SPEAKER_CHANNEL_CFG_COUNT …
enum { … };
struct ca0132_alt_speaker_channel_cfg { … };
static const struct ca0132_alt_speaker_channel_cfg speaker_channel_cfgs[] = …;
#define DSP_VOL_OUT …
#define DSP_VOL_IN …
struct ct_dsp_volume_ctl { … };
static const struct ct_dsp_volume_ctl ca0132_alt_vol_ctls[] = …;
#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 = …;
#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[] = …;
struct chipio_stream_remap_data { … };
static const struct chipio_stream_remap_data stream_remap_data[] = …;
enum hda_cmd_vendor_io { … };
enum control_flag_id { … };
enum control_param_id { … };
enum hda_vendor_status_dspio { … };
enum hda_vendor_status_chipio { … };
enum ca0132_sample_rate { … };
enum dsp_download_state { … };
#define get_hdafmt_chs(fmt) …
#define get_hdafmt_bits(fmt) …
#define get_hdafmt_rate(fmt) …
#define get_hdafmt_type(fmt) …
struct ca0132_spec { … };
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[] = …;
static const struct hda_pintbl sbz_pincfgs[] = …;
static const struct hda_pintbl zxr_pincfgs[] = …;
static const struct hda_pintbl r3d_pincfgs[] = …;
static const struct hda_pintbl ae5_pincfgs[] = …;
static const struct hda_pintbl r3di_pincfgs[] = …;
static const struct hda_pintbl ae7_pincfgs[] = …;
static const struct snd_pci_quirk ca0132_quirks[] = …;
#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[] = …;
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)
{ … }
static int chipio_send(struct hda_codec *codec,
unsigned int reg,
unsigned int data)
{ … }
static int chipio_write_address(struct hda_codec *codec,
unsigned int chip_addx)
{ … }
static int chipio_write_data(struct hda_codec *codec, unsigned int data)
{ … }
static int chipio_write_data_multiple(struct hda_codec *codec,
const u32 *data,
unsigned int count)
{ … }
static int chipio_read_data(struct hda_codec *codec, unsigned int *data)
{ … }
static int chipio_write(struct hda_codec *codec,
unsigned int chip_addx, const unsigned int data)
{ … }
static int chipio_write_no_mutex(struct hda_codec *codec,
unsigned int chip_addx, const unsigned int data)
{ … }
static int chipio_write_multiple(struct hda_codec *codec,
u32 chip_addx,
const u32 *data,
unsigned int count)
{ … }
static int chipio_read(struct hda_codec *codec,
unsigned int chip_addx, unsigned int *data)
{ … }
static void chipio_set_control_flag(struct hda_codec *codec,
enum control_flag_id flag_id,
bool flag_state)
{ … }
static void chipio_set_control_param(struct hda_codec *codec,
enum control_param_id param_id, int param_val)
{ … }
static void chipio_set_control_param_no_mutex(struct hda_codec *codec,
enum control_param_id param_id, int param_val)
{ … }
static void chipio_set_stream_source_dest(struct hda_codec *codec,
int streamid, int source_point, int dest_point)
{ … }
static void chipio_set_stream_channels(struct hda_codec *codec,
int streamid, unsigned int channels)
{ … }
static void chipio_set_stream_control(struct hda_codec *codec,
int streamid, int enable)
{ … }
static void chipio_get_stream_control(struct hda_codec *codec,
int streamid, unsigned int *enable)
{ … }
static void chipio_set_conn_rate_no_mutex(struct hda_codec *codec,
int connid, enum ca0132_sample_rate rate)
{ … }
static void chipio_set_conn_rate(struct hda_codec *codec,
int connid, enum ca0132_sample_rate rate)
{ … }
static void chipio_8051_write_direct(struct hda_codec *codec,
unsigned int addr, unsigned int data)
{ … }
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)
{ … }
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)
{ … }
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)
{ … }
static void chipio_enable_clocks(struct hda_codec *codec)
{ … }
static int dspio_send(struct hda_codec *codec, unsigned int reg,
unsigned int data)
{ … }
static void dspio_write_wait(struct hda_codec *codec)
{ … }
static int dspio_write(struct hda_codec *codec, unsigned int scp_data)
{ … }
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)
{ … }
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)
{ … }
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 …
struct scp_msg { … };
static void dspio_clear_response_queue(struct hda_codec *codec)
{ … }
static int dspio_get_response_data(struct hda_codec *codec)
{ … }
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)
{ … }
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)
{ … }
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)
{ … }
static int dspio_alloc_dma_chan(struct hda_codec *codec, unsigned int *dma_chan)
{ … }
static int dspio_free_dma_chan(struct hda_codec *codec, unsigned int dma_chan)
{ … }
static int dsp_set_run_state(struct hda_codec *codec)
{ … }
static int dsp_reset(struct hda_codec *codec)
{ … }
static unsigned int dsp_chip_to_dsp_addx(unsigned int chip_addx,
bool *code, bool *yram)
{ … }
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)
{ … }
static int dsp_dma_setup(struct hda_codec *codec,
unsigned int chip_addx,
unsigned int count,
unsigned int dma_chan)
{ … }
static int dsp_dma_start(struct hda_codec *codec,
unsigned int dma_chan, bool ovly)
{ … }
static int dsp_dma_stop(struct hda_codec *codec,
unsigned int dma_chan, bool ovly)
{ … }
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)
{ … }
static int dsp_free_router_ports(struct hda_codec *codec)
{ … }
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)
{ … }
static int dsp_free_ports(struct hda_codec *codec)
{ … }
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)
{ … }
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)
{ … }
#define INVALID_DMA_CHANNEL …
static int dspxfr_hci_write(struct hda_codec *codec,
const struct dsp_image_seg *fls)
{ … }
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)
{ … }
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)
{ … }
static void dspload_post_setup(struct hda_codec *codec)
{ … }
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)
{ … }
static void ca0113_mmio_gpio_set(struct hda_codec *codec, unsigned int gpio_pin,
bool enable)
{ … }
static void ca0113_mmio_command_set(struct hda_codec *codec, unsigned int group,
unsigned int target, unsigned int value)
{ … }
static void ca0113_mmio_command_set_type2(struct hda_codec *codec,
unsigned int group, unsigned int target, unsigned int value)
{ … }
static void ca0132_gpio_init(struct hda_codec *codec)
{ … }
static void ca0132_gpio_setup(struct hda_codec *codec)
{ … }
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)
{ … }
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)
{ … }
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)
{ … }
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)
{ … }
#define CA0132_CODEC_VOL_MONO(xname, nid, channel, dir) …
#define CA0132_ALT_CODEC_VOL_MONO(xname, nid, channel, dir) …
#define CA0132_CODEC_MUTE_MONO(xname, nid, channel, dir) …
#define CA0132_CODEC_VOL(xname, nid, dir) …
#define CA0132_ALT_CODEC_VOL(xname, nid, dir) …
#define CA0132_CODEC_MUTE(xname, nid, dir) …
static const unsigned int float_vol_db_lookup[] = …;
static const unsigned int float_zero_to_one_lookup[] = …;
static const unsigned int float_xbass_xover_lookup[] = …;
#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;
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;
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;
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;
spec->cur_ctl_vals[WEDGE_ANGLE - TUNING_CTL_START_NID] = 10;
spec->cur_ctl_vals[SVM_LEVEL - TUNING_CTL_START_NID] = 74;
for (i = 2; i < TUNING_CTLS_COUNT; i++)
spec->cur_ctl_vals[i] = 24;
}
#endif
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)
{ … }
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)
{ … }
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);
static int ca0132_set_vipsource(struct hda_codec *codec, int val)
{ … }
static int ca0132_alt_set_vipsource(struct hda_codec *codec, int val)
{ … }
static int ca0132_select_mic(struct hda_codec *codec)
{ … }
static int ca0132_alt_select_in(struct hda_codec *codec)
{ … }
static bool ca0132_is_vnode_effective(struct hda_codec *codec,
hda_nid_t vnid,
hda_nid_t *shared_nid)
{ … }
static int ca0132_voicefx_set(struct hda_codec *codec, int enable)
{ … }
static int ca0132_effects_set(struct hda_codec *codec, hda_nid_t nid, long val)
{ … }
static int ca0132_pe_switch_set(struct hda_codec *codec)
{ … }
static int stop_mic1(struct hda_codec *codec)
{ … }
static void resume_mic1(struct hda_codec *codec, unsigned int oldval)
{ … }
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)
{ … }
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)
{ … }
static void ca0132_alt_bass_redirection_xover_set(struct hda_codec *codec,
long idx)
{ … }
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)
{ … }
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)
{ … }
#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)
{ … }
#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)
{ … }
#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)
{ … }
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)
{ … }
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)
{ … }
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)
{ … }
#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)
{ … }
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)
{ … }
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)
{ … }
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)
{ … }
static int ca0132_alt_add_effect_slider(struct hda_codec *codec, hda_nid_t nid,
const char *pfx, int dir)
{ … }
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)
{ … }
static int add_ca0132_alt_eq_presets(struct hda_codec *codec)
{ … }
static int ca0132_alt_add_svm_enum(struct hda_codec *codec)
{ … }
static int ca0132_alt_add_output_enum(struct hda_codec *codec)
{ … }
static int ca0132_alt_add_speaker_channel_cfg_enum(struct hda_codec *codec)
{ … }
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)
{ … }
static int ca0132_alt_add_bass_redirection_crossover(struct hda_codec *codec)
{ … }
static int ca0132_alt_add_bass_redirection_switch(struct hda_codec *codec)
{ … }
static int ca0132_alt_add_input_enum(struct hda_codec *codec)
{ … }
static int ca0132_alt_add_mic_boost_enum(struct hda_codec *codec)
{ … }
static int ae5_add_headphone_gain_enum(struct hda_codec *codec)
{ … }
static int ae5_add_sound_filter_enum(struct hda_codec *codec)
{ … }
static int zxr_add_headphone_gain_switch(struct hda_codec *codec)
{ … }
static const char * const ca0132_alt_follower_pfxs[] = …;
static const struct snd_pcm_chmap_elem ca0132_alt_chmaps[] = …;
static void ca0132_alt_add_chmap_ctls(struct hda_codec *codec)
{ … }
static const struct snd_kcontrol_new ca0132_mixer[] = …;
static const struct snd_kcontrol_new desktop_mixer[] = …;
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)
{ … }
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)
{ … }
static void ca0132_set_dmic(struct hda_codec *codec, int enable)
{ … }
static void ca0132_init_dmic(struct hda_codec *codec)
{ … }
static void ca0132_init_analog_mic2(struct hda_codec *codec)
{ … }
static void ca0132_refresh_widget_caps(struct hda_codec *codec)
{ … }
static void ca0132_alt_free_active_dma_channels(struct hda_codec *codec)
{ … }
static void ca0132_alt_start_dsp_audio_streams(struct hda_codec *codec)
{ … }
static void chipio_remap_stream(struct hda_codec *codec,
const struct chipio_stream_remap_data *remap_data)
{ … }
static const unsigned int sbz_default_delay_values[] = …;
static const unsigned int zxr_default_delay_values[] = …;
static const unsigned int ae5_default_delay_values[] = …;
static void ca0132_alt_init_speaker_tuning(struct hda_codec *codec)
{ … }
static void ca0132_alt_init_analog_mics(struct hda_codec *codec)
{ … }
static void sbz_connect_streams(struct hda_codec *codec)
{ … }
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)
{ … }
static void ae7_post_dsp_asi_setup(struct hda_codec *codec)
{ … }
static void ca0132_setup_defaults(struct hda_codec *codec)
{ … }
static void r3d_setup_defaults(struct hda_codec *codec)
{ … }
static void sbz_setup_defaults(struct hda_codec *codec)
{ … }
static void ae5_setup_defaults(struct hda_codec *codec)
{ … }
static void ae7_setup_defaults(struct hda_codec *codec)
{ … }
static void ca0132_init_flags(struct hda_codec *codec)
{ … }
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)
{ … }
static const struct hda_verb ca0132_base_init_verbs[] = …;
static const struct hda_verb ca0132_base_exit_verbs[] = …;
static const struct hda_verb ca0132_init_verbs0[] = …;
static const struct hda_verb ca0132_init_verbs1[] = …;
static void ca0132_init_chip(struct hda_codec *codec)
{ … }
static void r3di_gpio_shutdown(struct hda_codec *codec)
{ … }
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)
{ … }
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)
{ … }
static void sbz_dsp_startup_check(struct hda_codec *codec)
{ … }
static void ca0132_alt_vol_setup(struct hda_codec *codec)
{ … }
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)
{ … }
static void zxr_pre_dsp_setup(struct hda_codec *codec)
{ … }
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[] = …;
static void ae5_register_set(struct hda_codec *codec)
{ … }
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)
{ … }
static void sbz_detect_quirk(struct hda_codec *codec)
{ … }
static int patch_ca0132(struct hda_codec *codec)
{ … }
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(…) …;