#include <linux/module.h>
#include <linux/kernel.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 "wm8974.h"
struct wm8974_priv { … };
static const struct reg_default wm8974_reg_defaults[] = …;
#define WM8974_POWER1_BIASEN …
#define WM8974_POWER1_BUFIOEN …
#define wm8974_reset(c) …
static const char *wm8974_companding[] = …;
static const char *wm8974_deemp[] = …;
static const char *wm8974_eqmode[] = …;
static const char *wm8974_bw[] = …;
static const char *wm8974_eq1[] = …;
static const char *wm8974_eq2[] = …;
static const char *wm8974_eq3[] = …;
static const char *wm8974_eq4[] = …;
static const char *wm8974_eq5[] = …;
static const char *wm8974_alc[] = …;
static const struct soc_enum wm8974_enum[] = …;
static const char *wm8974_auxmode_text[] = …;
static SOC_ENUM_SINGLE_DECL(wm8974_auxmode,
WM8974_INPUT, 3, wm8974_auxmode_text);
static const DECLARE_TLV_DB_SCALE(digital_tlv, -12750, 50, 1);
static const DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0);
static const DECLARE_TLV_DB_SCALE(inpga_tlv, -1200, 75, 0);
static const DECLARE_TLV_DB_SCALE(spk_tlv, -5700, 100, 0);
static const struct snd_kcontrol_new wm8974_snd_controls[] = …;
static const struct snd_kcontrol_new wm8974_speaker_mixer_controls[] = …;
static const struct snd_kcontrol_new wm8974_mono_mixer_controls[] = …;
static const struct snd_kcontrol_new wm8974_boost_mixer[] = …;
static const struct snd_kcontrol_new wm8974_inpga[] = …;
static const struct snd_soc_dapm_widget wm8974_dapm_widgets[] = …;
static const struct snd_soc_dapm_route wm8974_dapm_routes[] = …;
struct pll_ { … };
#define FIXED_PLL_SIZE …
static void pll_factors(struct pll_ *pll_div,
unsigned int target, unsigned int source)
{ … }
static int wm8974_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id,
int source, unsigned int freq_in, unsigned int freq_out)
{ … }
static int wm8974_set_dai_clkdiv(struct snd_soc_dai *codec_dai,
int div_id, int div)
{ … }
static unsigned int wm8974_get_mclkdiv(unsigned int f_in, unsigned int f_out,
int *mclkdiv)
{ … }
static int wm8974_update_clocks(struct snd_soc_dai *dai)
{ … }
static int wm8974_set_dai_sysclk(struct snd_soc_dai *dai, int clk_id,
unsigned int freq, int dir)
{ … }
static int wm8974_set_dai_fmt(struct snd_soc_dai *codec_dai,
unsigned int fmt)
{ … }
static int wm8974_pcm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static int wm8974_mute(struct snd_soc_dai *dai, int mute, int direction)
{ … }
static int wm8974_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level)
{ … }
#define WM8974_RATES …
#define WM8974_FORMATS …
static const struct snd_soc_dai_ops wm8974_ops = …;
static struct snd_soc_dai_driver wm8974_dai = …;
static const struct regmap_config wm8974_regmap = …;
static int wm8974_probe(struct snd_soc_component *component)
{ … }
static const struct snd_soc_component_driver soc_component_dev_wm8974 = …;
static int wm8974_i2c_probe(struct i2c_client *i2c)
{ … }
static const struct i2c_device_id wm8974_i2c_id[] = …;
MODULE_DEVICE_TABLE(i2c, wm8974_i2c_id);
static const struct of_device_id wm8974_of_match[] = …;
MODULE_DEVICE_TABLE(of, wm8974_of_match);
static struct i2c_driver wm8974_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;