drivers/firmware/cirrus/test/cs_dsp_test_control_cache.c
Source file repositories/reference/linux-study-clean/drivers/firmware/cirrus/test/cs_dsp_test_control_cache.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/firmware/cirrus/test/cs_dsp_test_control_cache.c- Extension
.c- Size
- 127964 bytes
- Lines
- 3287
- Domain
- Driver Families
- Bucket
- drivers/firmware
- 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.
- 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.
- 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
kunit/device.hkunit/resource.hkunit/test.hlinux/build_bug.hlinux/firmware/cirrus/cs_dsp.hlinux/firmware/cirrus/cs_dsp_test_utils.hlinux/firmware/cirrus/wmfw.hlinux/list.hlinux/random.hlinux/regmap.h
Detected Declarations
struct cs_dsp_test_localstruct cs_dsp_ctl_cache_test_paramfunction _find_alg_entryfunction _get_alg_mem_base_wordsfunction cs_dsp_ctl_v2_cache_allocfunction cs_dsp_ctl_cache_initfunction cs_dsp_ctl_cache_init_write_onlyfunction cs_dsp_ctl_cache_init_multiple_fw_same_controlsfunction list_for_each_entryfunction cs_dsp_ctl_cache_init_multiple_fwalgid_same_controlsfunction list_for_each_entryfunction cs_dsp_ctl_cache_init_multiple_memsfunction list_for_each_entryfunction cs_dsp_ctl_cache_init_multiple_algsfunction list_for_each_entryfunction cs_dsp_ctl_cache_init_multiple_offsetsfunction list_for_each_entryfunction cs_dsp_ctl_cache_read_not_startedfunction cs_dsp_ctl_cache_read_stoppedfunction cs_dsp_ctl_cache_read_powered_downfunction cs_dsp_ctl_cache_read_stopped_powered_downfunction cs_dsp_ctl_cache_read_not_current_loaded_fwfunction cs_dsp_ctl_cache_read_not_current_running_fwfunction cs_dsp_ctl_cache_read_runningfunction cs_dsp_ctl_cache_read_running_zero_flagsfunction cs_dsp_ctl_cache_writethroughfunction cs_dsp_ctl_cache_writethrough_unchangedfunction cs_dsp_ctl_cache_write_unchanged_not_startedfunction cs_dsp_ctl_cache_write_not_startedfunction cs_dsp_ctl_cache_write_stoppedfunction cs_dsp_ctl_cache_write_powered_downfunction cs_dsp_ctl_cache_write_stopped_powered_downfunction cs_dsp_ctl_cache_write_not_current_loaded_fwfunction cs_dsp_ctl_cache_write_not_current_running_fwfunction cs_dsp_ctl_cache_sync_write_before_runfunction cs_dsp_ctl_cache_sync_write_while_runningfunction cs_dsp_ctl_cache_sync_write_after_stopfunction cs_dsp_ctl_cache_sync_write_not_current_fwfunction cs_dsp_ctl_cache_sync_reapply_every_runfunction cs_dsp_ctl_cache_sync_reapply_after_fw_reloadfunction cs_dsp_ctl_cache_sync_reapply_after_fw_swapfunction cs_dsp_ctl_cache_test_common_initfunction cs_dsp_ctl_cache_test_halo_initfunction cs_dsp_ctl_cache_test_adsp2_32bit_initfunction cs_dsp_ctl_cache_test_adsp2_32bit_wmfw1_initfunction cs_dsp_ctl_cache_test_adsp2_32bit_wmfw2_initfunction cs_dsp_ctl_cache_test_adsp2_16bit_initfunction cs_dsp_ctl_cache_test_adsp2_16bit_wmfw1_init
Annotated Snippet
struct cs_dsp_test_local {
struct cs_dsp_mock_xm_header *xm_header;
struct cs_dsp_mock_wmfw_builder *wmfw_builder;
int wmfw_version;
};
struct cs_dsp_ctl_cache_test_param {
int mem_type;
int alg_id;
unsigned int offs_words;
unsigned int len_bytes;
u16 ctl_type;
u16 flags;
};
static const struct cs_dsp_mock_alg_def cs_dsp_ctl_cache_test_algs[] = {
{
.id = 0xfafa,
.ver = 0x100000,
.xm_base_words = 60,
.xm_size_words = 1000,
.ym_base_words = 0,
.ym_size_words = 1000,
.zm_base_words = 0,
.zm_size_words = 1000,
},
{
.id = 0xb,
.ver = 0x100001,
.xm_base_words = 1060,
.xm_size_words = 1000,
.ym_base_words = 1000,
.ym_size_words = 1000,
.zm_base_words = 1000,
.zm_size_words = 1000,
},
{
.id = 0x9f1234,
.ver = 0x100500,
.xm_base_words = 2060,
.xm_size_words = 32,
.ym_base_words = 2000,
.ym_size_words = 32,
.zm_base_words = 2000,
.zm_size_words = 32,
},
{
.id = 0xff00ff,
.ver = 0x300113,
.xm_base_words = 2100,
.xm_size_words = 32,
.ym_base_words = 2032,
.ym_size_words = 32,
.zm_base_words = 2032,
.zm_size_words = 32,
},
};
static const struct cs_dsp_mock_coeff_def mock_coeff_template = {
.shortname = "Dummy Coeff",
.type = WMFW_CTL_TYPE_BYTES,
.mem_type = WMFW_ADSP2_YM,
.flags = WMFW_CTL_FLAG_READABLE | WMFW_CTL_FLAG_WRITEABLE,
.length_bytes = 4,
};
static const char * const cs_dsp_ctl_cache_test_fw_names[] = {
"misc", "mbc/vss", "haps",
};
static int _find_alg_entry(struct kunit *test, unsigned int alg_id)
{
int i;
for (i = 0; i < ARRAY_SIZE(cs_dsp_ctl_cache_test_algs); ++i) {
if (cs_dsp_ctl_cache_test_algs[i].id == alg_id)
break;
}
KUNIT_ASSERT_LT(test, i, ARRAY_SIZE(cs_dsp_ctl_cache_test_algs));
return i;
}
static int _get_alg_mem_base_words(struct kunit *test, int alg_index, int mem_type)
{
switch (mem_type) {
case WMFW_ADSP2_XM:
return cs_dsp_ctl_cache_test_algs[alg_index].xm_base_words;
case WMFW_ADSP2_YM:
Annotation
- Immediate include surface: `kunit/device.h`, `kunit/resource.h`, `kunit/test.h`, `linux/build_bug.h`, `linux/firmware/cirrus/cs_dsp.h`, `linux/firmware/cirrus/cs_dsp_test_utils.h`, `linux/firmware/cirrus/wmfw.h`, `linux/list.h`.
- Detected declarations: `struct cs_dsp_test_local`, `struct cs_dsp_ctl_cache_test_param`, `function _find_alg_entry`, `function _get_alg_mem_base_words`, `function cs_dsp_ctl_v2_cache_alloc`, `function cs_dsp_ctl_cache_init`, `function cs_dsp_ctl_cache_init_write_only`, `function cs_dsp_ctl_cache_init_multiple_fw_same_controls`, `function list_for_each_entry`, `function cs_dsp_ctl_cache_init_multiple_fwalgid_same_controls`.
- Atlas domain: Driver Families / drivers/firmware.
- Implementation status: source 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.