Commit dc0e5ca8 authored by Richard Fitzgerald's avatar Richard Fitzgerald Committed by Mark Brown

firmware: cs_dsp: Rename fw_ver to wmfw_ver

Rename the confusingly named struct member fw_ver to wmfw_ver. It
contains the wmfw format version of the loaded wmfw file.

This commit also contains an update to wm_adsp for the new name.
Signed-off-by: default avatarRichard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20240710103640.78197-5-rf@opensource.cirrus.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent a4939119
...@@ -1048,7 +1048,7 @@ static int cs_dsp_create_control(struct cs_dsp *dsp, ...@@ -1048,7 +1048,7 @@ static int cs_dsp_create_control(struct cs_dsp *dsp,
ctl->fw_name = dsp->fw_name; ctl->fw_name = dsp->fw_name;
ctl->alg_region = *alg_region; ctl->alg_region = *alg_region;
if (subname && dsp->fw_ver >= 2) { if (subname && dsp->wmfw_ver >= 2) {
ctl->subname_len = subname_len; ctl->subname_len = subname_len;
ctl->subname = kasprintf(GFP_KERNEL, "%.*s", subname_len, subname); ctl->subname = kasprintf(GFP_KERNEL, "%.*s", subname_len, subname);
if (!ctl->subname) { if (!ctl->subname) {
...@@ -1175,7 +1175,7 @@ static int cs_dsp_coeff_parse_alg(struct cs_dsp *dsp, ...@@ -1175,7 +1175,7 @@ static int cs_dsp_coeff_parse_alg(struct cs_dsp *dsp,
raw = (const struct wmfw_adsp_alg_data *)region->data; raw = (const struct wmfw_adsp_alg_data *)region->data;
switch (dsp->fw_ver) { switch (dsp->wmfw_ver) {
case 0: case 0:
case 1: case 1:
if (sizeof(*raw) > data_len) if (sizeof(*raw) > data_len)
...@@ -1252,7 +1252,7 @@ static int cs_dsp_coeff_parse_coeff(struct cs_dsp *dsp, ...@@ -1252,7 +1252,7 @@ static int cs_dsp_coeff_parse_coeff(struct cs_dsp *dsp,
blk->offset = le16_to_cpu(raw->hdr.offset); blk->offset = le16_to_cpu(raw->hdr.offset);
blk->mem_type = le16_to_cpu(raw->hdr.type); blk->mem_type = le16_to_cpu(raw->hdr.type);
switch (dsp->fw_ver) { switch (dsp->wmfw_ver) {
case 0: case 0:
case 1: case 1:
if (sizeof(*raw) > (data_len - pos)) if (sizeof(*raw) > (data_len - pos))
...@@ -1499,7 +1499,7 @@ static int cs_dsp_load(struct cs_dsp *dsp, const struct firmware *firmware, ...@@ -1499,7 +1499,7 @@ static int cs_dsp_load(struct cs_dsp *dsp, const struct firmware *firmware,
goto out_fw; goto out_fw;
} }
dsp->fw_ver = header->ver; dsp->wmfw_ver = header->ver;
if (header->core != dsp->type) { if (header->core != dsp->type) {
cs_dsp_err(dsp, "%s: invalid core %d != %d\n", cs_dsp_err(dsp, "%s: invalid core %d != %d\n",
...@@ -1779,7 +1779,7 @@ static struct cs_dsp_alg_region *cs_dsp_create_region(struct cs_dsp *dsp, ...@@ -1779,7 +1779,7 @@ static struct cs_dsp_alg_region *cs_dsp_create_region(struct cs_dsp *dsp,
list_add_tail(&alg_region->list, &dsp->alg_regions); list_add_tail(&alg_region->list, &dsp->alg_regions);
if (dsp->fw_ver > 0) if (dsp->wmfw_ver > 0)
cs_dsp_ctl_fixup_base(dsp, alg_region); cs_dsp_ctl_fixup_base(dsp, alg_region);
return alg_region; return alg_region;
...@@ -1902,7 +1902,7 @@ static int cs_dsp_adsp1_setup_algs(struct cs_dsp *dsp) ...@@ -1902,7 +1902,7 @@ static int cs_dsp_adsp1_setup_algs(struct cs_dsp *dsp)
ret = PTR_ERR(alg_region); ret = PTR_ERR(alg_region);
goto out; goto out;
} }
if (dsp->fw_ver == 0) { if (dsp->wmfw_ver == 0) {
if (i + 1 < n_algs) { if (i + 1 < n_algs) {
len = be32_to_cpu(adsp1_alg[i + 1].dm); len = be32_to_cpu(adsp1_alg[i + 1].dm);
len -= be32_to_cpu(adsp1_alg[i].dm); len -= be32_to_cpu(adsp1_alg[i].dm);
...@@ -1924,7 +1924,7 @@ static int cs_dsp_adsp1_setup_algs(struct cs_dsp *dsp) ...@@ -1924,7 +1924,7 @@ static int cs_dsp_adsp1_setup_algs(struct cs_dsp *dsp)
ret = PTR_ERR(alg_region); ret = PTR_ERR(alg_region);
goto out; goto out;
} }
if (dsp->fw_ver == 0) { if (dsp->wmfw_ver == 0) {
if (i + 1 < n_algs) { if (i + 1 < n_algs) {
len = be32_to_cpu(adsp1_alg[i + 1].zm); len = be32_to_cpu(adsp1_alg[i + 1].zm);
len -= be32_to_cpu(adsp1_alg[i].zm); len -= be32_to_cpu(adsp1_alg[i].zm);
...@@ -2015,7 +2015,7 @@ static int cs_dsp_adsp2_setup_algs(struct cs_dsp *dsp) ...@@ -2015,7 +2015,7 @@ static int cs_dsp_adsp2_setup_algs(struct cs_dsp *dsp)
ret = PTR_ERR(alg_region); ret = PTR_ERR(alg_region);
goto out; goto out;
} }
if (dsp->fw_ver == 0) { if (dsp->wmfw_ver == 0) {
if (i + 1 < n_algs) { if (i + 1 < n_algs) {
len = be32_to_cpu(adsp2_alg[i + 1].xm); len = be32_to_cpu(adsp2_alg[i + 1].xm);
len -= be32_to_cpu(adsp2_alg[i].xm); len -= be32_to_cpu(adsp2_alg[i].xm);
...@@ -2037,7 +2037,7 @@ static int cs_dsp_adsp2_setup_algs(struct cs_dsp *dsp) ...@@ -2037,7 +2037,7 @@ static int cs_dsp_adsp2_setup_algs(struct cs_dsp *dsp)
ret = PTR_ERR(alg_region); ret = PTR_ERR(alg_region);
goto out; goto out;
} }
if (dsp->fw_ver == 0) { if (dsp->wmfw_ver == 0) {
if (i + 1 < n_algs) { if (i + 1 < n_algs) {
len = be32_to_cpu(adsp2_alg[i + 1].ym); len = be32_to_cpu(adsp2_alg[i + 1].ym);
len -= be32_to_cpu(adsp2_alg[i].ym); len -= be32_to_cpu(adsp2_alg[i].ym);
...@@ -2059,7 +2059,7 @@ static int cs_dsp_adsp2_setup_algs(struct cs_dsp *dsp) ...@@ -2059,7 +2059,7 @@ static int cs_dsp_adsp2_setup_algs(struct cs_dsp *dsp)
ret = PTR_ERR(alg_region); ret = PTR_ERR(alg_region);
goto out; goto out;
} }
if (dsp->fw_ver == 0) { if (dsp->wmfw_ver == 0) {
if (i + 1 < n_algs) { if (i + 1 < n_algs) {
len = be32_to_cpu(adsp2_alg[i + 1].zm); len = be32_to_cpu(adsp2_alg[i + 1].zm);
len -= be32_to_cpu(adsp2_alg[i].zm); len -= be32_to_cpu(adsp2_alg[i].zm);
......
...@@ -167,7 +167,7 @@ struct cs_dsp { ...@@ -167,7 +167,7 @@ struct cs_dsp {
const struct cs_dsp_region *mem; const struct cs_dsp_region *mem;
int num_mems; int num_mems;
int fw_ver; int wmfw_ver;
bool booted; bool booted;
bool running; bool running;
......
...@@ -601,7 +601,7 @@ static int wm_adsp_control_add(struct cs_dsp_coeff_ctl *cs_ctl) ...@@ -601,7 +601,7 @@ static int wm_adsp_control_add(struct cs_dsp_coeff_ctl *cs_ctl)
return -EINVAL; return -EINVAL;
} }
switch (cs_dsp->fw_ver) { switch (cs_dsp->wmfw_ver) {
case 0: case 0:
case 1: case 1:
ret = scnprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN, ret = scnprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN,
......
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