#include <linux/delay.h>
#include <linux/device.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
#include <sound/core.h>
#include <sound/initval.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/tlv.h>
#include <dt-bindings/sound/adi,adau1977.h>
#include "adau1977.h"
#define ADAU1977_REG_POWER …
#define ADAU1977_REG_PLL …
#define ADAU1977_REG_BOOST …
#define ADAU1977_REG_MICBIAS …
#define ADAU1977_REG_BLOCK_POWER_SAI …
#define ADAU1977_REG_SAI_CTRL0 …
#define ADAU1977_REG_SAI_CTRL1 …
#define ADAU1977_REG_CMAP12 …
#define ADAU1977_REG_CMAP34 …
#define ADAU1977_REG_SAI_OVERTEMP …
#define ADAU1977_REG_POST_ADC_GAIN(x) …
#define ADAU1977_REG_MISC_CONTROL …
#define ADAU1977_REG_DIAG_CONTROL …
#define ADAU1977_REG_STATUS(x) …
#define ADAU1977_REG_DIAG_IRQ1 …
#define ADAU1977_REG_DIAG_IRQ2 …
#define ADAU1977_REG_ADJUST1 …
#define ADAU1977_REG_ADJUST2 …
#define ADAU1977_REG_ADC_CLIP …
#define ADAU1977_REG_DC_HPF_CAL …
#define ADAU1977_POWER_RESET …
#define ADAU1977_POWER_PWUP …
#define ADAU1977_PLL_CLK_S …
#define ADAU1977_PLL_MCS_MASK …
#define ADAU1977_MICBIAS_MB_VOLTS_MASK …
#define ADAU1977_MICBIAS_MB_VOLTS_OFFSET …
#define ADAU1977_BLOCK_POWER_SAI_LR_POL …
#define ADAU1977_BLOCK_POWER_SAI_BCLK_EDGE …
#define ADAU1977_BLOCK_POWER_SAI_LDO_EN …
#define ADAU1977_SAI_CTRL0_FMT_MASK …
#define ADAU1977_SAI_CTRL0_FMT_I2S …
#define ADAU1977_SAI_CTRL0_FMT_LJ …
#define ADAU1977_SAI_CTRL0_FMT_RJ_24BIT …
#define ADAU1977_SAI_CTRL0_FMT_RJ_16BIT …
#define ADAU1977_SAI_CTRL0_SAI_MASK …
#define ADAU1977_SAI_CTRL0_SAI_I2S …
#define ADAU1977_SAI_CTRL0_SAI_TDM_2 …
#define ADAU1977_SAI_CTRL0_SAI_TDM_4 …
#define ADAU1977_SAI_CTRL0_SAI_TDM_8 …
#define ADAU1977_SAI_CTRL0_SAI_TDM_16 …
#define ADAU1977_SAI_CTRL0_FS_MASK …
#define ADAU1977_SAI_CTRL0_FS_8000_12000 …
#define ADAU1977_SAI_CTRL0_FS_16000_24000 …
#define ADAU1977_SAI_CTRL0_FS_32000_48000 …
#define ADAU1977_SAI_CTRL0_FS_64000_96000 …
#define ADAU1977_SAI_CTRL0_FS_128000_192000 …
#define ADAU1977_SAI_CTRL1_SLOT_WIDTH_MASK …
#define ADAU1977_SAI_CTRL1_SLOT_WIDTH_32 …
#define ADAU1977_SAI_CTRL1_SLOT_WIDTH_24 …
#define ADAU1977_SAI_CTRL1_SLOT_WIDTH_16 …
#define ADAU1977_SAI_CTRL1_DATA_WIDTH_MASK …
#define ADAU1977_SAI_CTRL1_DATA_WIDTH_16BIT …
#define ADAU1977_SAI_CTRL1_DATA_WIDTH_24BIT …
#define ADAU1977_SAI_CTRL1_LRCLK_PULSE …
#define ADAU1977_SAI_CTRL1_MSB …
#define ADAU1977_SAI_CTRL1_BCLKRATE_16 …
#define ADAU1977_SAI_CTRL1_BCLKRATE_32 …
#define ADAU1977_SAI_CTRL1_BCLKRATE_MASK …
#define ADAU1977_SAI_CTRL1_MASTER …
#define ADAU1977_SAI_OVERTEMP_DRV_C(x) …
#define ADAU1977_SAI_OVERTEMP_DRV_HIZ …
#define ADAU1977_MISC_CONTROL_SUM_MODE_MASK …
#define ADAU1977_MISC_CONTROL_SUM_MODE_1CH …
#define ADAU1977_MISC_CONTROL_SUM_MODE_2CH …
#define ADAU1977_MISC_CONTROL_SUM_MODE_4CH …
#define ADAU1977_MISC_CONTROL_MMUTE …
#define ADAU1977_MISC_CONTROL_DC_CAL …
#define ADAU1977_CHAN_MAP_SECOND_SLOT_OFFSET …
#define ADAU1977_CHAN_MAP_FIRST_SLOT_OFFSET …
struct adau1977 { … };
static const struct reg_default adau1977_reg_defaults[] = …;
static const DECLARE_TLV_DB_MINMAX_MUTE(adau1977_adc_gain, -3562, 6000);
static const struct snd_soc_dapm_widget adau1977_micbias_dapm_widgets[] = …;
static const struct snd_soc_dapm_widget adau1977_dapm_widgets[] = …;
static const struct snd_soc_dapm_route adau1977_dapm_routes[] = …;
#define ADAU1977_VOLUME(x) …
#define ADAU1977_HPF_SWITCH(x) …
#define ADAU1977_DC_SUB_SWITCH(x) …
static const struct snd_kcontrol_new adau1977_snd_controls[] = …;
static int adau1977_reset(struct adau1977 *adau1977)
{ … }
static int adau1977_lookup_fs(unsigned int rate)
{ … }
static int adau1977_lookup_mcs(struct adau1977 *adau1977, unsigned int rate,
unsigned int fs)
{ … }
static int adau1977_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
{ … }
static int adau1977_power_disable(struct adau1977 *adau1977)
{ … }
static int adau1977_power_enable(struct adau1977 *adau1977)
{ … }
static int adau1977_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level)
{ … }
static int adau1977_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
unsigned int rx_mask, int slots, int width)
{ … }
static int adau1977_mute(struct snd_soc_dai *dai, int mute, int stream)
{ … }
static int adau1977_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
{ … }
static int adau1977_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
static int adau1977_set_tristate(struct snd_soc_dai *dai, int tristate)
{ … }
static const struct snd_soc_dai_ops adau1977_dai_ops = …;
static struct snd_soc_dai_driver adau1977_dai = …;
static const unsigned int adau1977_rates[] = …;
#define ADAU1977_RATE_CONSTRAINT_MASK_32000 …
#define ADAU1977_RATE_CONSTRAINT_MASK_44100 …
#define ADAU1977_RATE_CONSTRAINT_MASK_48000 …
#define ADAU1977_RATE_CONSTRAINT_MASK_LRCLK …
static bool adau1977_check_sysclk(unsigned int mclk, unsigned int base_freq)
{ … }
static int adau1977_set_sysclk(struct snd_soc_component *component,
int clk_id, int source, unsigned int freq, int dir)
{ … }
static int adau1977_component_probe(struct snd_soc_component *component)
{ … }
static const struct snd_soc_component_driver adau1977_component_driver = …;
static int adau1977_setup_micbias(struct adau1977 *adau1977)
{ … }
int adau1977_probe(struct device *dev, struct regmap *regmap,
enum adau1977_type type, void (*switch_mode)(struct device *dev))
{ … }
EXPORT_SYMBOL_GPL(…);
static bool adau1977_register_volatile(struct device *dev, unsigned int reg)
{ … }
const struct regmap_config adau1977_regmap_config = …;
EXPORT_SYMBOL_GPL(…);
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;