#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/regulator/consumer.h>
#include <linux/spi/spi.h>
#include <linux/slab.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/tlv.h>
#include <sound/soc.h>
#include <sound/initval.h>
#include <sound/wm8993.h>
#include "wm8993.h"
#include "wm_hubs.h"
#define WM8993_NUM_SUPPLIES …
static const char *wm8993_supply_names[WM8993_NUM_SUPPLIES] = …;
static const struct reg_default wm8993_reg_defaults[] = …;
static struct { … } clk_sys_rates[] = …;
static struct { … } sample_rates[] = …;
static struct { … } bclk_divs[] = …;
struct wm8993_priv { … };
static bool wm8993_volatile(struct device *dev, unsigned int reg)
{ … }
static bool wm8993_readable(struct device *dev, unsigned int reg)
{ … }
struct _fll_div { … };
#define FIXED_FLL_SIZE …
static struct { … } fll_fratios[] = …;
static int fll_factors(struct _fll_div *fll_div, unsigned int Fref,
unsigned int Fout)
{ … }
static int _wm8993_set_fll(struct snd_soc_component *component, int fll_id, int source,
unsigned int Fref, unsigned int Fout)
{ … }
static int wm8993_set_fll(struct snd_soc_dai *dai, int fll_id, int source,
unsigned int Fref, unsigned int Fout)
{ … }
static int configure_clock(struct snd_soc_component *component)
{ … }
static const DECLARE_TLV_DB_SCALE(sidetone_tlv, -3600, 300, 0);
static const DECLARE_TLV_DB_SCALE(drc_comp_threash, -4500, 75, 0);
static const DECLARE_TLV_DB_SCALE(drc_comp_amp, -2250, 75, 0);
static const DECLARE_TLV_DB_SCALE(drc_min_tlv, -1800, 600, 0);
static const DECLARE_TLV_DB_RANGE(drc_max_tlv,
0, 2, TLV_DB_SCALE_ITEM(1200, 600, 0),
3, 3, TLV_DB_SCALE_ITEM(3600, 0, 0)
);
static const DECLARE_TLV_DB_SCALE(drc_qr_tlv, 1200, 600, 0);
static const DECLARE_TLV_DB_SCALE(drc_startup_tlv, -1800, 300, 0);
static const DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0);
static const DECLARE_TLV_DB_SCALE(digital_tlv, -7200, 75, 1);
static const DECLARE_TLV_DB_SCALE(dac_boost_tlv, 0, 600, 0);
static const char *dac_deemph_text[] = …;
static SOC_ENUM_SINGLE_DECL(dac_deemph,
WM8993_DAC_CTRL, 4, dac_deemph_text);
static const char *adc_hpf_text[] = …;
static SOC_ENUM_SINGLE_DECL(adc_hpf,
WM8993_ADC_CTRL, 5, adc_hpf_text);
static const char *drc_path_text[] = …;
static SOC_ENUM_SINGLE_DECL(drc_path,
WM8993_DRC_CONTROL_1, 14, drc_path_text);
static const char *drc_r0_text[] = …;
static SOC_ENUM_SINGLE_DECL(drc_r0,
WM8993_DRC_CONTROL_3, 8, drc_r0_text);
static const char *drc_r1_text[] = …;
static SOC_ENUM_SINGLE_DECL(drc_r1,
WM8993_DRC_CONTROL_4, 13, drc_r1_text);
static const char *drc_attack_text[] = …;
static SOC_ENUM_SINGLE_DECL(drc_attack,
WM8993_DRC_CONTROL_2, 12, drc_attack_text);
static const char *drc_decay_text[] = …;
static SOC_ENUM_SINGLE_DECL(drc_decay,
WM8993_DRC_CONTROL_2, 8, drc_decay_text);
static const char *drc_ff_text[] = …;
static SOC_ENUM_SINGLE_DECL(drc_ff,
WM8993_DRC_CONTROL_3, 7, drc_ff_text);
static const char *drc_qr_rate_text[] = …;
static SOC_ENUM_SINGLE_DECL(drc_qr_rate,
WM8993_DRC_CONTROL_3, 0, drc_qr_rate_text);
static const char *drc_smooth_text[] = …;
static SOC_ENUM_SINGLE_DECL(drc_smooth,
WM8993_DRC_CONTROL_1, 4, drc_smooth_text);
static const struct snd_kcontrol_new wm8993_snd_controls[] = …;
static const struct snd_kcontrol_new wm8993_eq_controls[] = …;
static int clk_sys_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static const struct snd_kcontrol_new left_speaker_mixer[] = …;
static const struct snd_kcontrol_new right_speaker_mixer[] = …;
static const char *aif_text[] = …;
static SOC_ENUM_SINGLE_DECL(aifoutl_enum,
WM8993_AUDIO_INTERFACE_1, 15, aif_text);
static const struct snd_kcontrol_new aifoutl_mux = …;
static SOC_ENUM_SINGLE_DECL(aifoutr_enum,
WM8993_AUDIO_INTERFACE_1, 14, aif_text);
static const struct snd_kcontrol_new aifoutr_mux = …;
static SOC_ENUM_SINGLE_DECL(aifinl_enum,
WM8993_AUDIO_INTERFACE_2, 15, aif_text);
static const struct snd_kcontrol_new aifinl_mux = …;
static SOC_ENUM_SINGLE_DECL(aifinr_enum,
WM8993_AUDIO_INTERFACE_2, 14, aif_text);
static const struct snd_kcontrol_new aifinr_mux = …;
static const char *sidetone_text[] = …;
static SOC_ENUM_SINGLE_DECL(sidetonel_enum,
WM8993_DIGITAL_SIDE_TONE, 2, sidetone_text);
static const struct snd_kcontrol_new sidetonel_mux = …;
static SOC_ENUM_SINGLE_DECL(sidetoner_enum,
WM8993_DIGITAL_SIDE_TONE, 0, sidetone_text);
static const struct snd_kcontrol_new sidetoner_mux = …;
static const struct snd_soc_dapm_widget wm8993_dapm_widgets[] = …;
static const struct snd_soc_dapm_route routes[] = …;
static int wm8993_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level)
{ … }
static int wm8993_set_sysclk(struct snd_soc_dai *codec_dai,
int clk_id, unsigned int freq, int dir)
{ … }
static int wm8993_set_dai_fmt(struct snd_soc_dai *dai,
unsigned int fmt)
{ … }
static int wm8993_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static int wm8993_mute(struct snd_soc_dai *codec_dai, int mute, int direction)
{ … }
static int wm8993_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
unsigned int rx_mask, int slots, int slot_width)
{ … }
static irqreturn_t wm8993_irq(int irq, void *data)
{ … }
static const struct snd_soc_dai_ops wm8993_ops = …;
#define WM8993_RATES …
#define WM8993_FORMATS …
static struct snd_soc_dai_driver wm8993_dai = …;
static int wm8993_probe(struct snd_soc_component *component)
{ … }
#ifdef CONFIG_PM
static int wm8993_suspend(struct snd_soc_component *component)
{ … }
static int wm8993_resume(struct snd_soc_component *component)
{ … }
#else
#define wm8993_suspend …
#define wm8993_resume …
#endif
static const struct reg_sequence wm8993_regmap_patch[] = …;
static const struct regmap_config wm8993_regmap = …;
static const struct snd_soc_component_driver soc_component_dev_wm8993 = …;
static int wm8993_i2c_probe(struct i2c_client *i2c)
{ … }
static void wm8993_i2c_remove(struct i2c_client *i2c)
{ … }
static const struct i2c_device_id wm8993_i2c_id[] = …;
MODULE_DEVICE_TABLE(i2c, wm8993_i2c_id);
static struct i2c_driver wm8993_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;