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.
- 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/crc8.hlinux/firmware.hlinux/i2c.hlinux/init.hlinux/interrupt.hlinux/module.hlinux/of.hlinux/of_irq.hlinux/regmap.hlinux/slab.hsound/pcm_params.hsound/soc.hsound/tlv.hsound/tas2781.hlinux/unaligned.h
Detected Declarations
struct tas_crcstruct blktyp_devidx_mapstruct tas2781_cali_specificfunction tasdevice_rca_parserfunction map_dev_idxfunction fw_parse_block_data_kernelfunction fw_parse_data_kernelfunction fw_parse_tas5825_program_data_kernelfunction fw_parse_tas5825_configuration_data_kernelfunction fw_parse_program_data_kernelfunction fw_parse_configuration_data_kernelfunction fct_param_address_parserfunction fw_parse_fct_param_addressfunction fw_parse_variable_header_kernelfunction tasdevice_process_blockfunction tasdevice_select_cfg_blkfunction tasdevice_load_block_kernelfunction fw_parse_variable_hdrfunction fw_parse_variable_header_gitfunction fw_parse_block_datafunction fw_parse_datafunction fw_parse_program_datafunction fw_parse_configuration_datafunction check_inpage_yram_rgfunction check_inpage_yram_bk1function check_inpage_yramfunction check_inblock_yram_bkfunction check_inblock_yramfunction check_yramfunction tasdev_multibytes_chksumfunction do_singlereg_checksumfunction set_err_prg_cfgfunction tasdev_bytes_chksumfunction tasdev_multibytes_wrfunction tasdev_block_chksumfunction tasdev_load_blkfunction tasdevice_load_blockfunction dspbin_type_checkfunction dspfw_default_callbackfunction fw_parse_headerfunction fw_parse_variable_hdr_calfunction check_cal_bin_datafunction calbin_conversionfunction fw_parse_calibration_datafunction tas2781_load_calibrationfunction tasdevice_dspfw_readyfunction tasdevice_dsp_parserfunction tas2781_clear_calfirmware
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
- Immediate include surface: `linux/crc8.h`, `linux/firmware.h`, `linux/i2c.h`, `linux/init.h`, `linux/interrupt.h`, `linux/module.h`, `linux/of.h`, `linux/of_irq.h`.
- Detected declarations: `struct tas_crc`, `struct blktyp_devidx_map`, `struct tas2781_cali_specific`, `function tasdevice_rca_parser`, `function map_dev_idx`, `function fw_parse_block_data_kernel`, `function fw_parse_data_kernel`, `function fw_parse_tas5825_program_data_kernel`, `function fw_parse_tas5825_configuration_data_kernel`, `function fw_parse_program_data_kernel`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: integration implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.