#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/soundwire/sdw_registers.h>
#include <linux/slab.h>
#include <linux/bitops.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/sdw.h>
#include <sound/soc-dapm.h>
#include <sound/initval.h>
#include <sound/tlv.h>
#include <sound/jack.h>
#include "rt711-sdca.h"
static int rt711_sdca_index_write(struct rt711_sdca_priv *rt711,
unsigned int nid, unsigned int reg, unsigned int value)
{ … }
static int rt711_sdca_index_read(struct rt711_sdca_priv *rt711,
unsigned int nid, unsigned int reg, unsigned int *value)
{ … }
static int rt711_sdca_index_update_bits(struct rt711_sdca_priv *rt711,
unsigned int nid, unsigned int reg, unsigned int mask, unsigned int val)
{ … }
static void rt711_sdca_reset(struct rt711_sdca_priv *rt711)
{ … }
static void rt711_sdca_ge_force_jack_type(struct rt711_sdca_priv *rt711, unsigned int det_mode)
{ … }
static int rt711_sdca_calibration(struct rt711_sdca_priv *rt711)
{ … }
static unsigned int rt711_sdca_button_detect(struct rt711_sdca_priv *rt711)
{ … }
static int rt711_sdca_headset_detect(struct rt711_sdca_priv *rt711)
{ … }
static void rt711_sdca_jack_detect_handler(struct work_struct *work)
{ … }
static void rt711_sdca_btn_check_handler(struct work_struct *work)
{ … }
static void rt711_sdca_jack_init(struct rt711_sdca_priv *rt711)
{ … }
static int rt711_sdca_set_jack_detect(struct snd_soc_component *component,
struct snd_soc_jack *hs_jack, void *data)
{ … }
static int rt711_sdca_set_gain_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int rt711_sdca_set_gain_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int rt711_sdca_set_fu0f_capture_ctl(struct rt711_sdca_priv *rt711)
{ … }
static int rt711_sdca_set_fu1e_capture_ctl(struct rt711_sdca_priv *rt711)
{ … }
static int rt711_sdca_fu1e_capture_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int rt711_sdca_fu1e_capture_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int rt711_sdca_fu0f_capture_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int rt711_sdca_fu0f_capture_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int rt711_sdca_ge_select_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int rt711_sdca_ge_select_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const char * const rt711_sdca_ge_select[] = …;
static int rt711_sdca_ge_select_values[] = …;
static SOC_VALUE_ENUM_SINGLE_DECL(rt711_sdca_ge_mode_enum, SND_SOC_NOPM,
0, 0x7, rt711_sdca_ge_select, rt711_sdca_ge_select_values);
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 rt711_sdca_snd_controls[] = …;
static int rt711_sdca_mux_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int rt711_sdca_mux_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const char * const adc_mux_text[] = …;
static SOC_ENUM_SINGLE_DECL(
rt711_adc22_enum, SND_SOC_NOPM, 0, adc_mux_text);
static SOC_ENUM_SINGLE_DECL(
rt711_adc23_enum, SND_SOC_NOPM, 0, adc_mux_text);
static const struct snd_kcontrol_new rt711_sdca_adc22_mux = …;
static const struct snd_kcontrol_new rt711_sdca_adc23_mux = …;
static int rt711_sdca_fu05_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int rt711_sdca_fu0f_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int rt711_sdca_fu1e_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int rt711_sdca_pde28_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int rt711_sdca_pde29_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int rt711_sdca_pde2a_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int rt711_sdca_line1_power_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int rt711_sdca_line2_power_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static const struct snd_soc_dapm_widget rt711_sdca_dapm_widgets[] = …;
static const struct snd_soc_dapm_route rt711_sdca_audio_map[] = …;
static int rt711_sdca_parse_dt(struct rt711_sdca_priv *rt711, struct device *dev)
{ … }
static int rt711_sdca_probe(struct snd_soc_component *component)
{ … }
static const struct snd_soc_component_driver soc_sdca_dev_rt711 = …;
static int rt711_sdca_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream,
int direction)
{ … }
static void rt711_sdca_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
static int rt711_sdca_pcm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static int rt711_sdca_pcm_hw_free(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
#define RT711_STEREO_RATES …
#define RT711_FORMATS …
static const struct snd_soc_dai_ops rt711_sdca_ops = …;
static struct snd_soc_dai_driver rt711_sdca_dai[] = …;
int rt711_sdca_init(struct device *dev, struct regmap *regmap,
struct regmap *mbq_regmap, struct sdw_slave *slave)
{ … }
static void rt711_sdca_vd0_io_init(struct rt711_sdca_priv *rt711)
{ … }
static void rt711_sdca_vd1_io_init(struct rt711_sdca_priv *rt711)
{ … }
int rt711_sdca_io_init(struct device *dev, struct sdw_slave *slave)
{ … }
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;