#include <linux/module.h>
#include <linux/init.h>
#include <linux/clk.h>
#include <linux/delay.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/i2c.h>
#include <linux/spi/spi.h>
#include <linux/regmap.h>
#include <asm/unaligned.h>
#include "sigmadsp.h"
#include "adau17x1.h"
#include "adau-utils.h"
#define ADAU17X1_SAFELOAD_TARGET_ADDRESS …
#define ADAU17X1_SAFELOAD_TRIGGER …
#define ADAU17X1_SAFELOAD_DATA …
#define ADAU17X1_SAFELOAD_DATA_SIZE …
#define ADAU17X1_WORD_SIZE …
static const char * const adau17x1_capture_mixer_boost_text[] = …;
static SOC_ENUM_SINGLE_DECL(adau17x1_capture_boost_enum,
ADAU17X1_REC_POWER_MGMT, 5, adau17x1_capture_mixer_boost_text);
static const char * const adau17x1_mic_bias_mode_text[] = …;
static SOC_ENUM_SINGLE_DECL(adau17x1_mic_bias_mode_enum,
ADAU17X1_MICBIAS, 3, adau17x1_mic_bias_mode_text);
static const DECLARE_TLV_DB_MINMAX(adau17x1_digital_tlv, -9563, 0);
static const struct snd_kcontrol_new adau17x1_controls[] = …;
static int adau17x1_setup_firmware(struct snd_soc_component *component,
unsigned int rate);
static int adau17x1_pll_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int adau17x1_adc_fixup(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static const char * const adau17x1_mono_stereo_text[] = …;
static SOC_ENUM_SINGLE_DECL(adau17x1_dac_mode_enum,
ADAU17X1_DAC_CONTROL0, 6, adau17x1_mono_stereo_text);
static const struct snd_kcontrol_new adau17x1_dac_mode_mux = …;
static const struct snd_soc_dapm_widget adau17x1_dapm_widgets[] = …;
static const struct snd_soc_dapm_route adau17x1_dapm_routes[] = …;
static const struct snd_soc_dapm_route adau17x1_dapm_pll_route = …;
static int adau17x1_dsp_mux_enum_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int adau17x1_dsp_mux_enum_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
#define DECLARE_ADAU17X1_DSP_MUX_CTRL(_name, _label, _stream, _text) …
static const char * const adau17x1_dac_mux_text[] = …;
static const char * const adau17x1_capture_mux_text[] = …;
static DECLARE_ADAU17X1_DSP_MUX_CTRL(adau17x1_dac_mux, "DAC Playback Mux",
SNDRV_PCM_STREAM_PLAYBACK, adau17x1_dac_mux_text);
static DECLARE_ADAU17X1_DSP_MUX_CTRL(adau17x1_capture_mux, "Capture Mux",
SNDRV_PCM_STREAM_CAPTURE, adau17x1_capture_mux_text);
static const struct snd_soc_dapm_widget adau17x1_dsp_dapm_widgets[] = …;
static const struct snd_soc_dapm_route adau17x1_dsp_dapm_routes[] = …;
static const struct snd_soc_dapm_route adau17x1_no_dsp_dapm_routes[] = …;
static bool adau17x1_has_dsp(struct adau *adau)
{ … }
static bool adau17x1_has_disused_dsp(struct adau *adau)
{ … }
static bool adau17x1_has_safeload(struct adau *adau)
{ … }
static int adau17x1_set_dai_pll(struct snd_soc_dai *dai, int pll_id,
int source, unsigned int freq_in, unsigned int freq_out)
{ … }
static int adau17x1_set_dai_sysclk(struct snd_soc_dai *dai,
int clk_id, unsigned int freq, int dir)
{ … }
static int adau17x1_auto_pll(struct snd_soc_dai *dai,
struct snd_pcm_hw_params *params)
{ … }
static int adau17x1_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
{ … }
static int adau17x1_set_dai_fmt(struct snd_soc_dai *dai,
unsigned int fmt)
{ … }
static int adau17x1_set_dai_tdm_slot(struct snd_soc_dai *dai,
unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width)
{ … }
static int adau17x1_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
const struct snd_soc_dai_ops adau17x1_dai_ops = …;
EXPORT_SYMBOL_GPL(…);
int adau17x1_set_micbias_voltage(struct snd_soc_component *component,
enum adau17x1_micbias_voltage micbias)
{ … }
EXPORT_SYMBOL_GPL(…);
bool adau17x1_precious_register(struct device *dev, unsigned int reg)
{ … }
EXPORT_SYMBOL_GPL(…);
bool adau17x1_readable_register(struct device *dev, unsigned int reg)
{ … }
EXPORT_SYMBOL_GPL(…);
bool adau17x1_volatile_register(struct device *dev, unsigned int reg)
{ … }
EXPORT_SYMBOL_GPL(…);
static int adau17x1_setup_firmware(struct snd_soc_component *component,
unsigned int rate)
{ … }
int adau17x1_add_widgets(struct snd_soc_component *component)
{ … }
EXPORT_SYMBOL_GPL(…);
int adau17x1_add_routes(struct snd_soc_component *component)
{ … }
EXPORT_SYMBOL_GPL(…);
int adau17x1_resume(struct snd_soc_component *component)
{ … }
EXPORT_SYMBOL_GPL(…);
static int adau17x1_safeload(struct sigmadsp *sigmadsp, unsigned int addr,
const uint8_t bytes[], size_t len)
{ … }
static const struct sigmadsp_ops adau17x1_sigmadsp_ops = …;
int adau17x1_probe(struct device *dev, struct regmap *regmap,
enum adau17x1_type type, void (*switch_mode)(struct device *dev),
const char *firmware_name)
{ … }
EXPORT_SYMBOL_GPL(…);
void adau17x1_remove(struct device *dev)
{ … }
EXPORT_SYMBOL_GPL(…);
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;