#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/regmap.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 "alc5632.h"
static const struct reg_default alc5632_reg_defaults[] = …;
struct alc5632_priv { … };
static bool alc5632_volatile_register(struct device *dev,
unsigned int reg)
{ … }
static inline int alc5632_reset(struct regmap *map)
{ … }
static int amp_mixer_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static const DECLARE_TLV_DB_SCALE(vol_tlv, -3450, 150, 0);
static const DECLARE_TLV_DB_SCALE(hp_tlv, -4650, 150, 0);
static const DECLARE_TLV_DB_SCALE(adc_rec_tlv, -1650, 150, 0);
static const DECLARE_TLV_DB_RANGE(boost_tlv,
0, 1, TLV_DB_SCALE_ITEM(0, 2000, 0),
1, 3, TLV_DB_SCALE_ITEM(2000, 1000, 0)
);
static const DECLARE_TLV_DB_SCALE(dig_tlv, 0, 600, 0);
static const DECLARE_TLV_DB_SCALE(vdac_tlv, -3525, 75, 0);
static const struct snd_kcontrol_new alc5632_vol_snd_controls[] = …;
static const struct snd_kcontrol_new alc5632_snd_controls[] = …;
static const struct snd_kcontrol_new alc5632_hp_mixer_controls[] = …;
static const struct snd_kcontrol_new alc5632_hpl_mixer_controls[] = …;
static const struct snd_kcontrol_new alc5632_hpr_mixer_controls[] = …;
static const struct snd_kcontrol_new alc5632_mono_mixer_controls[] = …;
static const struct snd_kcontrol_new alc5632_speaker_mixer_controls[] = …;
static const struct snd_kcontrol_new alc5632_captureL_mixer_controls[] = …;
static const struct snd_kcontrol_new alc5632_captureR_mixer_controls[] = …;
static const struct snd_kcontrol_new alc5632_dmicl_mixer_controls[] = …;
static const struct snd_kcontrol_new alc5632_dmicr_mixer_controls[] = …;
static const char * const alc5632_spk_n_sour_sel[] = …;
static const char * const alc5632_hpl_out_input_sel[] = …;
static const char * const alc5632_hpr_out_input_sel[] = …;
static const char * const alc5632_spkout_input_sel[] = …;
static const char * const alc5632_aux_out_input_sel[] = …;
static const char * const alc5632_adcr_func_sel[] = …;
static const char * const alc5632_i2s_out_sel[] = …;
static SOC_ENUM_SINGLE_DECL(alc5632_aux_out_input_enum,
ALC5632_OUTPUT_MIXER_CTRL, 6,
alc5632_aux_out_input_sel);
static const struct snd_kcontrol_new alc5632_auxout_mux_controls = …;
static SOC_ENUM_SINGLE_DECL(alc5632_spkout_input_enum,
ALC5632_OUTPUT_MIXER_CTRL, 10,
alc5632_spkout_input_sel);
static const struct snd_kcontrol_new alc5632_spkout_mux_controls = …;
static SOC_ENUM_SINGLE_DECL(alc5632_hpl_out_input_enum,
ALC5632_OUTPUT_MIXER_CTRL, 9,
alc5632_hpl_out_input_sel);
static const struct snd_kcontrol_new alc5632_hpl_out_mux_controls = …;
static SOC_ENUM_SINGLE_DECL(alc5632_hpr_out_input_enum,
ALC5632_OUTPUT_MIXER_CTRL, 8,
alc5632_hpr_out_input_sel);
static const struct snd_kcontrol_new alc5632_hpr_out_mux_controls = …;
static SOC_ENUM_SINGLE_DECL(alc5632_spk_n_sour_enum,
ALC5632_OUTPUT_MIXER_CTRL, 14,
alc5632_spk_n_sour_sel);
static const struct snd_kcontrol_new alc5632_spkoutn_mux_controls = …;
static const char *alc5632_amp_names[] = …;
static SOC_ENUM_SINGLE_DECL(alc5632_amp_enum,
ALC5632_OUTPUT_MIXER_CTRL, 13,
alc5632_amp_names);
static const struct snd_kcontrol_new alc5632_amp_mux_controls = …;
static SOC_ENUM_SINGLE_DECL(alc5632_adcr_func_enum,
ALC5632_DAC_FUNC_SELECT, 5,
alc5632_adcr_func_sel);
static const struct snd_kcontrol_new alc5632_adcr_func_controls = …;
static SOC_ENUM_SINGLE_DECL(alc5632_i2s_out_enum,
ALC5632_I2S_OUT_CTL, 5,
alc5632_i2s_out_sel);
static const struct snd_kcontrol_new alc5632_i2s_out_controls = …;
static const struct snd_soc_dapm_widget alc5632_dapm_widgets[] = …;
static const struct snd_soc_dapm_route alc5632_dapm_routes[] = …;
struct _pll_div { … };
static const struct _pll_div codec_master_pll_div[] = …;
static const struct _pll_div codec_slave_pll_div[] = …;
static int alc5632_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id,
int source, unsigned int freq_in, unsigned int freq_out)
{ … }
struct _coeff_div { … };
static const struct _coeff_div coeff_div[] = …;
static int get_coeff(struct snd_soc_component *component, int rate)
{ … }
static int alc5632_set_dai_sysclk(struct snd_soc_dai *codec_dai,
int clk_id, unsigned int freq, int dir)
{ … }
static int alc5632_set_dai_fmt(struct snd_soc_dai *codec_dai,
unsigned int fmt)
{ … }
static int alc5632_pcm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
{ … }
static int alc5632_mute(struct snd_soc_dai *dai, int mute, int direction)
{ … }
#define ALC5632_ADD2_POWER_EN …
#define ALC5632_ADD3_POWER_EN …
#define ALC5632_ADD1_POWER_EN …
static void enable_power_depop(struct snd_soc_component *component)
{ … }
static int alc5632_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level)
{ … }
#define ALC5632_FORMATS …
static const struct snd_soc_dai_ops alc5632_dai_ops = …;
static struct snd_soc_dai_driver alc5632_dai = …;
#ifdef CONFIG_PM
static int alc5632_resume(struct snd_soc_component *component)
{ … }
#else
#define alc5632_resume …
#endif
static int alc5632_probe(struct snd_soc_component *component)
{ … }
static const struct snd_soc_component_driver soc_component_device_alc5632 = …;
static const struct regmap_config alc5632_regmap = …;
static const struct i2c_device_id alc5632_i2c_table[] = …;
MODULE_DEVICE_TABLE(i2c, alc5632_i2c_table);
static int alc5632_i2c_probe(struct i2c_client *client)
{ … }
#ifdef CONFIG_OF
static const struct of_device_id alc5632_of_match[] = …;
MODULE_DEVICE_TABLE(of, alc5632_of_match);
#endif
static struct i2c_driver alc5632_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;