Commit a8939f2e authored by James Schulman's avatar James Schulman Committed by Mark Brown

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: default avatarJames Schulman <james.schulman@cirrus.com>
Acked-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210115201105.14075-1-james.schulman@cirrus.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 7505c06d
...@@ -2031,11 +2031,14 @@ static struct wm_coeff_ctl *wm_adsp_get_ctl(struct wm_adsp *dsp, ...@@ -2031,11 +2031,14 @@ static struct wm_coeff_ctl *wm_adsp_get_ctl(struct wm_adsp *dsp,
unsigned int alg) unsigned int alg)
{ {
struct wm_coeff_ctl *pos, *rslt = NULL; struct wm_coeff_ctl *pos, *rslt = NULL;
const char *fw_txt = wm_adsp_fw_text[dsp->fw];
list_for_each_entry(pos, &dsp->ctl_list, list) { list_for_each_entry(pos, &dsp->ctl_list, list) {
if (!pos->subname) if (!pos->subname)
continue; continue;
if (strncmp(pos->subname, name, pos->subname_len) == 0 && if (strncmp(pos->subname, name, pos->subname_len) == 0 &&
strncmp(pos->fw_name, fw_txt,
SNDRV_CTL_ELEM_ID_NAME_MAXLEN) == 0 &&
pos->alg_region.alg == alg && pos->alg_region.alg == alg &&
pos->alg_region.type == type) { pos->alg_region.type == type) {
rslt = pos; rslt = pos;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment