#include <linux/init.h>
#include <linux/slab.h>
#include <linux/mfd/wm97xx.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/regmap.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/ac97_codec.h>
#include <sound/ac97/codec.h>
#include <sound/ac97/compat.h>
#include <sound/initval.h>
#include <sound/pcm_params.h>
#include <sound/tlv.h>
#include <sound/soc.h>
#include "wm9713.h"
#define WM9713_VENDOR_ID …
#define WM9713_VENDOR_ID_MASK …
struct wm9713_priv { … };
#define HPL_MIXER …
#define HPR_MIXER …
static const char *wm9713_mic_mixer[] = …;
static const char *wm9713_rec_mux[] = …;
static const char *wm9713_rec_src[] = …;
static const char *wm9713_rec_gain[] = …;
static const char *wm9713_alc_select[] = …;
static const char *wm9713_mono_pga[] = …;
static const char *wm9713_spk_pga[] = …;
static const char *wm9713_hp_pga[] = …;
static const char *wm9713_out3_pga[] = …;
static const char *wm9713_out4_pga[] = …;
static const char *wm9713_dac_inv[] = …;
static const char *wm9713_bass[] = …;
static const char *wm9713_ng_type[] = …;
static const char *wm9713_mic_select[] = …;
static const char *wm9713_micb_select[] = …;
static const struct soc_enum wm9713_enum[] = …;
static const DECLARE_TLV_DB_SCALE(out_tlv, -4650, 150, 0);
static const DECLARE_TLV_DB_SCALE(main_tlv, -3450, 150, 0);
static const DECLARE_TLV_DB_SCALE(misc_tlv, -1500, 300, 0);
static const DECLARE_TLV_DB_RANGE(mic_tlv,
0, 2, TLV_DB_SCALE_ITEM(1200, 600, 0),
3, 3, TLV_DB_SCALE_ITEM(3000, 0, 0)
);
static const struct snd_kcontrol_new wm9713_snd_ac97_controls[] = …;
static int wm9713_voice_shutdown(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static const unsigned int wm9713_mixer_mute_regs[] = …;
static int wm9713_hp_mixer_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int wm9713_hp_mixer_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
#define WM9713_HP_MIXER_CTRL(xname, xmixer, xshift) …
static const struct snd_kcontrol_new wm9713_hpl_mixer_controls[] = …;
static const struct snd_kcontrol_new wm9713_hpr_mixer_controls[] = …;
static const struct snd_kcontrol_new wm9713_hp_rec_mux_controls = …;
static const struct snd_kcontrol_new wm9713_hp_mic_mux_controls = …;
static const struct snd_kcontrol_new wm9713_speaker_mixer_controls[] = …;
static const struct snd_kcontrol_new wm9713_mono_mixer_controls[] = …;
static const struct snd_kcontrol_new wm9713_mono_mic_mux_controls = …;
static const struct snd_kcontrol_new wm9713_mono_mux_controls = …;
static const struct snd_kcontrol_new wm9713_hp_spkl_mux_controls = …;
static const struct snd_kcontrol_new wm9713_hp_spkr_mux_controls = …;
static const struct snd_kcontrol_new wm9713_hpl_out_mux_controls = …;
static const struct snd_kcontrol_new wm9713_hpr_out_mux_controls = …;
static const struct snd_kcontrol_new wm9713_out3_mux_controls = …;
static const struct snd_kcontrol_new wm9713_out4_mux_controls = …;
static const struct snd_kcontrol_new wm9713_dac_inv1_mux_controls = …;
static const struct snd_kcontrol_new wm9713_dac_inv2_mux_controls = …;
static const struct snd_kcontrol_new wm9713_rec_srcl_mux_controls = …;
static const struct snd_kcontrol_new wm9713_rec_srcr_mux_controls = …;
static const struct snd_kcontrol_new wm9713_mic_sel_mux_controls = …;
static const struct snd_kcontrol_new wm9713_micb_sel_mux_controls = …;
static const struct snd_soc_dapm_widget wm9713_dapm_widgets[] = …;
static const struct snd_soc_dapm_route wm9713_audio_map[] = …;
static bool wm9713_readable_reg(struct device *dev, unsigned int reg)
{ … }
static bool wm9713_writeable_reg(struct device *dev, unsigned int reg)
{ … }
static const struct reg_default wm9713_reg_defaults[] = …;
static const struct regmap_config wm9713_regmap_config = …;
struct _pll_div { … };
#define FIXED_PLL_SIZE …
static void pll_factors(struct snd_soc_component *component,
struct _pll_div *pll_div, unsigned int source)
{ … }
static int wm9713_set_pll(struct snd_soc_component *component,
int pll_id, unsigned int freq_in, unsigned int freq_out)
{ … }
static int wm9713_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id,
int source, unsigned int freq_in, unsigned int freq_out)
{ … }
static int wm9713_set_dai_tristate(struct snd_soc_dai *codec_dai,
int tristate)
{ … }
static int wm9713_set_dai_clkdiv(struct snd_soc_dai *codec_dai,
int div_id, int div)
{ … }
static int wm9713_set_dai_fmt(struct snd_soc_dai *codec_dai,
unsigned int fmt)
{ … }
static int wm9713_pcm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static int ac97_hifi_prepare(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
static int ac97_aux_prepare(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
#define WM9713_RATES …
#define WM9713_PCM_RATES …
#define WM9713_PCM_FORMATS …
static const struct snd_soc_dai_ops wm9713_dai_ops_hifi = …;
static const struct snd_soc_dai_ops wm9713_dai_ops_aux = …;
static const struct snd_soc_dai_ops wm9713_dai_ops_voice = …;
static struct snd_soc_dai_driver wm9713_dai[] = …;
static int wm9713_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level)
{ … }
static int wm9713_soc_suspend(struct snd_soc_component *component)
{ … }
static int wm9713_soc_resume(struct snd_soc_component *component)
{ … }
static int wm9713_soc_probe(struct snd_soc_component *component)
{ … }
static void wm9713_soc_remove(struct snd_soc_component *component)
{ … }
static const struct snd_soc_component_driver soc_component_dev_wm9713 = …;
static int wm9713_probe(struct platform_device *pdev)
{ … }
static struct platform_driver wm9713_codec_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;