#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/i2c.h>
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/regulator/consumer.h>
#include <linux/firmware.h>
#include <linux/regmap.h>
#include <linux/of.h>
#include <linux/slab.h>
#include <sound/soc.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/initval.h>
#include <sound/tlv.h>
#include "tas2770.h"
#define TAS2770_MDELAY …
static void tas2770_reset(struct tas2770_priv *tas2770)
{ … }
static int tas2770_update_pwr_ctrl(struct tas2770_priv *tas2770)
{ … }
#ifdef CONFIG_PM
static int tas2770_codec_suspend(struct snd_soc_component *component)
{ … }
static int tas2770_codec_resume(struct snd_soc_component *component)
{ … }
#else
#define tas2770_codec_suspend …
#define tas2770_codec_resume …
#endif
static const char * const tas2770_ASI1_src[] = …;
static SOC_ENUM_SINGLE_DECL(
tas2770_ASI1_src_enum, TAS2770_TDM_CFG_REG2,
4, tas2770_ASI1_src);
static const struct snd_kcontrol_new tas2770_asi1_mux = …;
static int tas2770_dac_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static const struct snd_kcontrol_new isense_switch = …;
static const struct snd_kcontrol_new vsense_switch = …;
static const struct snd_soc_dapm_widget tas2770_dapm_widgets[] = …;
static const struct snd_soc_dapm_route tas2770_audio_map[] = …;
static int tas2770_mute(struct snd_soc_dai *dai, int mute, int direction)
{ … }
static int tas2770_set_bitwidth(struct tas2770_priv *tas2770, int bitwidth)
{ … }
static int tas2770_set_samplerate(struct tas2770_priv *tas2770, int samplerate)
{ … }
static int tas2770_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static int tas2770_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
{ … }
static int tas2770_set_dai_tdm_slot(struct snd_soc_dai *dai,
unsigned int tx_mask,
unsigned int rx_mask,
int slots, int slot_width)
{ … }
static const struct snd_soc_dai_ops tas2770_dai_ops = …;
#define TAS2770_FORMATS …
#define TAS2770_RATES …
static struct snd_soc_dai_driver tas2770_dai_driver[] = …;
static const struct regmap_config tas2770_i2c_regmap;
static int tas2770_codec_probe(struct snd_soc_component *component)
{ … }
static DECLARE_TLV_DB_SCALE(tas2770_digital_tlv, 1100, 50, 0);
static DECLARE_TLV_DB_SCALE(tas2770_playback_volume, -12750, 50, 0);
static const struct snd_kcontrol_new tas2770_snd_controls[] = …;
static const struct snd_soc_component_driver soc_component_driver_tas2770 = …;
static int tas2770_register_codec(struct tas2770_priv *tas2770)
{ … }
static const struct reg_default tas2770_reg_defaults[] = …;
static bool tas2770_volatile(struct device *dev, unsigned int reg)
{ … }
static bool tas2770_writeable(struct device *dev, unsigned int reg)
{ … }
static const struct regmap_range_cfg tas2770_regmap_ranges[] = …;
static const struct regmap_config tas2770_i2c_regmap = …;
static int tas2770_parse_dt(struct device *dev, struct tas2770_priv *tas2770)
{ … }
static int tas2770_i2c_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id tas2770_i2c_id[] = …;
MODULE_DEVICE_TABLE(i2c, tas2770_i2c_id);
#if defined(CONFIG_OF)
static const struct of_device_id tas2770_of_match[] = …;
MODULE_DEVICE_TABLE(of, tas2770_of_match);
#endif
static struct i2c_driver tas2770_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;