sound/soc/codecs/tas2781-fmwlib.c

Source file repositories/reference/linux-study-clean/sound/soc/codecs/tas2781-fmwlib.c

File Facts

System
Linux kernel
Corpus path
sound/soc/codecs/tas2781-fmwlib.c
Extension
.c
Size
71663 bytes
Lines
2788
Domain
Driver Families
Bucket
sound/soc
Inferred role
Driver Families: exported/initcall integration point
Status
integration 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_crc {
	unsigned char offset;
	unsigned char len;
};

struct blktyp_devidx_map {
	unsigned char blktyp;
	unsigned char dev_idx;
};

struct tas2781_cali_specific {
	unsigned char sin_gni[4];
	int sin_gni_reg;
	bool is_sin_gn_flush;
};

static const char deviceNumber[TASDEVICE_DSP_TAS_MAX_DEVICE] = {
	1, 2, 1, 2, 1, 1, 0, 2, 4, 3, 1, 2, 3, 4, 1, 2
};

/* fixed m68k compiling issue: mapping table can save code field */
static const struct blktyp_devidx_map ppc3_tas2781_mapping_table[] = {
	{ MAIN_ALL_DEVICES_1X, 0x80 },
	{ MAIN_DEVICE_A_1X, 0x81 },
	{ COEFF_DEVICE_A_1X, 0xC1 },
	{ PRE_DEVICE_A_1X, 0xC1 },
	{ PRE_SOFTWARE_RESET_DEVICE_A, 0xC1 },
	{ POST_SOFTWARE_RESET_DEVICE_A, 0xC1 },
	{ MAIN_DEVICE_B_1X, 0x82 },
	{ COEFF_DEVICE_B_1X, 0xC2 },
	{ PRE_DEVICE_B_1X, 0xC2 },
	{ PRE_SOFTWARE_RESET_DEVICE_B, 0xC2 },
	{ POST_SOFTWARE_RESET_DEVICE_B, 0xC2 },
	{ MAIN_DEVICE_C_1X, 0x83 },
	{ COEFF_DEVICE_C_1X, 0xC3 },
	{ PRE_DEVICE_C_1X, 0xC3 },
	{ PRE_SOFTWARE_RESET_DEVICE_C, 0xC3 },
	{ POST_SOFTWARE_RESET_DEVICE_C, 0xC3 },
	{ MAIN_DEVICE_D_1X, 0x84 },
	{ COEFF_DEVICE_D_1X, 0xC4 },
	{ PRE_DEVICE_D_1X, 0xC4 },
	{ PRE_SOFTWARE_RESET_DEVICE_D, 0xC4 },
	{ POST_SOFTWARE_RESET_DEVICE_D, 0xC4 },
};

static const struct blktyp_devidx_map ppc3_mapping_table[] = {
	{ MAIN_ALL_DEVICES_1X, 0x80 },
	{ MAIN_DEVICE_A_1X, 0x81 },
	{ COEFF_DEVICE_A_1X, 0xC1 },
	{ PRE_DEVICE_A_1X, 0xC1 },
	{ MAIN_DEVICE_B_1X, 0x82 },
	{ COEFF_DEVICE_B_1X, 0xC2 },
	{ PRE_DEVICE_B_1X, 0xC2 },
	{ MAIN_DEVICE_C_1X, 0x83 },
	{ COEFF_DEVICE_C_1X, 0xC3 },
	{ PRE_DEVICE_C_1X, 0xC3 },
	{ MAIN_DEVICE_D_1X, 0x84 },
	{ COEFF_DEVICE_D_1X, 0xC4 },
	{ PRE_DEVICE_D_1X, 0xC4 },
};

static const struct blktyp_devidx_map non_ppc3_mapping_table[] = {
	{ MAIN_ALL_DEVICES, 0x80 },
	{ MAIN_DEVICE_A, 0x81 },
	{ COEFF_DEVICE_A, 0xC1 },
	{ PRE_DEVICE_A, 0xC1 },
	{ MAIN_DEVICE_B, 0x82 },
	{ COEFF_DEVICE_B, 0xC2 },
	{ PRE_DEVICE_B, 0xC2 },
	{ MAIN_DEVICE_C, 0x83 },
	{ COEFF_DEVICE_C, 0xC3 },
	{ PRE_DEVICE_C, 0xC3 },
	{ MAIN_DEVICE_D, 0x84 },
	{ COEFF_DEVICE_D, 0xC4 },
	{ PRE_DEVICE_D, 0xC4 },
};

static struct tasdevice_config_info *tasdevice_add_config(
	struct tasdevice_priv *tas_priv, unsigned char *config_data,
	unsigned int config_size, int *status)
{
	struct tasdevice_config_info *cfg_info;
	struct tasdev_blk_data **bk_da;
	unsigned int config_offset = 0;
	unsigned int i;

	/* In most projects are many audio cases, such as music, handfree,
	 * receiver, games, audio-to-haptics, PMIC record, bypass mode,
	 * portrait, landscape, etc. Even in multiple audios, one or
	 * two of the chips will work for the special case, such as

Annotation

Implementation Notes