linux/sound/soc/codecs/rt5665.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * rt5665.c  --  RT5665/RT5658 ALSA SoC audio codec driver
 *
 * Copyright 2016 Realtek Semiconductor Corp.
 * Author: Bard Liao <[email protected]>
 */

#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);

/* {0, +20, +24, +30, +35, +40, +44, +50, +52} dB */
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)
);

/* Interface data select */
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)
{}

/**
 * rt5665_sel_asrc_clk_src - select ASRC clock source for a set of filters
 * @component: SoC audio component device.
 * @filter_mask: mask of filters.
 * @clk_src: clock source
 *
 * The ASRC function is for asynchronous MCLK and LRCK. Also, since RT5665 can
 * only support standard 32fs or 64fs i2s format, ASRC should be enabled to
 * support special i2s clock format such as Intel's 100fs(100 * sampling rate).
 * ASRC function will track i2s clock and generate a corresponding system clock
 * for codec. This function provides an API to select the clock source for a
 * set of filters specified by the mask. And the codec driver will turn on ASRC
 * for these filters if ASRC is selected as their clock source.
 */
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)
{}

/**
 * rt5665_headset_detect - Detect headset.
 * @component: SoC audio component device.
 * @jack_insert: Jack insert or not.
 *
 * Detect whether is headset or not when jack inserted.
 *
 * Returns detect status.
 */
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[] =;

/**
 * set_dmic_clk - Set parameter of dmic.
 *
 * @w: DAPM widget.
 * @kcontrol: The kcontrol of this widget.
 * @event: Event id.
 *
 * Choose dmic clock between 1MHz and 3MHz.
 * It is better for clock to approximate 3MHz.
 */
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)
{}

/* Digital Mixer */
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[] =;

/* Analog Input Mixer */
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[] =;

/*DAC L2, DAC R2*/
/*MX-17 [6:4], MX-17 [2:0]*/
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 =;

/*DAC L3, DAC R3*/
/*MX-1B [6:4], MX-1B [2:0]*/
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 =;

/* STO1 ADC1 Source */
/* MX-26 [13] [5] */
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 =;

/* STO1 ADC Source */
/* MX-26 [11:10] [3:2] */
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 =;

/* STO1 ADC2 Source */
/* MX-26 [12] [4] */
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 =;

/* STO1 DMIC Source */
/* MX-26 [8] */
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 =;

/* MX-26 [9] */
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 =;

/* MX-26 [1:0] */
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 =;

/* MONO ADC L2 Source */
/* MX-27 [12] */
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 =;


/* MONO ADC L1 Source */
/* MX-27 [13] */
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 =;

/* MX-27 [9][1]*/
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 =;

/* MONO ADC L Source, MONO ADC R Source*/
/* MX-27 [11:10], MX-27 [3:2] */
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 =;

/* MONO DMIC L Source */
/* MX-27 [8] */
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 =;

/* MONO ADC R2 Source */
/* MX-27 [4] */
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 =;

/* MONO ADC R1 Source */
/* MX-27 [5] */
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 =;

/* MONO DMIC R Source */
/* MX-27 [0] */
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 =;


/* STO2 ADC1 Source */
/* MX-28 [13] [5] */
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 =;

/* STO2 ADC Source */
/* MX-28 [11:10] [3:2] */
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 =;

/* STO2 ADC2 Source */
/* MX-28 [12] [4] */
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 =;

/* STO2 DMIC Source */
/* MX-28 [8] */
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 =;

/* MX-28 [9] */
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 =;

/* MX-28 [1] */
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 =;

/* DAC R1 Source, DAC L1 Source*/
/* MX-29 [11:10], MX-29 [9:8]*/
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 =;

/* DAC Digital Mixer L Source, DAC Digital Mixer R Source*/
/* MX-2D [13:12], MX-2D [9:8]*/
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 =;

/* Analog DAC L1 Source, Analog DAC R1 Source*/
/* MX-2D [5:4], MX-2D [1:0]*/
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 =;

/* Analog DAC LR Source, Analog DAC R2 Source*/
/* MX-2E [5:4], MX-2E [0]*/
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 =;

/* Interface2 ADC Data Input*/
/* MX-2F [14:12] */
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 =;

/* MX-2F [6:4] */
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 =;

/* Interface3 ADC Data Input*/
/* MX-30 [6:4] */
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 =;

/* PDM 1 L/R*/
/* MX-31 [11:10] [9:8] */
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 =;


/* I2S1 TDM ADCDAT Source */
/* MX-7a[10] */
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 =;

/* MX-7a[9] */
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 =;

/* MX-7a[8] */
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 =;

/* MX-7b[10] */
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 =;

/* MX-7b[9] */
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 =;

/* MX-7b[8] */
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 =;

/* MX-7b[7] */
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 =;

/* MX-7a[4:0] MX-7b[4:0] */
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 =;

/* Out Volume Switch */
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 =;

/* Out 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();