#include <linux/cleanup.h>
#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/mfd/wcd934x/registers.h>
#include <linux/mfd/wcd934x/wcd934x.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/of_clk.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include <linux/slimbus.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/soc-dapm.h>
#include <sound/tlv.h>
#include "wcd-clsh-v2.h"
#include "wcd-mbhc-v2.h"
#define WCD934X_RATES_MASK …
#define WCD934X_FRAC_RATES_MASK …
#define WCD934X_FORMATS_S16_S24_LE …
#define SLAVE_PORT_WATER_MARK_6BYTES …
#define SLAVE_PORT_WATER_MARK_9BYTES …
#define SLAVE_PORT_WATER_MARK_12BYTES …
#define SLAVE_PORT_WATER_MARK_15BYTES …
#define SLAVE_PORT_WATER_MARK_SHIFT …
#define SLAVE_PORT_ENABLE …
#define SLAVE_PORT_DISABLE …
#define WCD934X_SLIM_WATER_MARK_VAL …
#define WCD934X_SLIM_NUM_PORT_REG …
#define WCD934X_SLIM_PGD_PORT_INT_TX_EN0 …
#define WCD934X_SLIM_IRQ_OVERFLOW …
#define WCD934X_SLIM_IRQ_UNDERFLOW …
#define WCD934X_SLIM_IRQ_PORT_CLOSED …
#define WCD934X_MCLK_CLK_12P288MHZ …
#define WCD934X_MCLK_CLK_9P6MHZ …
#define WCD9XXX_DMIC_SAMPLE_RATE_2P4MHZ …
#define WCD9XXX_DMIC_SAMPLE_RATE_4P8MHZ …
#define WCD9XXX_DMIC_SAMPLE_RATE_4P096MHZ …
#define WCD934X_DMIC_CLK_DIV_2 …
#define WCD934X_DMIC_CLK_DIV_3 …
#define WCD934X_DMIC_CLK_DIV_4 …
#define WCD934X_DMIC_CLK_DIV_6 …
#define WCD934X_DMIC_CLK_DIV_8 …
#define WCD934X_DMIC_CLK_DIV_16 …
#define WCD934X_DMIC_CLK_DRIVE_DEFAULT …
#define TX_HPF_CUT_OFF_FREQ_MASK …
#define CF_MIN_3DB_4HZ …
#define CF_MIN_3DB_75HZ …
#define CF_MIN_3DB_150HZ …
#define WCD934X_RX_START …
#define WCD934X_NUM_INTERPOLATORS …
#define WCD934X_RX_PATH_CTL_OFFSET …
#define WCD934X_MAX_VALID_ADC_MUX …
#define WCD934X_INVALID_ADC_MUX …
#define WCD934X_SLIM_RX_CH(p) …
#define WCD934X_SLIM_TX_CH(p) …
#define DSD_DISABLED_MASK …
#define SLNQ_DISABLED_MASK …
#define DSD_DISABLED …
#define SLNQ_DISABLED …
#define WCD_VERSION_WCD9340_1_0 …
#define WCD_VERSION_WCD9341_1_0 …
#define WCD_VERSION_WCD9340_1_1 …
#define WCD_VERSION_WCD9341_1_1 …
#define WCD934X_AMIC_PWR_LEVEL_LP …
#define WCD934X_AMIC_PWR_LEVEL_DEFAULT …
#define WCD934X_AMIC_PWR_LEVEL_HP …
#define WCD934X_AMIC_PWR_LEVEL_HYBRID …
#define WCD934X_AMIC_PWR_LVL_MASK …
#define WCD934X_AMIC_PWR_LVL_SHIFT …
#define WCD934X_DEC_PWR_LVL_MASK …
#define WCD934X_DEC_PWR_LVL_LP …
#define WCD934X_DEC_PWR_LVL_HP …
#define WCD934X_DEC_PWR_LVL_DF …
#define WCD934X_DEC_PWR_LVL_HYBRID …
#define WCD934X_DEF_MICBIAS_MV …
#define WCD934X_MAX_MICBIAS_MV …
#define WCD_IIR_FILTER_SIZE …
#define WCD_IIR_FILTER_CTL(xname, iidx, bidx) …
#define WCD934X_ZDET_VAL_32 …
#define WCD934X_ZDET_VAL_400 …
#define WCD934X_ZDET_VAL_1200 …
#define WCD934X_ZDET_VAL_100K …
#define WCD934X_ZDET_FLOATING_IMPEDANCE …
#define WCD934X_ZDET_NUM_MEASUREMENTS …
#define WCD934X_MBHC_GET_C1(c) …
#define WCD934X_MBHC_GET_X1(x) …
#define WCD934X_MBHC_IS_SECOND_RAMP_REQUIRED(z) …
#define WCD934X_MBHC_ZDET_CONST …
#define WCD934X_MBHC_MOISTURE_RREF …
#define WCD934X_MBHC_MAX_BUTTONS …
#define WCD_MBHC_HS_V_MAX …
#define WCD934X_INTERPOLATOR_PATH(id) …
#define WCD934X_INTERPOLATOR_MIX2(id) …
#define WCD934X_SLIM_RX_AIF_PATH(id) …
#define WCD934X_ADC_MUX(id) …
#define WCD934X_IIR_INP_MUX(id) …
#define WCD934X_SLIM_TX_AIF_PATH(id) …
#define WCD934X_MAX_MICBIAS …
enum { … };
enum { … };
enum { … };
enum { … };
struct wcd934x_slim_ch { … };
static const struct wcd934x_slim_ch wcd934x_tx_chs[WCD934X_TX_MAX] = …;
static const struct wcd934x_slim_ch wcd934x_rx_chs[WCD934X_RX_MAX] = …;
enum { … };
enum { … };
enum { … };
enum { … };
enum { … };
enum { … };
struct interp_sample_rate { … };
static const struct interp_sample_rate sr_val_tbl[] = …;
struct wcd934x_mbhc_zdet_param { … };
struct wcd_slim_codec_dai_data { … };
static const struct regmap_range_cfg wcd934x_ifc_ranges[] = …;
static const struct regmap_config wcd934x_ifc_regmap_config = …;
struct wcd934x_codec { … };
#define to_wcd934x_codec(_hw) …
struct wcd_iir_filter_ctl { … };
static const DECLARE_TLV_DB_SCALE(digital_gain, -8400, 100, -8400);
static const DECLARE_TLV_DB_SCALE(line_gain, 0, 7, 1);
static const DECLARE_TLV_DB_SCALE(analog_gain, 0, 25, 1);
static const DECLARE_TLV_DB_SCALE(ear_pa_gain, 0, 150, 0);
static const char * const cf_text[] = …;
static const char * const rx_cf_text[] = …;
static const char * const rx_hph_mode_mux_text[] = …;
static const char *const slim_rx_mux_text[] = …;
static const char * const rx_int0_7_mix_mux_text[] = …;
static const char * const rx_int_mix_mux_text[] = …;
static const char * const rx_prim_mix_text[] = …;
static const char * const rx_sidetone_mix_text[] = …;
static const char * const iir_inp_mux_text[] = …;
static const char * const rx_int_dem_inp_mux_text[] = …;
static const char * const rx_int0_1_interp_mux_text[] = …;
static const char * const rx_int1_1_interp_mux_text[] = …;
static const char * const rx_int2_1_interp_mux_text[] = …;
static const char * const rx_int3_1_interp_mux_text[] = …;
static const char * const rx_int4_1_interp_mux_text[] = …;
static const char * const rx_int7_1_interp_mux_text[] = …;
static const char * const rx_int8_1_interp_mux_text[] = …;
static const char * const rx_int0_2_interp_mux_text[] = …;
static const char * const rx_int1_2_interp_mux_text[] = …;
static const char * const rx_int2_2_interp_mux_text[] = …;
static const char * const rx_int3_2_interp_mux_text[] = …;
static const char * const rx_int4_2_interp_mux_text[] = …;
static const char * const rx_int7_2_interp_mux_text[] = …;
static const char * const rx_int8_2_interp_mux_text[] = …;
static const char * const dmic_mux_text[] = …;
static const char * const amic_mux_text[] = …;
static const char * const amic4_5_sel_text[] = …;
static const char * const adc_mux_text[] = …;
static const char * const cdc_if_tx0_mux_text[] = …;
static const char * const cdc_if_tx1_mux_text[] = …;
static const char * const cdc_if_tx2_mux_text[] = …;
static const char * const cdc_if_tx3_mux_text[] = …;
static const char * const cdc_if_tx4_mux_text[] = …;
static const char * const cdc_if_tx5_mux_text[] = …;
static const char * const cdc_if_tx6_mux_text[] = …;
static const char * const cdc_if_tx7_mux_text[] = …;
static const char * const cdc_if_tx8_mux_text[] = …;
static const char * const cdc_if_tx9_mux_text[] = …;
static const char * const cdc_if_tx10_mux_text[] = …;
static const char * const cdc_if_tx11_mux_text[] = …;
static const char * const cdc_if_tx11_inp1_mux_text[] = …;
static const char * const cdc_if_tx13_mux_text[] = …;
static const char * const cdc_if_tx13_inp1_mux_text[] = …;
static const struct soc_enum cf_dec0_enum = …;
static const struct soc_enum cf_dec1_enum = …;
static const struct soc_enum cf_dec2_enum = …;
static const struct soc_enum cf_dec3_enum = …;
static const struct soc_enum cf_dec4_enum = …;
static const struct soc_enum cf_dec5_enum = …;
static const struct soc_enum cf_dec6_enum = …;
static const struct soc_enum cf_dec7_enum = …;
static const struct soc_enum cf_dec8_enum = …;
static const struct soc_enum cf_int0_1_enum = …;
static SOC_ENUM_SINGLE_DECL(cf_int0_2_enum, WCD934X_CDC_RX0_RX_PATH_MIX_CFG, 2,
rx_cf_text);
static const struct soc_enum cf_int1_1_enum = …;
static SOC_ENUM_SINGLE_DECL(cf_int1_2_enum, WCD934X_CDC_RX1_RX_PATH_MIX_CFG, 2,
rx_cf_text);
static const struct soc_enum cf_int2_1_enum = …;
static SOC_ENUM_SINGLE_DECL(cf_int2_2_enum, WCD934X_CDC_RX2_RX_PATH_MIX_CFG, 2,
rx_cf_text);
static const struct soc_enum cf_int3_1_enum = …;
static SOC_ENUM_SINGLE_DECL(cf_int3_2_enum, WCD934X_CDC_RX3_RX_PATH_MIX_CFG, 2,
rx_cf_text);
static const struct soc_enum cf_int4_1_enum = …;
static SOC_ENUM_SINGLE_DECL(cf_int4_2_enum, WCD934X_CDC_RX4_RX_PATH_MIX_CFG, 2,
rx_cf_text);
static const struct soc_enum cf_int7_1_enum = …;
static SOC_ENUM_SINGLE_DECL(cf_int7_2_enum, WCD934X_CDC_RX7_RX_PATH_MIX_CFG, 2,
rx_cf_text);
static const struct soc_enum cf_int8_1_enum = …;
static SOC_ENUM_SINGLE_DECL(cf_int8_2_enum, WCD934X_CDC_RX8_RX_PATH_MIX_CFG, 2,
rx_cf_text);
static const struct soc_enum rx_hph_mode_mux_enum = …;
static const struct soc_enum slim_rx_mux_enum = …;
static const struct soc_enum rx_int0_2_mux_chain_enum = …;
static const struct soc_enum rx_int1_2_mux_chain_enum = …;
static const struct soc_enum rx_int2_2_mux_chain_enum = …;
static const struct soc_enum rx_int3_2_mux_chain_enum = …;
static const struct soc_enum rx_int4_2_mux_chain_enum = …;
static const struct soc_enum rx_int7_2_mux_chain_enum = …;
static const struct soc_enum rx_int8_2_mux_chain_enum = …;
static const struct soc_enum rx_int0_1_mix_inp0_chain_enum = …;
static const struct soc_enum rx_int0_1_mix_inp1_chain_enum = …;
static const struct soc_enum rx_int0_1_mix_inp2_chain_enum = …;
static const struct soc_enum rx_int1_1_mix_inp0_chain_enum = …;
static const struct soc_enum rx_int1_1_mix_inp1_chain_enum = …;
static const struct soc_enum rx_int1_1_mix_inp2_chain_enum = …;
static const struct soc_enum rx_int2_1_mix_inp0_chain_enum = …;
static const struct soc_enum rx_int2_1_mix_inp1_chain_enum = …;
static const struct soc_enum rx_int2_1_mix_inp2_chain_enum = …;
static const struct soc_enum rx_int3_1_mix_inp0_chain_enum = …;
static const struct soc_enum rx_int3_1_mix_inp1_chain_enum = …;
static const struct soc_enum rx_int3_1_mix_inp2_chain_enum = …;
static const struct soc_enum rx_int4_1_mix_inp0_chain_enum = …;
static const struct soc_enum rx_int4_1_mix_inp1_chain_enum = …;
static const struct soc_enum rx_int4_1_mix_inp2_chain_enum = …;
static const struct soc_enum rx_int7_1_mix_inp0_chain_enum = …;
static const struct soc_enum rx_int7_1_mix_inp1_chain_enum = …;
static const struct soc_enum rx_int7_1_mix_inp2_chain_enum = …;
static const struct soc_enum rx_int8_1_mix_inp0_chain_enum = …;
static const struct soc_enum rx_int8_1_mix_inp1_chain_enum = …;
static const struct soc_enum rx_int8_1_mix_inp2_chain_enum = …;
static const struct soc_enum rx_int0_mix2_inp_mux_enum = …;
static const struct soc_enum rx_int1_mix2_inp_mux_enum = …;
static const struct soc_enum rx_int2_mix2_inp_mux_enum = …;
static const struct soc_enum rx_int3_mix2_inp_mux_enum = …;
static const struct soc_enum rx_int4_mix2_inp_mux_enum = …;
static const struct soc_enum rx_int7_mix2_inp_mux_enum = …;
static const struct soc_enum iir0_inp0_mux_enum = …;
static const struct soc_enum iir0_inp1_mux_enum = …;
static const struct soc_enum iir0_inp2_mux_enum = …;
static const struct soc_enum iir0_inp3_mux_enum = …;
static const struct soc_enum iir1_inp0_mux_enum = …;
static const struct soc_enum iir1_inp1_mux_enum = …;
static const struct soc_enum iir1_inp2_mux_enum = …;
static const struct soc_enum iir1_inp3_mux_enum = …;
static const struct soc_enum rx_int0_dem_inp_mux_enum = …;
static const struct soc_enum rx_int1_dem_inp_mux_enum = …;
static const struct soc_enum rx_int2_dem_inp_mux_enum = …;
static const struct soc_enum tx_adc_mux0_enum = …;
static const struct soc_enum tx_adc_mux1_enum = …;
static const struct soc_enum tx_adc_mux2_enum = …;
static const struct soc_enum tx_adc_mux3_enum = …;
static const struct soc_enum tx_adc_mux4_enum = …;
static const struct soc_enum tx_adc_mux5_enum = …;
static const struct soc_enum tx_adc_mux6_enum = …;
static const struct soc_enum tx_adc_mux7_enum = …;
static const struct soc_enum tx_adc_mux8_enum = …;
static const struct soc_enum rx_int0_1_interp_mux_enum = …;
static const struct soc_enum rx_int1_1_interp_mux_enum = …;
static const struct soc_enum rx_int2_1_interp_mux_enum = …;
static const struct soc_enum rx_int3_1_interp_mux_enum = …;
static const struct soc_enum rx_int4_1_interp_mux_enum = …;
static const struct soc_enum rx_int7_1_interp_mux_enum = …;
static const struct soc_enum rx_int8_1_interp_mux_enum = …;
static const struct soc_enum rx_int0_2_interp_mux_enum = …;
static const struct soc_enum rx_int1_2_interp_mux_enum = …;
static const struct soc_enum rx_int2_2_interp_mux_enum = …;
static const struct soc_enum rx_int3_2_interp_mux_enum = …;
static const struct soc_enum rx_int4_2_interp_mux_enum = …;
static const struct soc_enum rx_int7_2_interp_mux_enum = …;
static const struct soc_enum rx_int8_2_interp_mux_enum = …;
static const struct soc_enum tx_dmic_mux0_enum = …;
static const struct soc_enum tx_dmic_mux1_enum = …;
static const struct soc_enum tx_dmic_mux2_enum = …;
static const struct soc_enum tx_dmic_mux3_enum = …;
static const struct soc_enum tx_dmic_mux4_enum = …;
static const struct soc_enum tx_dmic_mux5_enum = …;
static const struct soc_enum tx_dmic_mux6_enum = …;
static const struct soc_enum tx_dmic_mux7_enum = …;
static const struct soc_enum tx_dmic_mux8_enum = …;
static const struct soc_enum tx_amic_mux0_enum = …;
static const struct soc_enum tx_amic_mux1_enum = …;
static const struct soc_enum tx_amic_mux2_enum = …;
static const struct soc_enum tx_amic_mux3_enum = …;
static const struct soc_enum tx_amic_mux4_enum = …;
static const struct soc_enum tx_amic_mux5_enum = …;
static const struct soc_enum tx_amic_mux6_enum = …;
static const struct soc_enum tx_amic_mux7_enum = …;
static const struct soc_enum tx_amic_mux8_enum = …;
static const struct soc_enum tx_amic4_5_enum = …;
static const struct soc_enum cdc_if_tx0_mux_enum = …;
static const struct soc_enum cdc_if_tx1_mux_enum = …;
static const struct soc_enum cdc_if_tx2_mux_enum = …;
static const struct soc_enum cdc_if_tx3_mux_enum = …;
static const struct soc_enum cdc_if_tx4_mux_enum = …;
static const struct soc_enum cdc_if_tx5_mux_enum = …;
static const struct soc_enum cdc_if_tx6_mux_enum = …;
static const struct soc_enum cdc_if_tx7_mux_enum = …;
static const struct soc_enum cdc_if_tx8_mux_enum = …;
static const struct soc_enum cdc_if_tx9_mux_enum = …;
static const struct soc_enum cdc_if_tx10_mux_enum = …;
static const struct soc_enum cdc_if_tx11_inp1_mux_enum = …;
static const struct soc_enum cdc_if_tx11_mux_enum = …;
static const struct soc_enum cdc_if_tx13_inp1_mux_enum = …;
static const struct soc_enum cdc_if_tx13_mux_enum = …;
static const struct wcd_mbhc_field wcd_mbhc_fields[WCD_MBHC_REG_FUNC_MAX] = …;
static int wcd934x_set_sido_input_src(struct wcd934x_codec *wcd, int sido_src)
{ … }
static int wcd934x_enable_ana_bias_and_sysclk(struct wcd934x_codec *wcd)
{ … }
static int wcd934x_disable_ana_bias_and_syclk(struct wcd934x_codec *wcd)
{ … }
static int __wcd934x_cdc_mclk_enable(struct wcd934x_codec *wcd, bool enable)
{ … }
static int wcd934x_codec_enable_mclk(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kc, int event)
{ … }
static int wcd934x_get_version(struct wcd934x_codec *wcd)
{ … }
static void wcd934x_enable_efuse_sensing(struct wcd934x_codec *wcd)
{ … }
static int wcd934x_swrm_clock(struct wcd934x_codec *wcd, bool enable)
{ … }
static int wcd934x_set_prim_interpolator_rate(struct snd_soc_dai *dai,
u8 rate_val, u32 rate)
{ … }
static int wcd934x_set_mix_interpolator_rate(struct snd_soc_dai *dai,
int rate_val, u32 rate)
{ … }
static int wcd934x_set_interpolator_rate(struct snd_soc_dai *dai,
u32 sample_rate)
{ … }
static int wcd934x_set_decimator_rate(struct snd_soc_dai *dai,
u8 rate_val, u32 rate)
{ … }
static int wcd934x_slim_set_hw_params(struct wcd934x_codec *wcd,
struct wcd_slim_codec_dai_data *dai_data,
int direction)
{ … }
static int wcd934x_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static int wcd934x_hw_free(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
static int wcd934x_trigger(struct snd_pcm_substream *substream, int cmd,
struct snd_soc_dai *dai)
{ … }
static int wcd934x_set_channel_map(struct snd_soc_dai *dai,
unsigned int tx_num,
const unsigned int *tx_slot,
unsigned int rx_num,
const unsigned int *rx_slot)
{ … }
static int wcd934x_get_channel_map(const struct snd_soc_dai *dai,
unsigned int *tx_num, unsigned int *tx_slot,
unsigned int *rx_num, unsigned int *rx_slot)
{ … }
static const struct snd_soc_dai_ops wcd934x_dai_ops = …;
static struct snd_soc_dai_driver wcd934x_slim_dais[] = …;
static int swclk_gate_enable(struct clk_hw *hw)
{ … }
static void swclk_gate_disable(struct clk_hw *hw)
{ … }
static int swclk_gate_is_enabled(struct clk_hw *hw)
{ … }
static unsigned long swclk_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate)
{ … }
static const struct clk_ops swclk_gate_ops = …;
static struct clk *wcd934x_register_mclk_output(struct wcd934x_codec *wcd)
{ … }
static int wcd934x_get_micbias_val(struct device *dev, const char *micbias,
u32 *micb_mv)
{ … }
static int wcd934x_init_dmic(struct snd_soc_component *comp)
{ … }
static void wcd934x_hw_init(struct wcd934x_codec *wcd)
{ … }
static int wcd934x_comp_init(struct snd_soc_component *component)
{ … }
static irqreturn_t wcd934x_slim_irq_handler(int irq, void *data)
{ … }
static void wcd934x_mbhc_clk_setup(struct snd_soc_component *component,
bool enable)
{ … }
static void wcd934x_mbhc_mbhc_bias_control(struct snd_soc_component *component,
bool enable)
{ … }
static void wcd934x_mbhc_program_btn_thr(struct snd_soc_component *component,
int *btn_low, int *btn_high,
int num_btn, bool is_micbias)
{ … }
static bool wcd934x_mbhc_micb_en_status(struct snd_soc_component *component, int micb_num)
{ … }
static void wcd934x_mbhc_hph_l_pull_up_control(struct snd_soc_component *component,
enum mbhc_hs_pullup_iref pull_up_cur)
{ … }
static int wcd934x_micbias_control(struct snd_soc_component *component,
int micb_num, int req, bool is_dapm)
{ … }
static int wcd934x_mbhc_request_micbias(struct snd_soc_component *component,
int micb_num, int req)
{ … }
static void wcd934x_mbhc_micb_ramp_control(struct snd_soc_component *component,
bool enable)
{ … }
static int wcd934x_get_micb_vout_ctl_val(u32 micb_mv)
{ … }
static int wcd934x_mbhc_micb_adjust_voltage(struct snd_soc_component *component,
int req_volt, int micb_num)
{ … }
static int wcd934x_mbhc_micb_ctrl_threshold_mic(struct snd_soc_component *component,
int micb_num, bool req_en)
{ … }
static void wcd934x_mbhc_get_result_params(struct wcd934x_codec *wcd934x,
s16 *d1_a, u16 noff,
int32_t *zdet)
{ … }
static void wcd934x_mbhc_zdet_ramp(struct snd_soc_component *component,
struct wcd934x_mbhc_zdet_param *zdet_param,
int32_t *zl, int32_t *zr, s16 *d1_a)
{ … }
static void wcd934x_wcd_mbhc_qfuse_cal(struct snd_soc_component *component,
int32_t *z_val, int flag_l_r)
{ … }
static void wcd934x_wcd_mbhc_calc_impedance(struct snd_soc_component *component,
uint32_t *zl, uint32_t *zr)
{ … }
static void wcd934x_mbhc_gnd_det_ctrl(struct snd_soc_component *component,
bool enable)
{ … }
static void wcd934x_mbhc_hph_pull_down_ctrl(struct snd_soc_component *component,
bool enable)
{ … }
static const struct wcd_mbhc_cb mbhc_cb = …;
static int wcd934x_get_hph_type(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int wcd934x_hph_impedance_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new hph_type_detect_controls[] = …;
static const struct snd_kcontrol_new impedance_detect_controls[] = …;
static int wcd934x_mbhc_init(struct snd_soc_component *component)
{ … }
static void wcd934x_mbhc_deinit(struct snd_soc_component *component)
{ … }
static int wcd934x_comp_probe(struct snd_soc_component *component)
{ … }
static void wcd934x_comp_remove(struct snd_soc_component *comp)
{ … }
static int wcd934x_comp_set_sysclk(struct snd_soc_component *comp,
int clk_id, int source,
unsigned int freq, int dir)
{ … }
static uint32_t get_iir_band_coeff(struct snd_soc_component *component,
int iir_idx, int band_idx, int coeff_idx)
{ … }
static void set_iir_band_coeff(struct snd_soc_component *component,
int iir_idx, int band_idx, uint32_t value)
{ … }
static int wcd934x_put_iir_band_audio_mixer(
struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int wcd934x_get_iir_band_audio_mixer(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int wcd934x_iir_filter_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *ucontrol)
{ … }
static int wcd934x_compander_get(struct snd_kcontrol *kc,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int wcd934x_compander_set(struct snd_kcontrol *kc,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int wcd934x_rx_hph_mode_get(struct snd_kcontrol *kc,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int wcd934x_rx_hph_mode_put(struct snd_kcontrol *kc,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int slim_rx_mux_get(struct snd_kcontrol *kc,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int slim_rx_mux_to_dai_id(int mux)
{ … }
static int slim_rx_mux_put(struct snd_kcontrol *kc,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int wcd934x_int_dem_inp_mux_put(struct snd_kcontrol *kc,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int wcd934x_dec_enum_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new rx_int0_2_mux = …;
static const struct snd_kcontrol_new rx_int1_2_mux = …;
static const struct snd_kcontrol_new rx_int2_2_mux = …;
static const struct snd_kcontrol_new rx_int3_2_mux = …;
static const struct snd_kcontrol_new rx_int4_2_mux = …;
static const struct snd_kcontrol_new rx_int7_2_mux = …;
static const struct snd_kcontrol_new rx_int8_2_mux = …;
static const struct snd_kcontrol_new rx_int0_1_mix_inp0_mux = …;
static const struct snd_kcontrol_new rx_int0_1_mix_inp1_mux = …;
static const struct snd_kcontrol_new rx_int0_1_mix_inp2_mux = …;
static const struct snd_kcontrol_new rx_int1_1_mix_inp0_mux = …;
static const struct snd_kcontrol_new rx_int1_1_mix_inp1_mux = …;
static const struct snd_kcontrol_new rx_int1_1_mix_inp2_mux = …;
static const struct snd_kcontrol_new rx_int2_1_mix_inp0_mux = …;
static const struct snd_kcontrol_new rx_int2_1_mix_inp1_mux = …;
static const struct snd_kcontrol_new rx_int2_1_mix_inp2_mux = …;
static const struct snd_kcontrol_new rx_int3_1_mix_inp0_mux = …;
static const struct snd_kcontrol_new rx_int3_1_mix_inp1_mux = …;
static const struct snd_kcontrol_new rx_int3_1_mix_inp2_mux = …;
static const struct snd_kcontrol_new rx_int4_1_mix_inp0_mux = …;
static const struct snd_kcontrol_new rx_int4_1_mix_inp1_mux = …;
static const struct snd_kcontrol_new rx_int4_1_mix_inp2_mux = …;
static const struct snd_kcontrol_new rx_int7_1_mix_inp0_mux = …;
static const struct snd_kcontrol_new rx_int7_1_mix_inp1_mux = …;
static const struct snd_kcontrol_new rx_int7_1_mix_inp2_mux = …;
static const struct snd_kcontrol_new rx_int8_1_mix_inp0_mux = …;
static const struct snd_kcontrol_new rx_int8_1_mix_inp1_mux = …;
static const struct snd_kcontrol_new rx_int8_1_mix_inp2_mux = …;
static const struct snd_kcontrol_new rx_int0_mix2_inp_mux = …;
static const struct snd_kcontrol_new rx_int1_mix2_inp_mux = …;
static const struct snd_kcontrol_new rx_int2_mix2_inp_mux = …;
static const struct snd_kcontrol_new rx_int3_mix2_inp_mux = …;
static const struct snd_kcontrol_new rx_int4_mix2_inp_mux = …;
static const struct snd_kcontrol_new rx_int7_mix2_inp_mux = …;
static const struct snd_kcontrol_new iir0_inp0_mux = …;
static const struct snd_kcontrol_new iir0_inp1_mux = …;
static const struct snd_kcontrol_new iir0_inp2_mux = …;
static const struct snd_kcontrol_new iir0_inp3_mux = …;
static const struct snd_kcontrol_new iir1_inp0_mux = …;
static const struct snd_kcontrol_new iir1_inp1_mux = …;
static const struct snd_kcontrol_new iir1_inp2_mux = …;
static const struct snd_kcontrol_new iir1_inp3_mux = …;
static const struct snd_kcontrol_new slim_rx_mux[WCD934X_RX_MAX] = …;
static const struct snd_kcontrol_new rx_int1_asrc_switch[] = …;
static const struct snd_kcontrol_new rx_int2_asrc_switch[] = …;
static const struct snd_kcontrol_new rx_int3_asrc_switch[] = …;
static const struct snd_kcontrol_new rx_int4_asrc_switch[] = …;
static const struct snd_kcontrol_new rx_int0_dem_inp_mux = …;
static const struct snd_kcontrol_new rx_int1_dem_inp_mux = …;
static const struct snd_kcontrol_new rx_int2_dem_inp_mux = …;
static const struct snd_kcontrol_new rx_int0_1_interp_mux = …;
static const struct snd_kcontrol_new rx_int1_1_interp_mux = …;
static const struct snd_kcontrol_new rx_int2_1_interp_mux = …;
static const struct snd_kcontrol_new rx_int3_1_interp_mux = …;
static const struct snd_kcontrol_new rx_int4_1_interp_mux = …;
static const struct snd_kcontrol_new rx_int7_1_interp_mux = …;
static const struct snd_kcontrol_new rx_int8_1_interp_mux = …;
static const struct snd_kcontrol_new rx_int0_2_interp_mux = …;
static const struct snd_kcontrol_new rx_int1_2_interp_mux = …;
static const struct snd_kcontrol_new rx_int2_2_interp_mux = …;
static const struct snd_kcontrol_new rx_int3_2_interp_mux = …;
static const struct snd_kcontrol_new rx_int4_2_interp_mux = …;
static const struct snd_kcontrol_new rx_int7_2_interp_mux = …;
static const struct snd_kcontrol_new rx_int8_2_interp_mux = …;
static const struct snd_kcontrol_new tx_dmic_mux0 = …;
static const struct snd_kcontrol_new tx_dmic_mux1 = …;
static const struct snd_kcontrol_new tx_dmic_mux2 = …;
static const struct snd_kcontrol_new tx_dmic_mux3 = …;
static const struct snd_kcontrol_new tx_dmic_mux4 = …;
static const struct snd_kcontrol_new tx_dmic_mux5 = …;
static const struct snd_kcontrol_new tx_dmic_mux6 = …;
static const struct snd_kcontrol_new tx_dmic_mux7 = …;
static const struct snd_kcontrol_new tx_dmic_mux8 = …;
static const struct snd_kcontrol_new tx_amic_mux0 = …;
static const struct snd_kcontrol_new tx_amic_mux1 = …;
static const struct snd_kcontrol_new tx_amic_mux2 = …;
static const struct snd_kcontrol_new tx_amic_mux3 = …;
static const struct snd_kcontrol_new tx_amic_mux4 = …;
static const struct snd_kcontrol_new tx_amic_mux5 = …;
static const struct snd_kcontrol_new tx_amic_mux6 = …;
static const struct snd_kcontrol_new tx_amic_mux7 = …;
static const struct snd_kcontrol_new tx_amic_mux8 = …;
static const struct snd_kcontrol_new tx_amic4_5 = …;
static const struct snd_kcontrol_new tx_adc_mux0_mux = …;
static const struct snd_kcontrol_new tx_adc_mux1_mux = …;
static const struct snd_kcontrol_new tx_adc_mux2_mux = …;
static const struct snd_kcontrol_new tx_adc_mux3_mux = …;
static const struct snd_kcontrol_new tx_adc_mux4_mux = …;
static const struct snd_kcontrol_new tx_adc_mux5_mux = …;
static const struct snd_kcontrol_new tx_adc_mux6_mux = …;
static const struct snd_kcontrol_new tx_adc_mux7_mux = …;
static const struct snd_kcontrol_new tx_adc_mux8_mux = …;
static const struct snd_kcontrol_new cdc_if_tx0_mux = …;
static const struct snd_kcontrol_new cdc_if_tx1_mux = …;
static const struct snd_kcontrol_new cdc_if_tx2_mux = …;
static const struct snd_kcontrol_new cdc_if_tx3_mux = …;
static const struct snd_kcontrol_new cdc_if_tx4_mux = …;
static const struct snd_kcontrol_new cdc_if_tx5_mux = …;
static const struct snd_kcontrol_new cdc_if_tx6_mux = …;
static const struct snd_kcontrol_new cdc_if_tx7_mux = …;
static const struct snd_kcontrol_new cdc_if_tx8_mux = …;
static const struct snd_kcontrol_new cdc_if_tx9_mux = …;
static const struct snd_kcontrol_new cdc_if_tx10_mux = …;
static const struct snd_kcontrol_new cdc_if_tx11_mux = …;
static const struct snd_kcontrol_new cdc_if_tx11_inp1_mux = …;
static const struct snd_kcontrol_new cdc_if_tx13_mux = …;
static const struct snd_kcontrol_new cdc_if_tx13_inp1_mux = …;
static int slim_tx_mixer_get(struct snd_kcontrol *kc,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int slim_tx_mixer_put(struct snd_kcontrol *kc,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new aif1_slim_cap_mixer[] = …;
static const struct snd_kcontrol_new aif2_slim_cap_mixer[] = …;
static const struct snd_kcontrol_new aif3_slim_cap_mixer[] = …;
static const struct snd_kcontrol_new wcd934x_snd_controls[] = …;
static void wcd934x_codec_enable_int_port(struct wcd_slim_codec_dai_data *dai,
struct snd_soc_component *component)
{ … }
static int wcd934x_codec_enable_slim(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kc, int event)
{ … }
static void wcd934x_codec_hd2_control(struct snd_soc_component *component,
u16 interp_idx, int event)
{ … }
static void wcd934x_codec_hphdelay_lutbypass(struct snd_soc_component *comp,
u16 interp_idx, int event)
{ … }
static int wcd934x_config_compander(struct snd_soc_component *comp,
int interp_n, int event)
{ … }
static int wcd934x_codec_enable_interp_clk(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kc, int event)
{ … }
static int wcd934x_codec_enable_mix_path(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kc, int event)
{ … }
static int wcd934x_codec_set_iir_gain(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int wcd934x_codec_enable_main_path(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol,
int event)
{ … }
static int wcd934x_codec_ear_dac_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kc, int event)
{ … }
static int wcd934x_codec_hphl_dac_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol,
int event)
{ … }
static int wcd934x_codec_hphr_dac_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol,
int event)
{ … }
static int wcd934x_codec_lineout_dac_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kc, int event)
{ … }
static int wcd934x_codec_enable_hphl_pa(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol,
int event)
{ … }
static int wcd934x_codec_enable_hphr_pa(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol,
int event)
{ … }
static u32 wcd934x_get_dmic_sample_rate(struct snd_soc_component *comp,
unsigned int dmic,
struct wcd934x_codec *wcd)
{ … }
static u8 wcd934x_get_dmic_clk_val(struct snd_soc_component *comp,
u32 mclk_rate, u32 dmic_clk_rate)
{ … }
static int wcd934x_codec_enable_dmic(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int wcd934x_codec_find_amic_input(struct snd_soc_component *comp,
int adc_mux_n)
{ … }
static u16 wcd934x_codec_get_amic_pwlvl_reg(struct snd_soc_component *comp,
int amic)
{ … }
static int wcd934x_codec_enable_dec(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static void wcd934x_codec_set_tx_hold(struct snd_soc_component *comp,
u16 amic_reg, bool set)
{ … }
static int wcd934x_codec_enable_adc(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int wcd934x_codec_enable_micbias(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol,
int event)
{ … }
static const struct snd_soc_dapm_widget wcd934x_dapm_widgets[] = …;
static const struct snd_soc_dapm_route wcd934x_audio_map[] = …;
static int wcd934x_codec_set_jack(struct snd_soc_component *comp,
struct snd_soc_jack *jack, void *data)
{ … }
static const struct snd_soc_component_driver wcd934x_component_drv = …;
static int wcd934x_codec_parse_data(struct wcd934x_codec *wcd)
{ … }
static int wcd934x_codec_probe(struct platform_device *pdev)
{ … }
static const struct platform_device_id wcd934x_driver_id[] = …;
MODULE_DEVICE_TABLE(platform, wcd934x_driver_id);
static struct platform_driver wcd934x_codec_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;