include/sound/tas2781.h

Source file repositories/reference/linux-study-clean/include/sound/tas2781.h

File Facts

System
Linux kernel
Corpus path
include/sound/tas2781.h
Extension
.h
Size
8585 bytes
Lines
279
Domain
Driver Families
Bucket
include/sound
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct bulk_reg_val {
	int reg;
	unsigned char val[4];
	unsigned char val_len;
	bool is_locked;
};

struct tasdevice {
	struct bulk_reg_val *cali_data_backup;
	struct bulk_reg_val alp_cali_bckp;
	struct tasdevice_fw *cali_data_fmw;
	void *cali_specific;
	unsigned int dev_addr;
	unsigned int err_code;
	unsigned char cur_book;
	short cur_prog;
	short cur_conf;
	bool is_loading;
	bool is_loaderr;
};

struct cali_reg {
	unsigned int r0_reg;
	unsigned int r0_low_reg;
	unsigned int invr0_reg;
	unsigned int pow_reg;
	unsigned int tlimit_reg;
};

struct calidata {
	unsigned char *data;
	unsigned long total_sz;
	struct cali_reg cali_reg_array;
	unsigned int cali_dat_sz_per_dev;
};

/*
 * To enable CONFIG_SND_SOC_TAS2781_ACOUST_I2C will create a bridge to the
 * acoustic tuning tool which can tune the chips' acoustic effect. Due to the
 * whole directly exposing the registers, there exist some potential risks. So
 * this define is invisible in Kconfig, anyone who wants to use acoustic tool
 * have to edit the source manually.
 */
#ifdef CONFIG_SND_SOC_TAS2781_ACOUST_I2C
#define TASDEV_DATA_PAYLOAD_SIZE	128
struct acoustic_data {
	unsigned char len;
	unsigned char id;
	unsigned char addr;
	unsigned char book;
	unsigned char page;
	unsigned char reg;
	unsigned char data[TASDEV_DATA_PAYLOAD_SIZE];
};
#endif

struct tasdevice_priv {
	struct tasdevice tasdevice[TASDEVICE_MAX_CHANNELS];
	struct tasdevice_rca rcabin;
	struct calidata cali_data;
#ifdef CONFIG_SND_SOC_TAS2781_ACOUST_I2C
	struct acoustic_data acou_data;
#endif
	struct tasdevice_fw *fmw;
	struct gpio_desc *reset;
	struct mutex codec_lock;
	struct regmap *regmap;
	struct device *dev;

	unsigned char cal_binaryname[TASDEVICE_MAX_CHANNELS][64];
	unsigned char crc8_lkp_tbl[CRC8_TABLE_SIZE];
	unsigned char coef_binaryname[64];
	unsigned char rca_binaryname[64];
	unsigned char dev_name[32];
	const unsigned char (*dvc_tlv_table)[4];
	const char *name_prefix;
	unsigned char ndev;
	unsigned int dspbin_typ;
	unsigned int magic_num;
	unsigned int chip_id;
	unsigned int sysclk;
	int speaker_id;

	int irq;
	int cur_prog;
	int cur_conf;
	int fw_state;
	int index;
	void *client;
	void *codec;

Annotation

Implementation Notes