#include <linux/module.h>
#include <linux/moduleparam.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 <asm/div64.h>
#include "wm8990.h"
struct wm8990_priv { … };
#define wm8990_reset(c) …
static const DECLARE_TLV_DB_SCALE(in_pga_tlv, -1650, 3000, 0);
static const DECLARE_TLV_DB_SCALE(out_mix_tlv, 0, -2100, 0);
static const DECLARE_TLV_DB_SCALE(out_pga_tlv, -7300, 600, 0);
static const DECLARE_TLV_DB_SCALE(out_dac_tlv, -7163, 0, 0);
static const DECLARE_TLV_DB_SCALE(in_adc_tlv, -7163, 1763, 0);
static const DECLARE_TLV_DB_SCALE(out_sidetone_tlv, -3600, 0, 0);
static int wm899x_outpga_put_volsw_vu(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
#define SOC_WM899X_OUTPGA_SINGLE_R_TLV(xname, reg, shift, max, invert,\
tlv_array) …
static const char *wm8990_digital_sidetone[] = …;
static SOC_ENUM_SINGLE_DECL(wm8990_left_digital_sidetone_enum,
WM8990_DIGITAL_SIDE_TONE,
WM8990_ADC_TO_DACL_SHIFT,
wm8990_digital_sidetone);
static SOC_ENUM_SINGLE_DECL(wm8990_right_digital_sidetone_enum,
WM8990_DIGITAL_SIDE_TONE,
WM8990_ADC_TO_DACR_SHIFT,
wm8990_digital_sidetone);
static const char *wm8990_adcmode[] = …;
static SOC_ENUM_SINGLE_DECL(wm8990_right_adcmode_enum,
WM8990_ADC_CTRL,
WM8990_ADC_HPF_CUT_SHIFT,
wm8990_adcmode);
static const struct snd_kcontrol_new wm8990_snd_controls[] = …;
static int outmixer_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static const DECLARE_TLV_DB_SCALE(in_mix_tlv, -1200, 600, 0);
static const struct snd_kcontrol_new wm8990_dapm_lin12_pga_controls[] = …;
static const struct snd_kcontrol_new wm8990_dapm_lin34_pga_controls[] = …;
static const struct snd_kcontrol_new wm8990_dapm_rin12_pga_controls[] = …;
static const struct snd_kcontrol_new wm8990_dapm_rin34_pga_controls[] = …;
static const struct snd_kcontrol_new wm8990_dapm_inmixl_controls[] = …;
static const struct snd_kcontrol_new wm8990_dapm_inmixr_controls[] = …;
static const char *wm8990_ainlmux[] = …;
static SOC_ENUM_SINGLE_DECL(wm8990_ainlmux_enum,
WM8990_INPUT_MIXER1, WM8990_AINLMODE_SHIFT,
wm8990_ainlmux);
static const struct snd_kcontrol_new wm8990_dapm_ainlmux_controls = …;
static const char *wm8990_ainrmux[] = …;
static SOC_ENUM_SINGLE_DECL(wm8990_ainrmux_enum,
WM8990_INPUT_MIXER1, WM8990_AINRMODE_SHIFT,
wm8990_ainrmux);
static const struct snd_kcontrol_new wm8990_dapm_ainrmux_controls = …;
static const struct snd_kcontrol_new wm8990_dapm_lomix_controls[] = …;
static const struct snd_kcontrol_new wm8990_dapm_romix_controls[] = …;
static const struct snd_kcontrol_new wm8990_dapm_lonmix_controls[] = …;
static const struct snd_kcontrol_new wm8990_dapm_lopmix_controls[] = …;
static const struct snd_kcontrol_new wm8990_dapm_ronmix_controls[] = …;
static const struct snd_kcontrol_new wm8990_dapm_ropmix_controls[] = …;
static const struct snd_kcontrol_new wm8990_dapm_out3mix_controls[] = …;
static const struct snd_kcontrol_new wm8990_dapm_out4mix_controls[] = …;
static const struct snd_kcontrol_new wm8990_dapm_spkmix_controls[] = …;
static const struct snd_soc_dapm_widget wm8990_dapm_widgets[] = …;
static const struct snd_soc_dapm_route wm8990_dapm_routes[] = …;
struct _pll_div { … };
#define FIXED_PLL_SIZE …
static void pll_factors(struct _pll_div *pll_div, unsigned int target,
unsigned int source)
{ … }
static int wm8990_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id,
int source, unsigned int freq_in, unsigned int freq_out)
{ … }
static int wm8990_set_dai_sysclk(struct snd_soc_dai *codec_dai,
int clk_id, unsigned int freq, int dir)
{ … }
static int wm8990_set_dai_fmt(struct snd_soc_dai *codec_dai,
unsigned int fmt)
{ … }
static int wm8990_set_dai_clkdiv(struct snd_soc_dai *codec_dai,
int div_id, int div)
{ … }
static int wm8990_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static int wm8990_mute(struct snd_soc_dai *dai, int mute, int direction)
{ … }
static int wm8990_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level)
{ … }
#define WM8990_RATES …
#define WM8990_FORMATS …
static const struct snd_soc_dai_ops wm8990_dai_ops = …;
static struct snd_soc_dai_driver wm8990_dai = …;
static int wm8990_probe(struct snd_soc_component *component)
{ … }
static const struct snd_soc_component_driver soc_component_dev_wm8990 = …;
static int wm8990_i2c_probe(struct i2c_client *i2c)
{ … }
static const struct i2c_device_id wm8990_i2c_id[] = …;
MODULE_DEVICE_TABLE(i2c, wm8990_i2c_id);
static struct i2c_driver wm8990_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;