#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/firmware.h>
#include <linux/gcd.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/pm_runtime.h>
#include <linux/regulator/consumer.h>
#include <linux/regulator/fixed.h>
#include <linux/slab.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/jack.h>
#include <sound/initval.h>
#include <sound/tlv.h>
#include <sound/wm2200.h>
#include "wm2200.h"
#include "wm_adsp.h"
#define WM2200_DSP_CONTROL_1 …
#define WM2200_DSP_CONTROL_2 …
#define WM2200_DSP_CONTROL_3 …
#define WM2200_DSP_CONTROL_4 …
#define WM2200_DSP_CONTROL_5 …
#define WM2200_DSP_CONTROL_6 …
#define WM2200_DSP_CONTROL_7 …
#define WM2200_DSP_CONTROL_8 …
#define WM2200_DSP_CONTROL_9 …
#define WM2200_DSP_CONTROL_10 …
#define WM2200_DSP_CONTROL_11 …
#define WM2200_DSP_CONTROL_12 …
#define WM2200_DSP_CONTROL_13 …
#define WM2200_DSP_CONTROL_14 …
#define WM2200_DSP_CONTROL_15 …
#define WM2200_DSP_CONTROL_16 …
#define WM2200_DSP_CONTROL_17 …
#define WM2200_DSP_CONTROL_18 …
#define WM2200_DSP_CONTROL_19 …
#define WM2200_DSP_CONTROL_20 …
#define WM2200_DSP_CONTROL_21 …
#define WM2200_DSP_CONTROL_22 …
#define WM2200_DSP_CONTROL_23 …
#define WM2200_DSP_CONTROL_24 …
#define WM2200_DSP_CONTROL_25 …
#define WM2200_DSP_CONTROL_26 …
#define WM2200_DSP_CONTROL_27 …
#define WM2200_DSP_CONTROL_28 …
#define WM2200_DSP_CONTROL_29 …
#define WM2200_DSP_CONTROL_30 …
#define WM2200_DSP_CONTROL_31 …
#define WM2200_NUM_CORE_SUPPLIES …
static const char *wm2200_core_supply_names[WM2200_NUM_CORE_SUPPLIES] = …;
struct wm2200_priv { … };
#define WM2200_DSP_RANGE_BASE …
#define WM2200_DSP_SPACING …
#define WM2200_DSP1_DM_BASE …
#define WM2200_DSP1_PM_BASE …
#define WM2200_DSP1_ZM_BASE …
#define WM2200_DSP2_DM_BASE …
#define WM2200_DSP2_PM_BASE …
#define WM2200_DSP2_ZM_BASE …
static const struct regmap_range_cfg wm2200_ranges[] = …;
static const struct cs_dsp_region wm2200_dsp1_regions[] = …;
static const struct cs_dsp_region wm2200_dsp2_regions[] = …;
static const struct reg_default wm2200_reg_defaults[] = …;
static bool wm2200_volatile_register(struct device *dev, unsigned int reg)
{ … }
static bool wm2200_readable_register(struct device *dev, unsigned int reg)
{ … }
static const struct reg_sequence wm2200_reva_patch[] = …;
static int wm2200_reset(struct wm2200_priv *wm2200)
{ … }
static DECLARE_TLV_DB_SCALE(in_tlv, -6300, 100, 0);
static DECLARE_TLV_DB_SCALE(digital_tlv, -6400, 50, 0);
static DECLARE_TLV_DB_SCALE(out_tlv, -6400, 100, 0);
static const char * const wm2200_mixer_texts[] = …;
static unsigned int wm2200_mixer_values[] = …;
#define WM2200_MIXER_CONTROLS(name, base) …
#define WM2200_MUX_ENUM_DECL(name, reg) …
#define WM2200_MUX_CTL_DECL(name) …
#define WM2200_MIXER_ENUMS(name, base_reg) …
#define WM2200_DSP_ENUMS(name, base_reg) …
static const char *wm2200_rxanc_input_sel_texts[] = …;
static SOC_ENUM_SINGLE_DECL(wm2200_rxanc_input_sel,
WM2200_RXANC_SRC,
WM2200_IN_RXANC_SEL_SHIFT,
wm2200_rxanc_input_sel_texts);
static const struct snd_kcontrol_new wm2200_snd_controls[] = …;
WM2200_MIXER_ENUMS(…);
WM2200_MIXER_ENUMS(…);
WM2200_MIXER_ENUMS(…);
WM2200_MIXER_ENUMS(…);
WM2200_MIXER_ENUMS(…);
WM2200_MIXER_ENUMS(…);
WM2200_MIXER_ENUMS(…);
WM2200_MIXER_ENUMS(…);
WM2200_MIXER_ENUMS(…);
WM2200_MIXER_ENUMS(…);
WM2200_MIXER_ENUMS(…);
WM2200_MIXER_ENUMS(…);
WM2200_MIXER_ENUMS(…);
WM2200_MIXER_ENUMS(…);
WM2200_MIXER_ENUMS(…);
WM2200_MIXER_ENUMS(…);
WM2200_DSP_ENUMS(DSP1, WM2200_DSP1AUX1MIX_INPUT_1_SOURCE);
WM2200_DSP_ENUMS(DSP2, WM2200_DSP2AUX1MIX_INPUT_1_SOURCE);
WM2200_MIXER_ENUMS(…);
WM2200_MIXER_ENUMS(…);
#define WM2200_MUX(name, ctrl) …
#define WM2200_MIXER_WIDGETS(name, name_str) …
#define WM2200_DSP_WIDGETS(name, name_str) …
#define WM2200_MIXER_INPUT_ROUTES(name) …
#define WM2200_MIXER_ROUTES(widget, name) …
#define WM2200_DSP_AUX_ROUTES(name) …
static const char *wm2200_aec_loopback_texts[] = …;
static SOC_ENUM_SINGLE_DECL(wm2200_aec_loopback,
WM2200_DAC_AEC_CONTROL_1,
WM2200_AEC_LOOPBACK_SRC_SHIFT,
wm2200_aec_loopback_texts);
static const struct snd_kcontrol_new wm2200_aec_loopback_mux = …;
static const struct snd_soc_dapm_widget wm2200_dapm_widgets[] = …;
static const struct snd_soc_dapm_route wm2200_dapm_routes[] = …;
static int wm2200_probe(struct snd_soc_component *component)
{ … }
static int wm2200_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
{ … }
static int wm2200_sr_code[] = …;
#define WM2200_NUM_BCLK_RATES …
static int wm2200_bclk_rates_dat[WM2200_NUM_BCLK_RATES] = …;
static int wm2200_bclk_rates_cd[WM2200_NUM_BCLK_RATES] = …;
static int wm2200_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static int wm2200_set_sysclk(struct snd_soc_component *component, int clk_id,
int source, unsigned int freq, int dir)
{ … }
struct _fll_div { … };
static struct { … } fll_fratios[] = …;
static int fll_factors(struct _fll_div *fll_div, unsigned int Fref,
unsigned int Fout)
{ … }
static int wm2200_set_fll(struct snd_soc_component *component, int fll_id, int source,
unsigned int Fref, unsigned int Fout)
{ … }
static int wm2200_dai_probe(struct snd_soc_dai *dai)
{ … }
static const struct snd_soc_dai_ops wm2200_dai_ops = …;
#define WM2200_RATES …
#define WM2200_FORMATS …
static struct snd_soc_dai_driver wm2200_dai = …;
static const struct snd_soc_component_driver soc_component_wm2200 = …;
static irqreturn_t wm2200_irq(int irq, void *data)
{ … }
static const struct regmap_config wm2200_regmap = …;
static const unsigned int wm2200_dig_vu[] = …;
static const unsigned int wm2200_mic_ctrl_reg[] = …;
static int wm2200_i2c_probe(struct i2c_client *i2c)
{ … }
static void wm2200_i2c_remove(struct i2c_client *i2c)
{ … }
#ifdef CONFIG_PM
static int wm2200_runtime_suspend(struct device *dev)
{ … }
static int wm2200_runtime_resume(struct device *dev)
{ … }
#endif
static const struct dev_pm_ops wm2200_pm = …;
static const struct i2c_device_id wm2200_i2c_id[] = …;
MODULE_DEVICE_TABLE(i2c, wm2200_i2c_id);
static struct i2c_driver wm2200_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;