linux/sound/soc/codecs/rt1011.c

// SPDX-License-Identifier: GPL-2.0
/*
 * rt1011.c -- rt1011 ALSA SoC amplifier component driver
 *
 * Copyright(c) 2019 Realtek Semiconductor Corp.
 *
 * Author: Shuming Fan <[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/acpi.h>
#include <linux/regmap.h>
#include <linux/platform_device.h>
#include <linux/firmware.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/soc-dapm.h>
#include <sound/initval.h>
#include <sound/tlv.h>

#include "rl6231.h"
#include "rt1011.h"

static int rt1011_calibrate(struct rt1011_priv *rt1011,
	unsigned char cali_flag);

static const struct reg_sequence init_list[] =;

static const struct reg_default rt1011_reg[] =;

static int rt1011_reg_init(struct snd_soc_component *component)
{}

static bool rt1011_volatile_register(struct device *dev, unsigned int reg)
{}

static bool rt1011_readable_register(struct device *dev, unsigned int reg)
{}

static const char * const rt1011_din_source_select[] =;

static SOC_ENUM_SINGLE_DECL(rt1011_din_source_enum, RT1011_CROSS_BQ_SET_1, 5,
	rt1011_din_source_select);

static const char * const rt1011_tdm_data_out_select[] =;

static const char * const rt1011_tdm_l_ch_data_select[] =;
static SOC_ENUM_SINGLE_DECL(rt1011_tdm1_l_dac1_enum, RT1011_TDM1_SET_4, 12,
	rt1011_tdm_l_ch_data_select);
static SOC_ENUM_SINGLE_DECL(rt1011_tdm2_l_dac1_enum, RT1011_TDM2_SET_4, 12,
	rt1011_tdm_l_ch_data_select);

static SOC_ENUM_SINGLE_DECL(rt1011_tdm1_adc1_dat_enum,
	RT1011_ADCDAT_OUT_SOURCE, 0, rt1011_tdm_data_out_select);
static SOC_ENUM_SINGLE_DECL(rt1011_tdm1_adc1_loc_enum, RT1011_TDM1_SET_2, 0,
	rt1011_tdm_l_ch_data_select);

static const char * const rt1011_adc_data_mode_select[] =;
static SOC_ENUM_SINGLE_DECL(rt1011_adc_dout_mode_enum, RT1011_TDM1_SET_1, 12,
	rt1011_adc_data_mode_select);

static const char * const rt1011_tdm_adc_data_len_control[] =;
static SOC_ENUM_SINGLE_DECL(rt1011_tdm1_dout_len_enum, RT1011_TDM1_SET_2, 13,
	rt1011_tdm_adc_data_len_control);
static SOC_ENUM_SINGLE_DECL(rt1011_tdm2_dout_len_enum, RT1011_TDM2_SET_2, 13,
	rt1011_tdm_adc_data_len_control);

static const char * const rt1011_tdm_adc_swap_select[] =;

static SOC_ENUM_SINGLE_DECL(rt1011_tdm_adc1_1_enum, RT1011_TDM1_SET_3, 6,
	rt1011_tdm_adc_swap_select);
static SOC_ENUM_SINGLE_DECL(rt1011_tdm_adc2_1_enum, RT1011_TDM1_SET_3, 4,
	rt1011_tdm_adc_swap_select);

static void rt1011_reset(struct regmap *regmap)
{}

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

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

static bool rt1011_validate_bq_drc_coeff(unsigned short reg)
{}

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

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

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

#define RT1011_BQ_DRC(xname)

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

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

static int rt1011_r0_load(struct rt1011_priv *rt1011)
{}

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

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

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

#define RT1011_R0_LOAD(xname)

static const char * const rt1011_i2s_ref[] =;

static SOC_ENUM_SINGLE_DECL(rt1011_i2s_ref_enum, 0, 0,
	rt1011_i2s_ref);

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

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

static const struct snd_kcontrol_new rt1011_snd_controls[] =;

static int rt1011_is_sys_clk_from_pll(struct snd_soc_dapm_widget *source,
			 struct snd_soc_dapm_widget *sink)
{}

static int rt1011_dac_event(struct snd_soc_dapm_widget *w,
	struct snd_kcontrol *kcontrol, int event)
{}


static const struct snd_soc_dapm_widget rt1011_dapm_widgets[] =;

static const struct snd_soc_dapm_route rt1011_dapm_routes[] =;

static int rt1011_get_clk_info(int sclk, int rate)
{}

static int rt1011_hw_params(struct snd_pcm_substream *substream,
	struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
{}

static int rt1011_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
{}

static int rt1011_set_component_sysclk(struct snd_soc_component *component,
		int clk_id, int source, unsigned int freq, int dir)
{}

static int rt1011_set_component_pll(struct snd_soc_component *component,
		int pll_id, int source, unsigned int freq_in,
		unsigned int freq_out)
{}

static int rt1011_set_tdm_slot(struct snd_soc_dai *dai,
	unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width)
{}

static int rt1011_probe(struct snd_soc_component *component)
{}

static void rt1011_remove(struct snd_soc_component *component)
{}

#ifdef CONFIG_PM
static int rt1011_suspend(struct snd_soc_component *component)
{}

static int rt1011_resume(struct snd_soc_component *component)
{}
#else
#define rt1011_suspend
#define rt1011_resume
#endif

static int rt1011_set_bias_level(struct snd_soc_component *component,
				 enum snd_soc_bias_level level)
{}

#define RT1011_STEREO_RATES
#define RT1011_FORMATS

static const struct snd_soc_dai_ops rt1011_aif_dai_ops =;

static struct snd_soc_dai_driver rt1011_dai[] =;

static const struct snd_soc_component_driver soc_component_dev_rt1011 =;

static const struct regmap_config rt1011_regmap =;

#if defined(CONFIG_OF)
static const struct of_device_id rt1011_of_match[] =;
MODULE_DEVICE_TABLE(of, rt1011_of_match);
#endif

#ifdef CONFIG_ACPI
static const struct acpi_device_id rt1011_acpi_match[] =;
MODULE_DEVICE_TABLE(acpi, rt1011_acpi_match);
#endif

static const struct i2c_device_id rt1011_i2c_id[] =;
MODULE_DEVICE_TABLE(i2c, rt1011_i2c_id);

static int rt1011_calibrate(struct rt1011_priv *rt1011, unsigned char cali_flag)
{}

static void rt1011_calibration_work(struct work_struct *work)
{}

static int rt1011_parse_dp(struct rt1011_priv *rt1011, struct device *dev)
{}

static int rt1011_i2c_probe(struct i2c_client *i2c)
{}

static void rt1011_i2c_shutdown(struct i2c_client *client)
{}

static struct i2c_driver rt1011_i2c_driver =;
module_i2c_driver();

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();