#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/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 "tas2764.h"
struct tas2764_priv { … };
static const char *tas2764_int_ltch0_msgs[8] = …;
static const unsigned int tas2764_int_readout_regs[6] = …;
static irqreturn_t tas2764_irq(int irq, void *data)
{ … }
static void tas2764_reset(struct tas2764_priv *tas2764)
{ … }
static int tas2764_update_pwr_ctrl(struct tas2764_priv *tas2764)
{ … }
#ifdef CONFIG_PM
static int tas2764_codec_suspend(struct snd_soc_component *component)
{ … }
static int tas2764_codec_resume(struct snd_soc_component *component)
{ … }
#else
#define tas2764_codec_suspend …
#define tas2764_codec_resume …
#endif
static const char * const tas2764_ASI1_src[] = …;
static SOC_ENUM_SINGLE_DECL(
tas2764_ASI1_src_enum, TAS2764_TDM_CFG2, TAS2764_TDM_CFG2_SCFG_SHIFT,
tas2764_ASI1_src);
static const struct snd_kcontrol_new tas2764_asi1_mux = …;
static int tas2764_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 tas2764_dapm_widgets[] = …;
static const struct snd_soc_dapm_route tas2764_audio_map[] = …;
static int tas2764_mute(struct snd_soc_dai *dai, int mute, int direction)
{ … }
static int tas2764_set_bitwidth(struct tas2764_priv *tas2764, int bitwidth)
{ … }
static int tas2764_set_samplerate(struct tas2764_priv *tas2764, int samplerate)
{ … }
static int tas2764_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static int tas2764_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
{ … }
static int tas2764_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 tas2764_dai_ops = …;
#define TAS2764_FORMATS …
#define TAS2764_RATES …
static struct snd_soc_dai_driver tas2764_dai_driver[] = …;
static int tas2764_codec_probe(struct snd_soc_component *component)
{ … }
static DECLARE_TLV_DB_SCALE(tas2764_digital_tlv, 1100, 50, 0);
static DECLARE_TLV_DB_SCALE(tas2764_playback_volume, -10050, 50, 1);
static const char * const tas2764_hpf_texts[] = …;
static SOC_ENUM_SINGLE_DECL(
tas2764_hpf_enum, TAS2764_DC_BLK0,
TAS2764_DC_BLK0_HPF_FREQ_PB_SHIFT, tas2764_hpf_texts);
static const struct snd_kcontrol_new tas2764_snd_controls[] = …;
static const struct snd_soc_component_driver soc_component_driver_tas2764 = …;
static const struct reg_default tas2764_reg_defaults[] = …;
static const struct regmap_range_cfg tas2764_regmap_ranges[] = …;
static bool tas2764_volatile_register(struct device *dev, unsigned int reg)
{ … }
static const struct regmap_config tas2764_i2c_regmap = …;
static int tas2764_parse_dt(struct device *dev, struct tas2764_priv *tas2764)
{ … }
static int tas2764_i2c_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id tas2764_i2c_id[] = …;
MODULE_DEVICE_TABLE(i2c, tas2764_i2c_id);
#if defined(CONFIG_OF)
static const struct of_device_id tas2764_of_match[] = …;
MODULE_DEVICE_TABLE(of, tas2764_of_match);
#endif
static struct i2c_driver tas2764_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;