1
0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2026-01-11 17:10:13 +00:00

ASoC: cs-amp-lib-test: Add test cases for cs_amp_set_efi_calibration_data()

Add a set of test cases for cs_amp_set_efi_calibration_data().

Broadly there are two type of behavior being tested:

How the EFI is updated:
- Create a new EFI
- Overwrite part of existing content
- Overwrite part of zero-filled preallocated content
- Grow the file to append new content

And how the location within the content is chosen:
- Overwrite a specific array entry
- Overwrite an entry with the same calTarget (silicon ID)
- Overwrite a free entry
- Append after existing data

Plus some cases for error conditions.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20251021105022.1013685-12-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Richard Fitzgerald 2025-10-21 11:50:22 +01:00 committed by Mark Brown
parent 64670a6c06
commit 4795375d8a
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
3 changed files with 1397 additions and 8 deletions

View File

@ -71,6 +71,11 @@ struct cs_amp_test_hooks {
u32 *returned_attr,
unsigned long *size,
void *buf);
efi_status_t (*set_efi_variable)(efi_char16_t *name,
efi_guid_t *guid,
u32 attr,
unsigned long size,
void *buf);
int (*write_cal_coeff)(struct cs_dsp *dsp,
const struct cirrus_amp_cal_controls *controls,

File diff suppressed because it is too large Load Diff

View File

@ -727,6 +727,7 @@ EXPORT_SYMBOL_NS_GPL(cs_amp_create_debugfs, "SND_SOC_CS_AMP_LIB");
static const struct cs_amp_test_hooks cs_amp_test_hook_ptrs = {
.get_efi_variable = cs_amp_get_efi_variable,
.set_efi_variable = cs_amp_set_efi_variable,
.write_cal_coeff = cs_amp_write_cal_coeff,
.read_cal_coeff = cs_amp_read_cal_coeff,
};