Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: wm_adsp: Fix control name parsing for multi-fw

When switching between firmware types, the wrong control
can be selected when requesting control in kernel API.
Use the currently selected DSP firwmare type to select
the proper mixer control.

Signed-off-by: James Schulman <james.schulman@cirrus.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210115201105.14075-1-james.schulman@cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

James Schulman and committed by
Mark Brown
a8939f2e 7505c06d

+3
+3
sound/soc/codecs/wm_adsp.c
··· 2031 2031 unsigned int alg) 2032 2032 { 2033 2033 struct wm_coeff_ctl *pos, *rslt = NULL; 2034 + const char *fw_txt = wm_adsp_fw_text[dsp->fw]; 2034 2035 2035 2036 list_for_each_entry(pos, &dsp->ctl_list, list) { 2036 2037 if (!pos->subname) 2037 2038 continue; 2038 2039 if (strncmp(pos->subname, name, pos->subname_len) == 0 && 2040 + strncmp(pos->fw_name, fw_txt, 2041 + SNDRV_CTL_ELEM_ID_NAME_MAXLEN) == 0 && 2039 2042 pos->alg_region.alg == alg && 2040 2043 pos->alg_region.type == type) { 2041 2044 rslt = pos;