#include <linux/bitops.h>
#include <sound/core.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <sound/initval.h>
#include <sound/jack.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <sound/pcm.h>
#include <linux/pm_runtime.h>
#include <sound/pcm_params.h>
#include <linux/soundwire/sdw_registers.h>
#include <linux/slab.h>
#include <sound/soc-dapm.h>
#include <sound/tlv.h>
#include "rt722-sdca.h"
int rt722_sdca_index_write(struct rt722_sdca_priv *rt722,
unsigned int nid, unsigned int reg, unsigned int value)
{ … }
int rt722_sdca_index_read(struct rt722_sdca_priv *rt722,
unsigned int nid, unsigned int reg, unsigned int *value)
{ … }
static int rt722_sdca_index_update_bits(struct rt722_sdca_priv *rt722,
unsigned int nid, unsigned int reg, unsigned int mask, unsigned int val)
{ … }
static int rt722_sdca_btn_type(unsigned char *buffer)
{ … }
static unsigned int rt722_sdca_button_detect(struct rt722_sdca_priv *rt722)
{ … }
static int rt722_sdca_headset_detect(struct rt722_sdca_priv *rt722)
{ … }
static void rt722_sdca_jack_detect_handler(struct work_struct *work)
{ … }
static void rt722_sdca_btn_check_handler(struct work_struct *work)
{ … }
static void rt722_sdca_jack_init(struct rt722_sdca_priv *rt722)
{ … }
static int rt722_sdca_set_jack_detect(struct snd_soc_component *component,
struct snd_soc_jack *hs_jack, void *data)
{ … }
static int rt722_sdca_set_gain_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int rt722_sdca_set_gain_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int rt722_sdca_set_fu1e_capture_ctl(struct rt722_sdca_priv *rt722)
{ … }
static int rt722_sdca_fu1e_capture_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int rt722_sdca_fu1e_capture_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int rt722_sdca_set_fu0f_capture_ctl(struct rt722_sdca_priv *rt722)
{ … }
static int rt722_sdca_fu0f_capture_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int rt722_sdca_fu0f_capture_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int rt722_sdca_fu_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ … }
static int rt722_sdca_dmic_set_gain_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int rt722_sdca_dmic_set_gain_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
#define RT722_SDCA_PR_VALUE(xreg_base, xcount, xmax, xinvert) …
#define RT722_SDCA_FU_CTRL(xname, reg_base, xmax, xinvert, xcount) …
#define RT722_SDCA_EXT_TLV(xname, reg_base, xhandler_get,\
xhandler_put, xcount, xmax, tlv_array) …
static const DECLARE_TLV_DB_SCALE(out_vol_tlv, -6525, 75, 0);
static const DECLARE_TLV_DB_SCALE(mic_vol_tlv, -1725, 75, 0);
static const DECLARE_TLV_DB_SCALE(boost_vol_tlv, 0, 1000, 0);
static const struct snd_kcontrol_new rt722_sdca_controls[] = …;
static int rt722_sdca_adc_mux_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int rt722_sdca_adc_mux_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const char * const adc22_mux_text[] = …;
static const char * const adc07_10_mux_text[] = …;
static SOC_ENUM_SINGLE_DECL(
rt722_adc22_enum, SND_SOC_NOPM, 0, adc22_mux_text);
static SOC_ENUM_SINGLE_DECL(
rt722_adc24_enum, SND_SOC_NOPM, 0, adc07_10_mux_text);
static SOC_ENUM_SINGLE_DECL(
rt722_adc25_enum, SND_SOC_NOPM, 0, adc07_10_mux_text);
static const struct snd_kcontrol_new rt722_sdca_adc22_mux = …;
static const struct snd_kcontrol_new rt722_sdca_adc24_mux = …;
static const struct snd_kcontrol_new rt722_sdca_adc25_mux = …;
static int rt722_sdca_fu42_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int rt722_sdca_fu21_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int rt722_sdca_fu113_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int rt722_sdca_fu36_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int rt722_sdca_pde47_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int rt722_sdca_pde23_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int rt722_sdca_pde11_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int rt722_sdca_pde12_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static const struct snd_soc_dapm_widget rt722_sdca_dapm_widgets[] = …;
static const struct snd_soc_dapm_route rt722_sdca_audio_map[] = …;
static int rt722_sdca_parse_dt(struct rt722_sdca_priv *rt722, struct device *dev)
{ … }
static int rt722_sdca_probe(struct snd_soc_component *component)
{ … }
static const struct snd_soc_component_driver soc_sdca_dev_rt722 = …;
static int rt722_sdca_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream,
int direction)
{ … }
static void rt722_sdca_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
static int rt722_sdca_pcm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static int rt722_sdca_pcm_hw_free(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
#define RT722_STEREO_RATES …
#define RT722_FORMATS …
static const struct snd_soc_dai_ops rt722_sdca_ops = …;
static struct snd_soc_dai_driver rt722_sdca_dai[] = …;
int rt722_sdca_init(struct device *dev, struct regmap *regmap,
struct regmap *mbq_regmap, struct sdw_slave *slave)
{ … }
static void rt722_sdca_dmic_preset(struct rt722_sdca_priv *rt722)
{ … }
static void rt722_sdca_amp_preset(struct rt722_sdca_priv *rt722)
{ … }
static void rt722_sdca_jack_preset(struct rt722_sdca_priv *rt722)
{ … }
int rt722_sdca_io_init(struct device *dev, struct sdw_slave *slave)
{ … }
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;