#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/platform_device.h>
#include <linux/regulator/consumer.h>
#include <linux/mfd/wm8400-audio.h>
#include <linux/mfd/wm8400-private.h>
#include <linux/mfd/core.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 "wm8400.h"
static struct regulator_bulk_data power[] = …;
struct wm8400_priv { … };
static void wm8400_component_reset(struct snd_soc_component *component)
{ … }
static const DECLARE_TLV_DB_SCALE(in_pga_tlv, -1650, 3000, 0);
static const DECLARE_TLV_DB_SCALE(out_mix_tlv, -2100, 0, 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 wm8400_outpga_put_volsw_vu(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
#define WM8400_OUTPGA_SINGLE_R_TLV(xname, reg, shift, max, invert, tlv_array) …
static const char *wm8400_digital_sidetone[] = …;
static SOC_ENUM_SINGLE_DECL(wm8400_left_digital_sidetone_enum,
WM8400_DIGITAL_SIDE_TONE,
WM8400_ADC_TO_DACL_SHIFT,
wm8400_digital_sidetone);
static SOC_ENUM_SINGLE_DECL(wm8400_right_digital_sidetone_enum,
WM8400_DIGITAL_SIDE_TONE,
WM8400_ADC_TO_DACR_SHIFT,
wm8400_digital_sidetone);
static const char *wm8400_adcmode[] = …;
static SOC_ENUM_SINGLE_DECL(wm8400_right_adcmode_enum,
WM8400_ADC_CTRL,
WM8400_ADC_HPF_CUT_SHIFT,
wm8400_adcmode);
static const struct snd_kcontrol_new wm8400_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 wm8400_dapm_lin12_pga_controls[] = …;
static const struct snd_kcontrol_new wm8400_dapm_lin34_pga_controls[] = …;
static const struct snd_kcontrol_new wm8400_dapm_rin12_pga_controls[] = …;
static const struct snd_kcontrol_new wm8400_dapm_rin34_pga_controls[] = …;
static const struct snd_kcontrol_new wm8400_dapm_inmixl_controls[] = …;
static const struct snd_kcontrol_new wm8400_dapm_inmixr_controls[] = …;
static const char *wm8400_ainlmux[] = …;
static SOC_ENUM_SINGLE_DECL(wm8400_ainlmux_enum,
WM8400_INPUT_MIXER1,
WM8400_AINLMODE_SHIFT,
wm8400_ainlmux);
static const struct snd_kcontrol_new wm8400_dapm_ainlmux_controls = …;
static const char *wm8400_ainrmux[] = …;
static SOC_ENUM_SINGLE_DECL(wm8400_ainrmux_enum,
WM8400_INPUT_MIXER1,
WM8400_AINRMODE_SHIFT,
wm8400_ainrmux);
static const struct snd_kcontrol_new wm8400_dapm_ainrmux_controls = …;
static const struct snd_kcontrol_new wm8400_dapm_lomix_controls[] = …;
static const struct snd_kcontrol_new wm8400_dapm_romix_controls[] = …;
static const struct snd_kcontrol_new wm8400_dapm_lonmix_controls[] = …;
static const struct snd_kcontrol_new wm8400_dapm_lopmix_controls[] = …;
static const struct snd_kcontrol_new wm8400_dapm_ronmix_controls[] = …;
static const struct snd_kcontrol_new wm8400_dapm_ropmix_controls[] = …;
static const struct snd_kcontrol_new wm8400_dapm_out3mix_controls[] = …;
static const struct snd_kcontrol_new wm8400_dapm_out4mix_controls[] = …;
static const struct snd_kcontrol_new wm8400_dapm_spkmix_controls[] = …;
static const struct snd_soc_dapm_widget wm8400_dapm_widgets[] = …;
static const struct snd_soc_dapm_route wm8400_dapm_routes[] = …;
static int wm8400_set_dai_sysclk(struct snd_soc_dai *codec_dai,
int clk_id, unsigned int freq, int dir)
{ … }
struct fll_factors { … };
#define FIXED_FLL_SIZE …
static int fll_factors(struct wm8400_priv *wm8400, struct fll_factors *factors,
unsigned int Fref, unsigned int Fout)
{ … }
static int wm8400_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id,
int source, unsigned int freq_in,
unsigned int freq_out)
{ … }
static int wm8400_set_dai_fmt(struct snd_soc_dai *codec_dai,
unsigned int fmt)
{ … }
static int wm8400_set_dai_clkdiv(struct snd_soc_dai *codec_dai,
int div_id, int div)
{ … }
static int wm8400_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static int wm8400_mute(struct snd_soc_dai *dai, int mute, int direction)
{ … }
static int wm8400_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level)
{ … }
#define WM8400_RATES …
#define WM8400_FORMATS …
static const struct snd_soc_dai_ops wm8400_dai_ops = …;
static struct snd_soc_dai_driver wm8400_dai = …;
static int wm8400_component_probe(struct snd_soc_component *component)
{ … }
static void wm8400_component_remove(struct snd_soc_component *component)
{ … }
static const struct snd_soc_component_driver soc_component_dev_wm8400 = …;
static int wm8400_probe(struct platform_device *pdev)
{ … }
static struct platform_driver wm8400_codec_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;