#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/pm_runtime.h>
#include <linux/pm.h>
#include <linux/soundwire/sdw.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/sdw.h>
#include <sound/soc.h>
#include <sound/soc-dapm.h>
#include <sound/initval.h>
#include <sound/tlv.h>
#include <sound/hda_verbs.h>
#include <sound/jack.h>
#include "rt700.h"
static int rt700_index_write(struct regmap *regmap,
unsigned int reg, unsigned int value)
{ … }
static int rt700_index_read(struct regmap *regmap,
unsigned int reg, unsigned int *value)
{ … }
static unsigned int rt700_button_detect(struct rt700_priv *rt700)
{ … }
static int rt700_headset_detect(struct rt700_priv *rt700)
{ … }
static void rt700_jack_detect_handler(struct work_struct *work)
{ … }
static void rt700_btn_check_handler(struct work_struct *work)
{ … }
static void rt700_jack_init(struct rt700_priv *rt700)
{ … }
static int rt700_set_jack_detect(struct snd_soc_component *component,
struct snd_soc_jack *hs_jack, void *data)
{ … }
static void rt700_get_gain(struct rt700_priv *rt700, unsigned int addr_h,
unsigned int addr_l, unsigned int val_h,
unsigned int *r_val, unsigned int *l_val)
{ … }
static int rt700_set_amp_gain_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int rt700_set_amp_gain_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const DECLARE_TLV_DB_SCALE(out_vol_tlv, -6525, 75, 0);
static const DECLARE_TLV_DB_SCALE(in_vol_tlv, -1725, 75, 0);
static const DECLARE_TLV_DB_SCALE(mic_vol_tlv, 0, 1000, 0);
static const struct snd_kcontrol_new rt700_snd_controls[] = …;
static int rt700_mux_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int rt700_mux_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const char * const adc_mux_text[] = …;
static SOC_ENUM_SINGLE_DECL(
rt700_adc22_enum, SND_SOC_NOPM, 0, adc_mux_text);
static SOC_ENUM_SINGLE_DECL(
rt700_adc23_enum, SND_SOC_NOPM, 0, adc_mux_text);
static const struct snd_kcontrol_new rt700_adc22_mux = …;
static const struct snd_kcontrol_new rt700_adc23_mux = …;
static const char * const out_mux_text[] = …;
static SOC_ENUM_SINGLE_DECL(
rt700_hp_enum, SND_SOC_NOPM, 0, out_mux_text);
static const struct snd_kcontrol_new rt700_hp_mux = …;
static int rt700_dac_front_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int rt700_dac_surround_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int rt700_adc_09_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int rt700_adc_08_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int rt700_hpo_mux_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int rt700_spk_pga_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static const struct snd_soc_dapm_widget rt700_dapm_widgets[] = …;
static const struct snd_soc_dapm_route rt700_audio_map[] = …;
static int rt700_probe(struct snd_soc_component *component)
{ … }
static int rt700_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level)
{ … }
static const struct snd_soc_component_driver soc_codec_dev_rt700 = …;
static int rt700_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream,
int direction)
{ … }
static void rt700_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
static int rt700_pcm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static int rt700_pcm_hw_free(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
#define RT700_STEREO_RATES …
#define RT700_FORMATS …
static const struct snd_soc_dai_ops rt700_ops = …;
static struct snd_soc_dai_driver rt700_dai[] = …;
#define RT700_CLK_FREQ_9600000HZ …
#define RT700_CLK_FREQ_12000000HZ …
#define RT700_CLK_FREQ_6000000HZ …
#define RT700_CLK_FREQ_4800000HZ …
#define RT700_CLK_FREQ_2400000HZ …
#define RT700_CLK_FREQ_12288000HZ …
int rt700_clock_config(struct device *dev)
{ … }
int rt700_init(struct device *dev, struct regmap *sdw_regmap,
struct regmap *regmap, struct sdw_slave *slave)
{ … }
int rt700_io_init(struct device *dev, struct sdw_slave *slave)
{ … }
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;