#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/i2c.h>
#include <linux/platform_device.h>
#include <linux/spi/spi.h>
#include <linux/acpi.h>
#include <linux/gpio/consumer.h>
#include <linux/regulator/consumer.h>
#include <linux/mutex.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/jack.h>
#include <sound/soc.h>
#include <sound/soc-dapm.h>
#include <sound/initval.h>
#include <sound/tlv.h>
#include <sound/rt5665.h>
#include "rl6231.h"
#include "rt5665.h"
#define RT5665_NUM_SUPPLIES …
static const char *rt5665_supply_names[RT5665_NUM_SUPPLIES] = …;
struct rt5665_priv { … };
static const struct reg_default rt5665_reg[] = …;
static bool rt5665_volatile_register(struct device *dev, unsigned int reg)
{ … }
static bool rt5665_readable_register(struct device *dev, unsigned int reg)
{ … }
static const DECLARE_TLV_DB_SCALE(hp_vol_tlv, -2250, 150, 0);
static const DECLARE_TLV_DB_SCALE(mono_vol_tlv, -1400, 150, 0);
static const DECLARE_TLV_DB_SCALE(out_vol_tlv, -4650, 150, 0);
static const DECLARE_TLV_DB_SCALE(dac_vol_tlv, -65625, 375, 0);
static const DECLARE_TLV_DB_SCALE(in_vol_tlv, -3450, 150, 0);
static const DECLARE_TLV_DB_SCALE(adc_vol_tlv, -17625, 375, 0);
static const DECLARE_TLV_DB_SCALE(adc_bst_tlv, 0, 1200, 0);
static const DECLARE_TLV_DB_SCALE(in_bst_tlv, -1200, 75, 0);
static const DECLARE_TLV_DB_RANGE(bst_tlv,
0, 0, TLV_DB_SCALE_ITEM(0, 0, 0),
1, 1, TLV_DB_SCALE_ITEM(2000, 0, 0),
2, 2, TLV_DB_SCALE_ITEM(2400, 0, 0),
3, 5, TLV_DB_SCALE_ITEM(3000, 500, 0),
6, 6, TLV_DB_SCALE_ITEM(4400, 0, 0),
7, 7, TLV_DB_SCALE_ITEM(5000, 0, 0),
8, 8, TLV_DB_SCALE_ITEM(5200, 0, 0)
);
static const char * const rt5665_data_select[] = …;
static SOC_ENUM_SINGLE_DECL(rt5665_if1_1_01_adc_enum,
RT5665_TDM_CTRL_2, RT5665_I2S1_1_DS_ADC_SLOT01_SFT, rt5665_data_select);
static SOC_ENUM_SINGLE_DECL(rt5665_if1_1_23_adc_enum,
RT5665_TDM_CTRL_2, RT5665_I2S1_1_DS_ADC_SLOT23_SFT, rt5665_data_select);
static SOC_ENUM_SINGLE_DECL(rt5665_if1_1_45_adc_enum,
RT5665_TDM_CTRL_2, RT5665_I2S1_1_DS_ADC_SLOT45_SFT, rt5665_data_select);
static SOC_ENUM_SINGLE_DECL(rt5665_if1_1_67_adc_enum,
RT5665_TDM_CTRL_2, RT5665_I2S1_1_DS_ADC_SLOT67_SFT, rt5665_data_select);
static SOC_ENUM_SINGLE_DECL(rt5665_if1_2_01_adc_enum,
RT5665_TDM_CTRL_2, RT5665_I2S1_2_DS_ADC_SLOT01_SFT, rt5665_data_select);
static SOC_ENUM_SINGLE_DECL(rt5665_if1_2_23_adc_enum,
RT5665_TDM_CTRL_2, RT5665_I2S1_2_DS_ADC_SLOT23_SFT, rt5665_data_select);
static SOC_ENUM_SINGLE_DECL(rt5665_if1_2_45_adc_enum,
RT5665_TDM_CTRL_2, RT5665_I2S1_2_DS_ADC_SLOT45_SFT, rt5665_data_select);
static SOC_ENUM_SINGLE_DECL(rt5665_if1_2_67_adc_enum,
RT5665_TDM_CTRL_2, RT5665_I2S1_2_DS_ADC_SLOT67_SFT, rt5665_data_select);
static SOC_ENUM_SINGLE_DECL(rt5665_if2_1_dac_enum,
RT5665_DIG_INF2_DATA, RT5665_IF2_1_DAC_SEL_SFT, rt5665_data_select);
static SOC_ENUM_SINGLE_DECL(rt5665_if2_1_adc_enum,
RT5665_DIG_INF2_DATA, RT5665_IF2_1_ADC_SEL_SFT, rt5665_data_select);
static SOC_ENUM_SINGLE_DECL(rt5665_if2_2_dac_enum,
RT5665_DIG_INF2_DATA, RT5665_IF2_2_DAC_SEL_SFT, rt5665_data_select);
static SOC_ENUM_SINGLE_DECL(rt5665_if2_2_adc_enum,
RT5665_DIG_INF2_DATA, RT5665_IF2_2_ADC_SEL_SFT, rt5665_data_select);
static SOC_ENUM_SINGLE_DECL(rt5665_if3_dac_enum,
RT5665_DIG_INF3_DATA, RT5665_IF3_DAC_SEL_SFT, rt5665_data_select);
static SOC_ENUM_SINGLE_DECL(rt5665_if3_adc_enum,
RT5665_DIG_INF3_DATA, RT5665_IF3_ADC_SEL_SFT, rt5665_data_select);
static const struct snd_kcontrol_new rt5665_if1_1_01_adc_swap_mux = …;
static const struct snd_kcontrol_new rt5665_if1_1_23_adc_swap_mux = …;
static const struct snd_kcontrol_new rt5665_if1_1_45_adc_swap_mux = …;
static const struct snd_kcontrol_new rt5665_if1_1_67_adc_swap_mux = …;
static const struct snd_kcontrol_new rt5665_if1_2_01_adc_swap_mux = …;
static const struct snd_kcontrol_new rt5665_if1_2_23_adc_swap_mux = …;
static const struct snd_kcontrol_new rt5665_if1_2_45_adc_swap_mux = …;
static const struct snd_kcontrol_new rt5665_if1_2_67_adc_swap_mux = …;
static const struct snd_kcontrol_new rt5665_if2_1_dac_swap_mux = …;
static const struct snd_kcontrol_new rt5665_if2_1_adc_swap_mux = …;
static const struct snd_kcontrol_new rt5665_if2_2_dac_swap_mux = …;
static const struct snd_kcontrol_new rt5665_if2_2_adc_swap_mux = …;
static const struct snd_kcontrol_new rt5665_if3_dac_swap_mux = …;
static const struct snd_kcontrol_new rt5665_if3_adc_swap_mux = …;
static int rt5665_hp_vol_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int rt5665_mono_vol_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
int rt5665_sel_asrc_clk_src(struct snd_soc_component *component,
unsigned int filter_mask, unsigned int clk_src)
{ … }
EXPORT_SYMBOL_GPL(…);
static int rt5665_button_detect(struct snd_soc_component *component)
{ … }
static void rt5665_enable_push_button_irq(struct snd_soc_component *component,
bool enable)
{ … }
static int rt5665_headset_detect(struct snd_soc_component *component, int jack_insert)
{ … }
static irqreturn_t rt5665_irq(int irq, void *data)
{ … }
static void rt5665_jd_check_handler(struct work_struct *work)
{ … }
static int rt5665_set_jack_detect(struct snd_soc_component *component,
struct snd_soc_jack *hs_jack, void *data)
{ … }
static void rt5665_jack_detect_handler(struct work_struct *work)
{ … }
static const char * const rt5665_clk_sync[] = …;
static const struct soc_enum rt5665_enum[] = …;
static const struct snd_kcontrol_new rt5665_snd_controls[] = …;
static int set_dmic_clk(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int rt5665_charge_pump_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int is_sys_clk_from_pll(struct snd_soc_dapm_widget *w,
struct snd_soc_dapm_widget *sink)
{ … }
static int is_using_asrc(struct snd_soc_dapm_widget *w,
struct snd_soc_dapm_widget *sink)
{ … }
static const struct snd_kcontrol_new rt5665_sto1_adc_l_mix[] = …;
static const struct snd_kcontrol_new rt5665_sto1_adc_r_mix[] = …;
static const struct snd_kcontrol_new rt5665_sto2_adc_l_mix[] = …;
static const struct snd_kcontrol_new rt5665_sto2_adc_r_mix[] = …;
static const struct snd_kcontrol_new rt5665_mono_adc_l_mix[] = …;
static const struct snd_kcontrol_new rt5665_mono_adc_r_mix[] = …;
static const struct snd_kcontrol_new rt5665_dac_l_mix[] = …;
static const struct snd_kcontrol_new rt5665_dac_r_mix[] = …;
static const struct snd_kcontrol_new rt5665_sto1_dac_l_mix[] = …;
static const struct snd_kcontrol_new rt5665_sto1_dac_r_mix[] = …;
static const struct snd_kcontrol_new rt5665_sto2_dac_l_mix[] = …;
static const struct snd_kcontrol_new rt5665_sto2_dac_r_mix[] = …;
static const struct snd_kcontrol_new rt5665_mono_dac_l_mix[] = …;
static const struct snd_kcontrol_new rt5665_mono_dac_r_mix[] = …;
static const struct snd_kcontrol_new rt5665_rec1_l_mix[] = …;
static const struct snd_kcontrol_new rt5665_rec1_r_mix[] = …;
static const struct snd_kcontrol_new rt5665_rec2_l_mix[] = …;
static const struct snd_kcontrol_new rt5665_rec2_r_mix[] = …;
static const struct snd_kcontrol_new rt5665_monovol_mix[] = …;
static const struct snd_kcontrol_new rt5665_out_l_mix[] = …;
static const struct snd_kcontrol_new rt5665_out_r_mix[] = …;
static const struct snd_kcontrol_new rt5665_mono_mix[] = …;
static const struct snd_kcontrol_new rt5665_lout_l_mix[] = …;
static const struct snd_kcontrol_new rt5665_lout_r_mix[] = …;
static const char * const rt5665_dac2_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_dac_l2_enum, RT5665_DAC2_CTRL,
RT5665_DAC_L2_SEL_SFT, rt5665_dac2_src);
static const struct snd_kcontrol_new rt5665_dac_l2_mux = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_dac_r2_enum, RT5665_DAC2_CTRL,
RT5665_DAC_R2_SEL_SFT, rt5665_dac2_src);
static const struct snd_kcontrol_new rt5665_dac_r2_mux = …;
static const char * const rt5665_dac3_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_dac_l3_enum, RT5665_DAC3_CTRL,
RT5665_DAC_L3_SEL_SFT, rt5665_dac3_src);
static const struct snd_kcontrol_new rt5665_dac_l3_mux = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_dac_r3_enum, RT5665_DAC3_CTRL,
RT5665_DAC_R3_SEL_SFT, rt5665_dac3_src);
static const struct snd_kcontrol_new rt5665_dac_r3_mux = …;
static const char * const rt5665_sto1_adc1_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_sto1_adc1l_enum, RT5665_STO1_ADC_MIXER,
RT5665_STO1_ADC1L_SRC_SFT, rt5665_sto1_adc1_src);
static const struct snd_kcontrol_new rt5665_sto1_adc1l_mux = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_sto1_adc1r_enum, RT5665_STO1_ADC_MIXER,
RT5665_STO1_ADC1R_SRC_SFT, rt5665_sto1_adc1_src);
static const struct snd_kcontrol_new rt5665_sto1_adc1r_mux = …;
static const char * const rt5665_sto1_adc_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_sto1_adcl_enum, RT5665_STO1_ADC_MIXER,
RT5665_STO1_ADCL_SRC_SFT, rt5665_sto1_adc_src);
static const struct snd_kcontrol_new rt5665_sto1_adcl_mux = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_sto1_adcr_enum, RT5665_STO1_ADC_MIXER,
RT5665_STO1_ADCR_SRC_SFT, rt5665_sto1_adc_src);
static const struct snd_kcontrol_new rt5665_sto1_adcr_mux = …;
static const char * const rt5665_sto1_adc2_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_sto1_adc2l_enum, RT5665_STO1_ADC_MIXER,
RT5665_STO1_ADC2L_SRC_SFT, rt5665_sto1_adc2_src);
static const struct snd_kcontrol_new rt5665_sto1_adc2l_mux = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_sto1_adc2r_enum, RT5665_STO1_ADC_MIXER,
RT5665_STO1_ADC2R_SRC_SFT, rt5665_sto1_adc2_src);
static const struct snd_kcontrol_new rt5665_sto1_adc2r_mux = …;
static const char * const rt5665_sto1_dmic_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_sto1_dmic_enum, RT5665_STO1_ADC_MIXER,
RT5665_STO1_DMIC_SRC_SFT, rt5665_sto1_dmic_src);
static const struct snd_kcontrol_new rt5665_sto1_dmic_mux = …;
static const char * const rt5665_sto1_dd_l_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_sto1_dd_l_enum, RT5665_STO1_ADC_MIXER,
RT5665_STO1_DD_L_SRC_SFT, rt5665_sto1_dd_l_src);
static const struct snd_kcontrol_new rt5665_sto1_dd_l_mux = …;
static const char * const rt5665_sto1_dd_r_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_sto1_dd_r_enum, RT5665_STO1_ADC_MIXER,
RT5665_STO1_DD_R_SRC_SFT, rt5665_sto1_dd_r_src);
static const struct snd_kcontrol_new rt5665_sto1_dd_r_mux = …;
static const char * const rt5665_mono_adc_l2_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_mono_adc_l2_enum, RT5665_MONO_ADC_MIXER,
RT5665_MONO_ADC_L2_SRC_SFT, rt5665_mono_adc_l2_src);
static const struct snd_kcontrol_new rt5665_mono_adc_l2_mux = …;
static const char * const rt5665_mono_adc_l1_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_mono_adc_l1_enum, RT5665_MONO_ADC_MIXER,
RT5665_MONO_ADC_L1_SRC_SFT, rt5665_mono_adc_l1_src);
static const struct snd_kcontrol_new rt5665_mono_adc_l1_mux = …;
static const char * const rt5665_mono_dd_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_mono_dd_l_enum, RT5665_MONO_ADC_MIXER,
RT5665_MONO_DD_L_SRC_SFT, rt5665_mono_dd_src);
static const struct snd_kcontrol_new rt5665_mono_dd_l_mux = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_mono_dd_r_enum, RT5665_MONO_ADC_MIXER,
RT5665_MONO_DD_R_SRC_SFT, rt5665_mono_dd_src);
static const struct snd_kcontrol_new rt5665_mono_dd_r_mux = …;
static const char * const rt5665_mono_adc_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_mono_adc_l_enum, RT5665_MONO_ADC_MIXER,
RT5665_MONO_ADC_L_SRC_SFT, rt5665_mono_adc_src);
static const struct snd_kcontrol_new rt5665_mono_adc_l_mux = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_mono_adcr_enum, RT5665_MONO_ADC_MIXER,
RT5665_MONO_ADC_R_SRC_SFT, rt5665_mono_adc_src);
static const struct snd_kcontrol_new rt5665_mono_adc_r_mux = …;
static const char * const rt5665_mono_dmic_l_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_mono_dmic_l_enum, RT5665_MONO_ADC_MIXER,
RT5665_MONO_DMIC_L_SRC_SFT, rt5665_mono_dmic_l_src);
static const struct snd_kcontrol_new rt5665_mono_dmic_l_mux = …;
static const char * const rt5665_mono_adc_r2_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_mono_adc_r2_enum, RT5665_MONO_ADC_MIXER,
RT5665_MONO_ADC_R2_SRC_SFT, rt5665_mono_adc_r2_src);
static const struct snd_kcontrol_new rt5665_mono_adc_r2_mux = …;
static const char * const rt5665_mono_adc_r1_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_mono_adc_r1_enum, RT5665_MONO_ADC_MIXER,
RT5665_MONO_ADC_R1_SRC_SFT, rt5665_mono_adc_r1_src);
static const struct snd_kcontrol_new rt5665_mono_adc_r1_mux = …;
static const char * const rt5665_mono_dmic_r_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_mono_dmic_r_enum, RT5665_MONO_ADC_MIXER,
RT5665_MONO_DMIC_R_SRC_SFT, rt5665_mono_dmic_r_src);
static const struct snd_kcontrol_new rt5665_mono_dmic_r_mux = …;
static const char * const rt5665_sto2_adc1_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_sto2_adc1l_enum, RT5665_STO2_ADC_MIXER,
RT5665_STO2_ADC1L_SRC_SFT, rt5665_sto2_adc1_src);
static const struct snd_kcontrol_new rt5665_sto2_adc1l_mux = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_sto2_adc1r_enum, RT5665_STO2_ADC_MIXER,
RT5665_STO2_ADC1R_SRC_SFT, rt5665_sto2_adc1_src);
static const struct snd_kcontrol_new rt5665_sto2_adc1r_mux = …;
static const char * const rt5665_sto2_adc_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_sto2_adcl_enum, RT5665_STO2_ADC_MIXER,
RT5665_STO2_ADCL_SRC_SFT, rt5665_sto2_adc_src);
static const struct snd_kcontrol_new rt5665_sto2_adcl_mux = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_sto2_adcr_enum, RT5665_STO2_ADC_MIXER,
RT5665_STO2_ADCR_SRC_SFT, rt5665_sto2_adc_src);
static const struct snd_kcontrol_new rt5665_sto2_adcr_mux = …;
static const char * const rt5665_sto2_adc2_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_sto2_adc2l_enum, RT5665_STO2_ADC_MIXER,
RT5665_STO2_ADC2L_SRC_SFT, rt5665_sto2_adc2_src);
static const struct snd_kcontrol_new rt5665_sto2_adc2l_mux = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_sto2_adc2r_enum, RT5665_STO2_ADC_MIXER,
RT5665_STO2_ADC2R_SRC_SFT, rt5665_sto2_adc2_src);
static const struct snd_kcontrol_new rt5665_sto2_adc2r_mux = …;
static const char * const rt5665_sto2_dmic_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_sto2_dmic_enum, RT5665_STO2_ADC_MIXER,
RT5665_STO2_DMIC_SRC_SFT, rt5665_sto2_dmic_src);
static const struct snd_kcontrol_new rt5665_sto2_dmic_mux = …;
static const char * const rt5665_sto2_dd_l_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_sto2_dd_l_enum, RT5665_STO2_ADC_MIXER,
RT5665_STO2_DD_L_SRC_SFT, rt5665_sto2_dd_l_src);
static const struct snd_kcontrol_new rt5665_sto2_dd_l_mux = …;
static const char * const rt5665_sto2_dd_r_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_sto2_dd_r_enum, RT5665_STO2_ADC_MIXER,
RT5665_STO2_DD_R_SRC_SFT, rt5665_sto2_dd_r_src);
static const struct snd_kcontrol_new rt5665_sto2_dd_r_mux = …;
static const char * const rt5665_dac1_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_dac_r1_enum, RT5665_AD_DA_MIXER,
RT5665_DAC1_R_SEL_SFT, rt5665_dac1_src);
static const struct snd_kcontrol_new rt5665_dac_r1_mux = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_dac_l1_enum, RT5665_AD_DA_MIXER,
RT5665_DAC1_L_SEL_SFT, rt5665_dac1_src);
static const struct snd_kcontrol_new rt5665_dac_l1_mux = …;
static const char * const rt5665_dig_dac_mix_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_dig_dac_mixl_enum, RT5665_A_DAC1_MUX,
RT5665_DAC_MIX_L_SFT, rt5665_dig_dac_mix_src);
static const struct snd_kcontrol_new rt5665_dig_dac_mixl_mux = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_dig_dac_mixr_enum, RT5665_A_DAC1_MUX,
RT5665_DAC_MIX_R_SFT, rt5665_dig_dac_mix_src);
static const struct snd_kcontrol_new rt5665_dig_dac_mixr_mux = …;
static const char * const rt5665_alg_dac1_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_alg_dac_l1_enum, RT5665_A_DAC1_MUX,
RT5665_A_DACL1_SFT, rt5665_alg_dac1_src);
static const struct snd_kcontrol_new rt5665_alg_dac_l1_mux = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_alg_dac_r1_enum, RT5665_A_DAC1_MUX,
RT5665_A_DACR1_SFT, rt5665_alg_dac1_src);
static const struct snd_kcontrol_new rt5665_alg_dac_r1_mux = …;
static const char * const rt5665_alg_dac2_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_alg_dac_l2_enum, RT5665_A_DAC2_MUX,
RT5665_A_DACL2_SFT, rt5665_alg_dac2_src);
static const struct snd_kcontrol_new rt5665_alg_dac_l2_mux = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_alg_dac_r2_enum, RT5665_A_DAC2_MUX,
RT5665_A_DACR2_SFT, rt5665_alg_dac2_src);
static const struct snd_kcontrol_new rt5665_alg_dac_r2_mux = …;
static const char * const rt5665_if2_1_adc_in_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_if2_1_adc_in_enum, RT5665_DIG_INF2_DATA,
RT5665_IF2_1_ADC_IN_SFT, rt5665_if2_1_adc_in_src);
static const struct snd_kcontrol_new rt5665_if2_1_adc_in_mux = …;
static const char * const rt5665_if2_2_adc_in_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_if2_2_adc_in_enum, RT5665_DIG_INF2_DATA,
RT5665_IF2_2_ADC_IN_SFT, rt5665_if2_2_adc_in_src);
static const struct snd_kcontrol_new rt5665_if2_2_adc_in_mux = …;
static const char * const rt5665_if3_adc_in_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_if3_adc_in_enum, RT5665_DIG_INF3_DATA,
RT5665_IF3_ADC_IN_SFT, rt5665_if3_adc_in_src);
static const struct snd_kcontrol_new rt5665_if3_adc_in_mux = …;
static const char * const rt5665_pdm_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_pdm_l_enum, RT5665_PDM_OUT_CTRL,
RT5665_PDM1_L_SFT, rt5665_pdm_src);
static const struct snd_kcontrol_new rt5665_pdm_l_mux = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_pdm_r_enum, RT5665_PDM_OUT_CTRL,
RT5665_PDM1_R_SFT, rt5665_pdm_src);
static const struct snd_kcontrol_new rt5665_pdm_r_mux = …;
static const char * const rt5665_if1_1_adc1_data_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_if1_1_adc1_data_enum, RT5665_TDM_CTRL_3,
RT5665_IF1_ADC1_SEL_SFT, rt5665_if1_1_adc1_data_src);
static const struct snd_kcontrol_new rt5665_if1_1_adc1_mux = …;
static const char * const rt5665_if1_1_adc2_data_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_if1_1_adc2_data_enum, RT5665_TDM_CTRL_3,
RT5665_IF1_ADC2_SEL_SFT, rt5665_if1_1_adc2_data_src);
static const struct snd_kcontrol_new rt5665_if1_1_adc2_mux = …;
static const char * const rt5665_if1_1_adc3_data_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_if1_1_adc3_data_enum, RT5665_TDM_CTRL_3,
RT5665_IF1_ADC3_SEL_SFT, rt5665_if1_1_adc3_data_src);
static const struct snd_kcontrol_new rt5665_if1_1_adc3_mux = …;
static const char * const rt5665_if1_2_adc1_data_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_if1_2_adc1_data_enum, RT5665_TDM_CTRL_4,
RT5665_IF1_ADC1_SEL_SFT, rt5665_if1_2_adc1_data_src);
static const struct snd_kcontrol_new rt5665_if1_2_adc1_mux = …;
static const char * const rt5665_if1_2_adc2_data_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_if1_2_adc2_data_enum, RT5665_TDM_CTRL_4,
RT5665_IF1_ADC2_SEL_SFT, rt5665_if1_2_adc2_data_src);
static const struct snd_kcontrol_new rt5665_if1_2_adc2_mux = …;
static const char * const rt5665_if1_2_adc3_data_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_if1_2_adc3_data_enum, RT5665_TDM_CTRL_4,
RT5665_IF1_ADC3_SEL_SFT, rt5665_if1_2_adc3_data_src);
static const struct snd_kcontrol_new rt5665_if1_2_adc3_mux = …;
static const char * const rt5665_if1_2_adc4_data_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_if1_2_adc4_data_enum, RT5665_TDM_CTRL_4,
RT5665_IF1_ADC4_SEL_SFT, rt5665_if1_2_adc4_data_src);
static const struct snd_kcontrol_new rt5665_if1_2_adc4_mux = …;
static const char * const rt5665_tdm_adc_data_src[] = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_tdm1_adc_data_enum, RT5665_TDM_CTRL_3,
RT5665_TDM_ADC_SEL_SFT, rt5665_tdm_adc_data_src);
static const struct snd_kcontrol_new rt5665_tdm1_adc_mux = …;
static SOC_ENUM_SINGLE_DECL(
rt5665_tdm2_adc_data_enum, RT5665_TDM_CTRL_4,
RT5665_TDM_ADC_SEL_SFT, rt5665_tdm_adc_data_src);
static const struct snd_kcontrol_new rt5665_tdm2_adc_mux = …;
static const struct snd_kcontrol_new monovol_switch = …;
static const struct snd_kcontrol_new outvol_l_switch = …;
static const struct snd_kcontrol_new outvol_r_switch = …;
static const struct snd_kcontrol_new mono_switch = …;
static const struct snd_kcontrol_new hpo_switch = …;
static const struct snd_kcontrol_new lout_l_switch = …;
static const struct snd_kcontrol_new lout_r_switch = …;
static const struct snd_kcontrol_new pdm_l_switch = …;
static const struct snd_kcontrol_new pdm_r_switch = …;
static int rt5665_mono_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int rt5665_hp_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int rt5665_lout_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int set_dmic_power(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int rt5665_set_verf(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int rt5665_i2s_pin_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static const struct snd_soc_dapm_widget rt5665_dapm_widgets[] = …;
static const struct snd_soc_dapm_route rt5665_dapm_routes[] = …;
static int rt5665_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
unsigned int rx_mask, int slots, int slot_width)
{ … }
static int rt5665_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
{ … }
static int rt5665_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
{ … }
static int rt5665_set_component_sysclk(struct snd_soc_component *component, int clk_id,
int source, unsigned int freq, int dir)
{ … }
static int rt5665_set_component_pll(struct snd_soc_component *component, int pll_id,
int source, unsigned int freq_in,
unsigned int freq_out)
{ … }
static int rt5665_set_bclk_ratio(struct snd_soc_dai *dai, unsigned int ratio)
{ … }
static int rt5665_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level)
{ … }
static int rt5665_probe(struct snd_soc_component *component)
{ … }
static void rt5665_remove(struct snd_soc_component *component)
{ … }
#ifdef CONFIG_PM
static int rt5665_suspend(struct snd_soc_component *component)
{ … }
static int rt5665_resume(struct snd_soc_component *component)
{ … }
#else
#define rt5665_suspend …
#define rt5665_resume …
#endif
#define RT5665_STEREO_RATES …
#define RT5665_FORMATS …
static const struct snd_soc_dai_ops rt5665_aif_dai_ops = …;
static struct snd_soc_dai_driver rt5665_dai[] = …;
static const struct snd_soc_component_driver soc_component_dev_rt5665 = …;
static const struct regmap_config rt5665_regmap = …;
static const struct i2c_device_id rt5665_i2c_id[] = …;
MODULE_DEVICE_TABLE(i2c, rt5665_i2c_id);
static int rt5665_parse_dt(struct rt5665_priv *rt5665, struct device *dev)
{ … }
static void rt5665_calibrate(struct rt5665_priv *rt5665)
{ … }
static void rt5665_calibrate_handler(struct work_struct *work)
{ … }
static int rt5665_i2c_probe(struct i2c_client *i2c)
{ … }
static void rt5665_i2c_shutdown(struct i2c_client *client)
{ … }
#ifdef CONFIG_OF
static const struct of_device_id rt5665_of_match[] = …;
MODULE_DEVICE_TABLE(of, rt5665_of_match);
#endif
#ifdef CONFIG_ACPI
static const struct acpi_device_id rt5665_acpi_match[] = …;
MODULE_DEVICE_TABLE(acpi, rt5665_acpi_match);
#endif
static struct i2c_driver rt5665_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;