#include <linux/module.h>
#include <linux/init.h>
#include <linux/i2c.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/soc.h>
#include <sound/tlv.h>
#include <linux/platform_data/adau17x1.h>
#include "adau17x1.h"
#include "adau1781.h"
#define ADAU1781_DMIC_BEEP_CTRL …
#define ADAU1781_LEFT_PGA …
#define ADAU1781_RIGHT_PGA …
#define ADAU1781_LEFT_PLAYBACK_MIXER …
#define ADAU1781_RIGHT_PLAYBACK_MIXER …
#define ADAU1781_MONO_PLAYBACK_MIXER …
#define ADAU1781_LEFT_LINEOUT …
#define ADAU1781_RIGHT_LINEOUT …
#define ADAU1781_SPEAKER …
#define ADAU1781_BEEP_ZC …
#define ADAU1781_DEJITTER …
#define ADAU1781_DIG_PWDN0 …
#define ADAU1781_DIG_PWDN1 …
#define ADAU1781_INPUT_DIFFERNTIAL …
#define ADAU1381_FIRMWARE …
#define ADAU1781_FIRMWARE …
static const struct reg_default adau1781_reg_defaults[] = …;
static const DECLARE_TLV_DB_SCALE(adau1781_speaker_tlv, 0, 200, 0);
static const DECLARE_TLV_DB_RANGE(adau1781_pga_tlv,
0, 1, TLV_DB_SCALE_ITEM(0, 600, 0),
2, 3, TLV_DB_SCALE_ITEM(1000, 400, 0),
4, 4, TLV_DB_SCALE_ITEM(1700, 0, 0),
5, 7, TLV_DB_SCALE_ITEM(2000, 600, 0)
);
static const DECLARE_TLV_DB_RANGE(adau1781_beep_tlv,
0, 1, TLV_DB_SCALE_ITEM(0, 600, 0),
2, 3, TLV_DB_SCALE_ITEM(1000, 400, 0),
4, 4, TLV_DB_SCALE_ITEM(-2300, 0, 0),
5, 7, TLV_DB_SCALE_ITEM(2000, 600, 0)
);
static const DECLARE_TLV_DB_SCALE(adau1781_sidetone_tlv, -1800, 300, 1);
static const char * const adau1781_speaker_bias_select_text[] = …;
static const char * const adau1781_bias_select_text[] = …;
static SOC_ENUM_SINGLE_DECL(adau1781_adc_bias_enum,
ADAU17X1_REC_POWER_MGMT, 3, adau1781_bias_select_text);
static SOC_ENUM_SINGLE_DECL(adau1781_speaker_bias_enum,
ADAU17X1_PLAY_POWER_MGMT, 6, adau1781_speaker_bias_select_text);
static SOC_ENUM_SINGLE_DECL(adau1781_dac_bias_enum,
ADAU17X1_PLAY_POWER_MGMT, 4, adau1781_bias_select_text);
static SOC_ENUM_SINGLE_DECL(adau1781_playback_bias_enum,
ADAU17X1_PLAY_POWER_MGMT, 2, adau1781_bias_select_text);
static SOC_ENUM_SINGLE_DECL(adau1781_capture_bias_enum,
ADAU17X1_REC_POWER_MGMT, 1, adau1781_bias_select_text);
static const struct snd_kcontrol_new adau1781_controls[] = …;
static const struct snd_kcontrol_new adau1781_beep_mixer_controls[] = …;
static const struct snd_kcontrol_new adau1781_left_mixer_controls[] = …;
static const struct snd_kcontrol_new adau1781_right_mixer_controls[] = …;
static const struct snd_kcontrol_new adau1781_mono_mixer_controls[] = …;
static int adau1781_dejitter_fixup(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static const struct snd_soc_dapm_widget adau1781_dapm_widgets[] = …;
static const struct snd_soc_dapm_route adau1781_dapm_routes[] = …;
static const struct snd_soc_dapm_route adau1781_adc_dapm_routes[] = …;
static const char * const adau1781_dmic_select_text[] = …;
static SOC_ENUM_SINGLE_VIRT_DECL(adau1781_dmic_select_enum,
adau1781_dmic_select_text);
static const struct snd_kcontrol_new adau1781_dmic_mux = …;
static const struct snd_soc_dapm_widget adau1781_dmic_dapm_widgets[] = …;
static const struct snd_soc_dapm_route adau1781_dmic_dapm_routes[] = …;
static int adau1781_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level)
{ … }
static bool adau1781_readable_register(struct device *dev, unsigned int reg)
{ … }
static int adau1781_set_input_mode(struct adau *adau, unsigned int reg,
bool differential)
{ … }
static int adau1781_component_probe(struct snd_soc_component *component)
{ … }
static const struct snd_soc_component_driver adau1781_component_driver = …;
#define ADAU1781_FORMATS …
static struct snd_soc_dai_driver adau1781_dai_driver = …;
const struct regmap_config adau1781_regmap_config = …;
EXPORT_SYMBOL_GPL(…);
int adau1781_probe(struct device *dev, struct regmap *regmap,
enum adau17x1_type type, void (*switch_mode)(struct device *dev))
{ … }
EXPORT_SYMBOL_GPL(…);
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;