#include <linux/module.h>
#include <linux/err.h>
#include <linux/pm.h>
#include <linux/i2c.h>
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/regmap.h>
#include <linux/of.h>
#include <sound/soc.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/tlv.h>
#include "tas2780.h"
struct tas2780_priv { … };
static void tas2780_reset(struct tas2780_priv *tas2780)
{ … }
#ifdef CONFIG_PM
static int tas2780_codec_suspend(struct snd_soc_component *component)
{ … }
static int tas2780_codec_resume(struct snd_soc_component *component)
{ … }
#endif
static const char * const tas2780_ASI1_src[] = …;
static SOC_ENUM_SINGLE_DECL(
tas2780_ASI1_src_enum, TAS2780_TDM_CFG2, 4, tas2780_ASI1_src);
static const struct snd_kcontrol_new tas2780_asi1_mux = …;
static const struct snd_kcontrol_new isense_switch = …;
static const struct snd_kcontrol_new vsense_switch = …;
static const struct snd_soc_dapm_widget tas2780_dapm_widgets[] = …;
static const struct snd_soc_dapm_route tas2780_audio_map[] = …;
static int tas2780_mute(struct snd_soc_dai *dai, int mute, int direction)
{ … }
static int tas2780_set_bitwidth(struct tas2780_priv *tas2780, int bitwidth)
{ … }
static int tas2780_set_samplerate(
struct tas2780_priv *tas2780, int samplerate)
{ … }
static int tas2780_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
{ … }
static int tas2780_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
{ … }
static int tas2780_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 tas2780_dai_ops = …;
#define TAS2780_FORMATS …
#define TAS2780_RATES …
static struct snd_soc_dai_driver tas2780_dai_driver[] = …;
static int tas2780_codec_probe(struct snd_soc_component *component)
{ … }
static DECLARE_TLV_DB_SCALE(tas2780_digital_tlv, 1100, 50, 0);
static DECLARE_TLV_DB_SCALE(tas2780_playback_volume, -10000, 50, 0);
static const struct snd_kcontrol_new tas2780_snd_controls[] = …;
static const struct snd_soc_component_driver soc_component_driver_tas2780 = …;
static const struct reg_default tas2780_reg_defaults[] = …;
static const struct regmap_range_cfg tas2780_regmap_ranges[] = …;
static const struct regmap_config tas2780_i2c_regmap = …;
static int tas2780_parse_dt(struct device *dev, struct tas2780_priv *tas2780)
{ … }
static int tas2780_i2c_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id tas2780_i2c_id[] = …;
MODULE_DEVICE_TABLE(i2c, tas2780_i2c_id);
#if defined(CONFIG_OF)
static const struct of_device_id tas2780_of_match[] = …;
MODULE_DEVICE_TABLE(of, tas2780_of_match);
#endif
static struct i2c_driver tas2780_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;