#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/clk.h>
#include <linux/i2c.h>
#include <linux/acpi.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 <sound/wm8960.h>
#include "wm8960.h"
#define WM8960_VMID_MASK …
#define WM8960_VREF …
#define WM8960_PWR2_LOUT1 …
#define WM8960_PWR2_ROUT1 …
#define WM8960_PWR2_OUT3 …
#define WM8960_POBCTRL …
#define WM8960_BUFDCOPEN …
#define WM8960_BUFIOEN …
#define WM8960_SOFT_ST …
#define WM8960_HPSTBY …
#define WM8960_DISOP …
#define WM8960_DRES_MASK …
#define WM8960_DSCH_TOUT …
static bool is_pll_freq_available(unsigned int source, unsigned int target);
static int wm8960_set_pll(struct snd_soc_component *component,
unsigned int freq_in, unsigned int freq_out);
static const struct reg_default wm8960_reg_defaults[] = …;
static bool wm8960_volatile(struct device *dev, unsigned int reg)
{ … }
#define WM8960_NUM_SUPPLIES …
static const char *wm8960_supply_names[WM8960_NUM_SUPPLIES] = …;
struct wm8960_priv { … };
#define wm8960_reset(c) …
static const char *wm8960_polarity[] = …;
static const char *wm8960_3d_upper_cutoff[] = …;
static const char *wm8960_3d_lower_cutoff[] = …;
static const char *wm8960_alcfunc[] = …;
static const char *wm8960_alcmode[] = …;
static const char *wm8960_adc_data_output_sel[] = …;
static const char *wm8960_dmonomix[] = …;
static const char *wm8960_dacslope[] = …;
static const struct soc_enum wm8960_enum[] = …;
static const int deemph_settings[] = …;
static int wm8960_set_deemph(struct snd_soc_component *component)
{ … }
static int wm8960_get_deemph(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int wm8960_put_deemph(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const DECLARE_TLV_DB_SCALE(adc_tlv, -9750, 50, 1);
static const DECLARE_TLV_DB_SCALE(inpga_tlv, -1725, 75, 0);
static const DECLARE_TLV_DB_SCALE(dac_tlv, -12750, 50, 1);
static const DECLARE_TLV_DB_SCALE(bypass_tlv, -2100, 300, 0);
static const DECLARE_TLV_DB_SCALE(out_tlv, -12100, 100, 1);
static const DECLARE_TLV_DB_SCALE(lineinboost_tlv, -1500, 300, 1);
static const SNDRV_CTL_TLVD_DECLARE_DB_RANGE(micboost_tlv,
0, 1, TLV_DB_SCALE_ITEM(0, 1300, 0),
2, 3, TLV_DB_SCALE_ITEM(2000, 900, 0),
);
static const struct snd_kcontrol_new wm8960_snd_controls[] = …;
static const struct snd_kcontrol_new wm8960_lin_boost[] = …;
static const struct snd_kcontrol_new wm8960_lin[] = …;
static const struct snd_kcontrol_new wm8960_rin_boost[] = …;
static const struct snd_kcontrol_new wm8960_rin[] = …;
static const struct snd_kcontrol_new wm8960_loutput_mixer[] = …;
static const struct snd_kcontrol_new wm8960_routput_mixer[] = …;
static const struct snd_kcontrol_new wm8960_mono_out[] = …;
static const struct snd_soc_dapm_widget wm8960_dapm_widgets[] = …;
static const struct snd_soc_dapm_widget wm8960_dapm_widgets_out3[] = …;
static const struct snd_soc_dapm_widget wm8960_dapm_widgets_capless[] = …;
static const struct snd_soc_dapm_route audio_paths[] = …;
static const struct snd_soc_dapm_route audio_paths_out3[] = …;
static const struct snd_soc_dapm_route audio_paths_capless[] = …;
static int wm8960_add_widgets(struct snd_soc_component *component)
{ … }
static int wm8960_set_dai_fmt(struct snd_soc_dai *codec_dai,
unsigned int fmt)
{ … }
static struct { … } alc_rates[] = …;
static const int sysclk_divs[] = …;
static const int dac_divs[] = …;
static const int bclk_divs[] = …;
static
int wm8960_configure_sysclk(struct wm8960_priv *wm8960, int mclk,
int *sysclk_idx, int *dac_idx, int *bclk_idx)
{ … }
static
int wm8960_configure_pll(struct snd_soc_component *component, int freq_in,
int *sysclk_idx, int *dac_idx, int *bclk_idx)
{ … }
static int wm8960_configure_clocking(struct snd_soc_component *component)
{ … }
static int wm8960_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static int wm8960_hw_free(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
static int wm8960_mute(struct snd_soc_dai *dai, int mute, int direction)
{ … }
static int wm8960_set_bias_level_out3(struct snd_soc_component *component,
enum snd_soc_bias_level level)
{ … }
static int wm8960_set_bias_level_capless(struct snd_soc_component *component,
enum snd_soc_bias_level level)
{ … }
struct _pll_div { … };
static bool is_pll_freq_available(unsigned int source, unsigned int target)
{ … }
#define FIXED_PLL_SIZE …
static int pll_factors(unsigned int source, unsigned int target,
struct _pll_div *pll_div)
{ … }
static int wm8960_set_pll(struct snd_soc_component *component,
unsigned int freq_in, unsigned int freq_out)
{ … }
static int wm8960_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id,
int source, unsigned int freq_in, unsigned int freq_out)
{ … }
static int wm8960_set_dai_clkdiv(struct snd_soc_dai *codec_dai,
int div_id, int div)
{ … }
static int wm8960_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level)
{ … }
static int wm8960_set_dai_sysclk(struct snd_soc_dai *dai, int clk_id,
unsigned int freq, int dir)
{ … }
#define WM8960_RATES …
#define WM8960_FORMATS …
static const struct snd_soc_dai_ops wm8960_dai_ops = …;
static struct snd_soc_dai_driver wm8960_dai = …;
static int wm8960_probe(struct snd_soc_component *component)
{ … }
static const struct snd_soc_component_driver soc_component_dev_wm8960 = …;
static const struct regmap_config wm8960_regmap = …;
static void wm8960_set_pdata_from_of(struct i2c_client *i2c,
struct wm8960_data *pdata)
{ … }
static int wm8960_i2c_probe(struct i2c_client *i2c)
{ … }
static void wm8960_i2c_remove(struct i2c_client *client)
{ … }
static const struct i2c_device_id wm8960_i2c_id[] = …;
MODULE_DEVICE_TABLE(i2c, wm8960_i2c_id);
#if defined(CONFIG_OF)
static const struct of_device_id wm8960_of_match[] = …;
MODULE_DEVICE_TABLE(of, wm8960_of_match);
#endif
#if defined(CONFIG_ACPI)
static const struct acpi_device_id wm8960_acpi_match[] = …;
MODULE_DEVICE_TABLE(acpi, wm8960_acpi_match);
#endif
static struct i2c_driver wm8960_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;