]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ASoC: wm_adsp: Export function for KUnit test to get firmware filenames
authorRichard Fitzgerald <rf@opensource.cirrus.com>
Tue, 10 Mar 2026 14:18:10 +0000 (14:18 +0000)
committerMark Brown <broonie@kernel.org>
Tue, 10 Mar 2026 14:52:50 +0000 (14:52 +0000)
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>
sound/soc/codecs/wm_adsp.c
sound/soc/codecs/wm_adsp.h

index e32da6949d1f68156e647047da3a24ed13c0e6f3..346ede149a9ee9e13a62bb28a43ea1620ab7e417 100644 (file)
@@ -318,6 +318,17 @@ struct wm_coeff_ctl {
        struct work_struct work;
 };
 
+#if IS_ENABLED(CONFIG_KUNIT)
+const char *wm_adsp_get_fwf_name_by_index(int index)
+{
+       if (index < ARRAY_SIZE(wm_adsp_fw))
+               return wm_adsp_fw[index].file;
+
+       return NULL;
+}
+EXPORT_SYMBOL_IF_KUNIT(wm_adsp_get_fwf_name_by_index);
+#endif
+
 int wm_adsp_fw_get(struct snd_kcontrol *kcontrol,
                   struct snd_ctl_elem_value *ucontrol)
 {
index 7c667123758b51a728b1fa6f5b882a40a32fd8c3..6560dfc8c08d29c2306d2eaf792d3b458dd77ce0 100644 (file)
@@ -143,6 +143,7 @@ int wm_adsp_read_ctl(struct wm_adsp *dsp, const char *name,  int type,
                      unsigned int alg, void *buf, size_t len);
 
 #if IS_ENABLED(CONFIG_KUNIT)
+const char *wm_adsp_get_fwf_name_by_index(int index);
 void wm_adsp_release_firmware_files(const struct firmware *wmfw_firmware,
                                    char *wmfw_filename,
                                    const struct firmware *coeff_firmware,