Skip to content

Commit b4e6b01

Browse files
rfvirgilbroonie
authored andcommitted
ASoC: wm_adsp: Export function for KUnit test to get firmware filenames
Export a function that KUnit tests can use to get the firmware filenames from the wm_adsp_fw[] array. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20260310141817.1871794-4-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 70057cf commit b4e6b01

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

sound/soc/codecs/wm_adsp.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,17 @@ struct wm_coeff_ctl {
318318
struct work_struct work;
319319
};
320320

321+
#if IS_ENABLED(CONFIG_KUNIT)
322+
const char *wm_adsp_get_fwf_name_by_index(int index)
323+
{
324+
if (index < ARRAY_SIZE(wm_adsp_fw))
325+
return wm_adsp_fw[index].file;
326+
327+
return NULL;
328+
}
329+
EXPORT_SYMBOL_IF_KUNIT(wm_adsp_get_fwf_name_by_index);
330+
#endif
331+
321332
int wm_adsp_fw_get(struct snd_kcontrol *kcontrol,
322333
struct snd_ctl_elem_value *ucontrol)
323334
{

sound/soc/codecs/wm_adsp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ int wm_adsp_read_ctl(struct wm_adsp *dsp, const char *name, int type,
143143
unsigned int alg, void *buf, size_t len);
144144

145145
#if IS_ENABLED(CONFIG_KUNIT)
146+
const char *wm_adsp_get_fwf_name_by_index(int index);
146147
void wm_adsp_release_firmware_files(const struct firmware *wmfw_firmware,
147148
char *wmfw_filename,
148149
const struct firmware *coeff_firmware,

0 commit comments

Comments
 (0)