sound/soc/codecs/tas2783-sdw.c

Source file repositories/reference/linux-study-clean/sound/soc/codecs/tas2783-sdw.c

File Facts

System
Linux kernel
Corpus path
sound/soc/codecs/tas2783-sdw.c
Extension
.c
Size
44387 bytes
Lines
1367
Domain
Driver Families
Bucket
sound/soc
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 tas_fw_hdr {
	u32 size;
	u32 version_offset;
	u32 plt_id;
	u32 ppc3_ver;
	u32 timestamp;
	u8 ddc_name[64];
};

struct tas_fw_file {
	u32 vendor_id;
	u32 file_id;
	u32 version;
	u32 length;
	u32 dest_addr;
	u8 *fw_data;
};

struct calibration_data {
	u32 is_valid;
	unsigned long read_sz;
	u8 data[TAS2783_CALIB_DATA_SZ];
};

struct tas2783_prv {
	struct snd_soc_component *component;
	struct calibration_data cali_data;
	struct sdw_slave *sdw_peripheral;
	struct sdca_function_data *sa_func_data;
	enum sdw_slave_status status;
	/* calibration */
	struct mutex calib_lock;
	/* pde and firmware download */
	struct mutex pde_lock;
	struct regmap *regmap;
	struct device *dev;
	struct class *class;
	struct attribute_group *cal_attr_groups;
	struct tm tm;
	u8 rca_binaryname[64];
	u8 dev_name[32];
	bool hw_init;
	/* wq for firmware download */
	wait_queue_head_t fw_wait;
	bool fw_dl_task_done;
	bool fw_dl_success;
};

static const struct reg_default tas2783_reg_default[] = {
	{TAS2783_AMP_LEVEL, 0x28},
	{TASDEV_REG_SDW(0, 0, 0x03), 0x28},
	{TASDEV_REG_SDW(0, 0, 0x04), 0x21},
	{TASDEV_REG_SDW(0, 0, 0x05), 0x41},
	{TASDEV_REG_SDW(0, 0, 0x06), 0x00},
	{TASDEV_REG_SDW(0, 0, 0x07), 0x20},
	{TASDEV_REG_SDW(0, 0, 0x08), 0x09},
	{TASDEV_REG_SDW(0, 0, 0x09), 0x02},
	{TASDEV_REG_SDW(0, 0, 0x0a), 0x0a},
	{TASDEV_REG_SDW(0, 0, 0x0c), 0x10},
	{TASDEV_REG_SDW(0, 0, 0x0d), 0x13},
	{TASDEV_REG_SDW(0, 0, 0x0e), 0xc2},
	{TASDEV_REG_SDW(0, 0, 0x0f), 0x40},
	{TASDEV_REG_SDW(0, 0, 0x10), 0x04},
	{TASDEV_REG_SDW(0, 0, 0x13), 0x13},
	{TASDEV_REG_SDW(0, 0, 0x14), 0x12},
	{TASDEV_REG_SDW(0, 0, 0x15), 0x00},
	{TASDEV_REG_SDW(0, 0, 0x16), 0x12},
	{TASDEV_REG_SDW(0, 0, 0x17), 0x80},
	{TAS2783_DVC_LVL, 0x00},
	{TASDEV_REG_SDW(0, 0, 0x1b), 0x61},
	{TASDEV_REG_SDW(0, 0, 0x1c), 0x36},
	{TASDEV_REG_SDW(0, 0, 0x1d), 0x00},
	{TASDEV_REG_SDW(0, 0, 0x1f), 0x01},
	{TASDEV_REG_SDW(0, 0, 0x20), 0x2e},
	{TASDEV_REG_SDW(0, 0, 0x21), 0x00},
	{TASDEV_REG_SDW(0, 0, 0x34), 0x06},
	{TASDEV_REG_SDW(0, 0, 0x35), 0xbd},
	{TASDEV_REG_SDW(0, 0, 0x36), 0xad},
	{TASDEV_REG_SDW(0, 0, 0x37), 0xa8},
	{TASDEV_REG_SDW(0, 0, 0x38), 0x00},
	{TASDEV_REG_SDW(0, 0, 0x3b), 0xfc},
	{TASDEV_REG_SDW(0, 0, 0x3d), 0xdd},
	{TASDEV_REG_SDW(0, 0, 0x40), 0xf6},
	{TASDEV_REG_SDW(0, 0, 0x41), 0x14},
	{TASDEV_REG_SDW(0, 0, 0x5c), 0x19},
	{TASDEV_REG_SDW(0, 0, 0x5d), 0x80},
	{TASDEV_REG_SDW(0, 0, 0x63), 0x48},
	{TASDEV_REG_SDW(0, 0, 0x65), 0x08},
	{TASDEV_REG_SDW(0, 0, 0x66), 0xb2},
	{TASDEV_REG_SDW(0, 0, 0x67), 0x00},

Annotation

Implementation Notes