#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/dmi.h>
#include <linux/acpi.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 <sound/jack.h>
#include <linux/workqueue.h>
#include <sound/rt298.h>
#include "rl6347a.h"
#include "rt298.h"
#define RT298_VENDOR_ID …
struct rt298_priv { … };
static const struct reg_default rt298_index_def[] = …;
#define INDEX_CACHE_SIZE …
static const struct reg_default rt298_reg[] = …;
static bool rt298_volatile_register(struct device *dev, unsigned int reg)
{ … }
static bool rt298_readable_register(struct device *dev, unsigned int reg)
{ … }
#ifdef CONFIG_PM
static void rt298_index_sync(struct snd_soc_component *component)
{ … }
#endif
static int rt298_support_power_controls[] = …;
#define RT298_POWER_REG_LEN …
static int rt298_jack_detect(struct rt298_priv *rt298, bool *hp, bool *mic)
{ … }
static void rt298_jack_detect_work(struct work_struct *work)
{ … }
static int rt298_mic_detect(struct snd_soc_component *component,
struct snd_soc_jack *jack, void *data)
{ … }
static int is_mclk_mode(struct snd_soc_dapm_widget *source,
struct snd_soc_dapm_widget *sink)
{ … }
static const DECLARE_TLV_DB_SCALE(out_vol_tlv, -6350, 50, 0);
static const DECLARE_TLV_DB_SCALE(mic_vol_tlv, 0, 1000, 0);
static const struct snd_kcontrol_new rt298_snd_controls[] = …;
static const struct snd_kcontrol_new rt298_front_mix[] = …;
static const struct snd_kcontrol_new rt298_rec_mix[] = …;
static const struct snd_kcontrol_new spo_enable_control = …;
static const struct snd_kcontrol_new hpol_enable_control = …;
static const struct snd_kcontrol_new hpor_enable_control = …;
static const char * const rt298_adc_src[] = …;
static const int rt298_adc_values[] = …;
static SOC_VALUE_ENUM_SINGLE_DECL(
rt298_adc0_enum, RT298_ADC0_MUX, RT298_ADC_SEL_SFT,
RT298_ADC_SEL_MASK, rt298_adc_src, rt298_adc_values);
static const struct snd_kcontrol_new rt298_adc0_mux = …;
static SOC_VALUE_ENUM_SINGLE_DECL(
rt298_adc1_enum, RT298_ADC1_MUX, RT298_ADC_SEL_SFT,
RT298_ADC_SEL_MASK, rt298_adc_src, rt298_adc_values);
static const struct snd_kcontrol_new rt298_adc1_mux = …;
static const char * const rt298_dac_src[] = …;
static SOC_ENUM_SINGLE_DECL(rt298_hpo_enum, RT298_HPO_MUX,
0, rt298_dac_src);
static const struct snd_kcontrol_new rt298_hpo_mux = …;
static SOC_ENUM_SINGLE_DECL(rt298_spo_enum, RT298_SPK_MUX,
0, rt298_dac_src);
static const struct snd_kcontrol_new rt298_spo_mux = …;
static int rt298_spk_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int rt298_set_dmic1_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int rt298_adc_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int rt298_mic1_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static const struct snd_soc_dapm_widget rt298_dapm_widgets[] = …;
static const struct snd_soc_dapm_route rt298_dapm_routes[] = …;
static int rt298_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static int rt298_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
{ … }
static int rt298_set_dai_sysclk(struct snd_soc_dai *dai,
int clk_id, unsigned int freq, int dir)
{ … }
static int rt298_set_bclk_ratio(struct snd_soc_dai *dai, unsigned int ratio)
{ … }
static int rt298_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level)
{ … }
static irqreturn_t rt298_irq(int irq, void *data)
{ … }
static int rt298_probe(struct snd_soc_component *component)
{ … }
static void rt298_remove(struct snd_soc_component *component)
{ … }
#ifdef CONFIG_PM
static int rt298_suspend(struct snd_soc_component *component)
{ … }
static int rt298_resume(struct snd_soc_component *component)
{ … }
#else
#define rt298_suspend …
#define rt298_resume …
#endif
#define RT298_STEREO_RATES …
#define RT298_FORMATS …
static const struct snd_soc_dai_ops rt298_aif_dai_ops = …;
static struct snd_soc_dai_driver rt298_dai[] = …;
static const struct snd_soc_component_driver soc_component_dev_rt298 = …;
static const struct regmap_config rt298_regmap = …;
static const struct i2c_device_id rt298_i2c_id[] = …;
MODULE_DEVICE_TABLE(i2c, rt298_i2c_id);
#ifdef CONFIG_ACPI
static const struct acpi_device_id rt298_acpi_match[] = …;
MODULE_DEVICE_TABLE(acpi, rt298_acpi_match);
#endif
static const struct dmi_system_id force_combo_jack_table[] = …;
static int rt298_i2c_probe(struct i2c_client *i2c)
{ … }
static void rt298_i2c_remove(struct i2c_client *i2c)
{ … }
static struct i2c_driver rt298_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;