sound/soc/codecs/aw88395/aw88395_lib.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/aw88395/aw88395_lib.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/aw88395/aw88395_lib.c- Extension
.c- Size
- 34452 bytes
- Lines
- 1174
- 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/cleanup.hlinux/crc8.hlinux/i2c.haw88395_lib.haw88395_device.h
Detected Declarations
function aw_check_sumfunction aw_check_data_versionfunction aw_check_register_numfunction aw_check_dsp_reg_numfunction aw_check_soc_app_numfunction aw_get_single_bin_headerfunction aw_parse_one_of_multi_binsfunction aw_get_multi_bin_headerfunction aw_parse_bin_headerfunction aw_check_bin_header_versionfunction aw_parsing_bin_filefunction aw_dev_parse_raw_regfunction aw_dev_parse_raw_dsp_cfgfunction aw_dev_parse_raw_dsp_fwfunction aw_dev_prof_parse_multi_binfunction aw_dev_parse_reg_bin_with_hdrfunction aw_dev_parse_data_by_sec_typefunction aw_dev_parse_dev_typefunction aw_dev_parse_dev_default_typefunction aw_dev_cfg_get_reg_valid_proffunction aw_dev_cfg_get_multiple_valid_proffunction aw_dev_load_cfg_by_hdrfunction aw_dev_create_prof_name_list_v1function aw_get_dde_type_infofunction aw_get_dev_scene_count_v1function aw_get_default_scene_count_v1function aw_dev_parse_scene_count_v1function aw_dev_parse_data_by_sec_type_v1function aw_dev_parse_dev_type_v1function aw_dev_parse_default_type_v1function aw_dev_parse_by_hdr_v1function aw_dev_load_cfg_by_hdr_v1function aw88395_dev_cfg_loadfunction aw_dev_check_cfg_by_hdrfunction aw_dev_check_acf_by_hdr_v1function aw88395_dev_load_acf_checkexport aw88395_dev_cfg_loadexport aw88395_dev_load_acf_check
Annotated Snippet
if (ret < 0) {
dev_err(aw_dev->dev, "aw_bin_parse check sum data error\n");
return ret;
}
ret = aw_check_data_version(aw_dev, bin, i);
if (ret < 0) {
dev_err(aw_dev->dev, "aw_bin_parse check data version error\n");
return ret;
}
if (bin->header_info[i].bin_data_ver == DATA_VERSION_V1) {
switch (bin->header_info[i].bin_data_type) {
case DATA_TYPE_REGISTER:
ret = aw_check_register_num(aw_dev, bin, i);
break;
case DATA_TYPE_DSP_REG:
ret = aw_check_dsp_reg_num(aw_dev, bin, i);
break;
case DATA_TYPE_SOC_APP:
ret = aw_check_soc_app_num(aw_dev, bin, i);
break;
default:
bin->header_info[i].valid_data_len =
bin->header_info[i].bin_data_len;
ret = 0;
break;
}
if (ret < 0)
return ret;
}
}
return 0;
}
static int aw_dev_parse_raw_reg(unsigned char *data, unsigned int data_len,
struct aw_prof_desc *prof_desc)
{
prof_desc->sec_desc[AW88395_DATA_TYPE_REG].data = data;
prof_desc->sec_desc[AW88395_DATA_TYPE_REG].len = data_len;
prof_desc->prof_st = AW88395_PROFILE_OK;
return 0;
}
static int aw_dev_parse_raw_dsp_cfg(unsigned char *data, unsigned int data_len,
struct aw_prof_desc *prof_desc)
{
if (data_len & 0x01)
return -EINVAL;
swab16_array((u16 *)data, data_len >> 1);
prof_desc->sec_desc[AW88395_DATA_TYPE_DSP_CFG].data = data;
prof_desc->sec_desc[AW88395_DATA_TYPE_DSP_CFG].len = data_len;
prof_desc->prof_st = AW88395_PROFILE_OK;
return 0;
}
static int aw_dev_parse_raw_dsp_fw(unsigned char *data, unsigned int data_len,
struct aw_prof_desc *prof_desc)
{
if (data_len & 0x01)
return -EINVAL;
swab16_array((u16 *)data, data_len >> 1);
prof_desc->sec_desc[AW88395_DATA_TYPE_DSP_FW].data = data;
prof_desc->sec_desc[AW88395_DATA_TYPE_DSP_FW].len = data_len;
prof_desc->prof_st = AW88395_PROFILE_OK;
return 0;
}
static int aw_dev_prof_parse_multi_bin(struct aw_device *aw_dev, unsigned char *data,
unsigned int data_len, struct aw_prof_desc *prof_desc)
{
int ret;
int i;
struct aw_bin *aw_bin __free(kfree) = kzalloc(data_len + sizeof(struct aw_bin),
GFP_KERNEL);
if (!aw_bin)
return -ENOMEM;
aw_bin->info.len = data_len;
memcpy(aw_bin->info.data, data, data_len);
Annotation
- Immediate include surface: `linux/cleanup.h`, `linux/crc8.h`, `linux/i2c.h`, `aw88395_lib.h`, `aw88395_device.h`.
- Detected declarations: `function aw_check_sum`, `function aw_check_data_version`, `function aw_check_register_num`, `function aw_check_dsp_reg_num`, `function aw_check_soc_app_num`, `function aw_get_single_bin_header`, `function aw_parse_one_of_multi_bins`, `function aw_get_multi_bin_header`, `function aw_parse_bin_header`, `function aw_check_bin_header_version`.
- 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.