#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/regmap.h>
#include <linux/slab.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/initval.h>
#include <sound/tlv.h>
#include "wm8961.h"
#define WM8961_MAX_REGISTER …
static const struct reg_default wm8961_reg_defaults[] = …;
struct wm8961_priv { … };
static bool wm8961_volatile(struct device *dev, unsigned int reg)
{ … }
static bool wm8961_readable(struct device *dev, unsigned int reg)
{ … }
static int wm8961_hp_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int wm8961_spk_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static const char *adc_hpf_text[] = …;
static SOC_ENUM_SINGLE_DECL(adc_hpf,
WM8961_ADC_DAC_CONTROL_2, 7, adc_hpf_text);
static const char *dac_deemph_text[] = …;
static SOC_ENUM_SINGLE_DECL(dac_deemph,
WM8961_ADC_DAC_CONTROL_1, 1, dac_deemph_text);
static const DECLARE_TLV_DB_SCALE(out_tlv, -12100, 100, 1);
static const DECLARE_TLV_DB_SCALE(hp_sec_tlv, -700, 100, 0);
static const DECLARE_TLV_DB_SCALE(adc_tlv, -7200, 75, 1);
static const DECLARE_TLV_DB_SCALE(sidetone_tlv, -3600, 300, 0);
static const DECLARE_TLV_DB_RANGE(boost_tlv,
0, 0, TLV_DB_SCALE_ITEM(0, 0, 0),
1, 1, TLV_DB_SCALE_ITEM(13, 0, 0),
2, 2, TLV_DB_SCALE_ITEM(20, 0, 0),
3, 3, TLV_DB_SCALE_ITEM(29, 0, 0)
);
static const DECLARE_TLV_DB_SCALE(pga_tlv, -2325, 75, 0);
static const struct snd_kcontrol_new wm8961_snd_controls[] = …;
static const char *sidetone_text[] = …;
static SOC_ENUM_SINGLE_DECL(dacl_sidetone,
WM8961_DSP_SIDETONE_0, 2, sidetone_text);
static SOC_ENUM_SINGLE_DECL(dacr_sidetone,
WM8961_DSP_SIDETONE_1, 2, sidetone_text);
static const struct snd_kcontrol_new dacl_mux = …;
static const struct snd_kcontrol_new dacr_mux = …;
static const struct snd_soc_dapm_widget wm8961_dapm_widgets[] = …;
static const struct snd_soc_dapm_route audio_paths[] = …;
static struct { … } wm8961_clk_sys_ratio[] = …;
static struct { … } wm8961_srate[] = …;
static int wm8961_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static int wm8961_set_sysclk(struct snd_soc_dai *dai, int clk_id,
unsigned int freq,
int dir)
{ … }
static int wm8961_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
{ … }
static int wm8961_set_tristate(struct snd_soc_dai *dai, int tristate)
{ … }
static int wm8961_mute(struct snd_soc_dai *dai, int mute, int direction)
{ … }
static int wm8961_set_clkdiv(struct snd_soc_dai *dai, int div_id, int div)
{ … }
static int wm8961_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level)
{ … }
#define WM8961_RATES …
#define WM8961_FORMATS …
static const struct snd_soc_dai_ops wm8961_dai_ops = …;
static struct snd_soc_dai_driver wm8961_dai = …;
static int wm8961_probe(struct snd_soc_component *component)
{ … }
#ifdef CONFIG_PM
static int wm8961_resume(struct snd_soc_component *component)
{ … }
#else
#define wm8961_resume …
#endif
static const struct snd_soc_component_driver soc_component_dev_wm8961 = …;
static const struct regmap_config wm8961_regmap = …;
static int wm8961_i2c_probe(struct i2c_client *i2c)
{ … }
static const struct i2c_device_id wm8961_i2c_id[] = …;
MODULE_DEVICE_TABLE(i2c, wm8961_i2c_id);
static const struct of_device_id wm8961_of_match[] __maybe_unused = …;
MODULE_DEVICE_TABLE(of, wm8961_of_match);
static struct i2c_driver wm8961_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;