Skip to content

Commit f6c9679

Browse files
rfvirgilbroonie
authored andcommitted
ASoC: cs35l56: Fix misuse of wm_adsp 'part' string for silicon revision
Put the silicon revision and secured flag in the wm_adsp fwf_name string instead of including them in the part string. This changes the format of the firmware name string from cs35l56[s]-rev-misc[-system_name] to cs35l56-rev[-s]-misc[-system_name] No firmware files have been published, so this doesn't cause a compatibility break. Silicon revision and secured flag are included in the firmware filename to pick a firmware compatible with the part. These strings were being added to the part string, but that is a misuse of the string. The correct place for these is the fwf_name string, which is specifically intended to select between multiple firmware files for the same part. Backport note: This won't apply to kernels older than v6.6. Signed-off-by: Richard Fitzgerald <[email protected]> Fixes: 608f1b0 ("ASoC: cs35l56: Move DSP part string generation so that it is done only once") Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 07f7d6e commit f6c9679

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

sound/soc/codecs/cs35l56.c

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,18 @@ static void cs35l56_dsp_work(struct work_struct *work)
907907

908908
pm_runtime_get_sync(cs35l56->base.dev);
909909

910+
/* Populate fw file qualifier with the revision and security state */
911+
if (!cs35l56->dsp.fwf_name) {
912+
cs35l56->dsp.fwf_name = kasprintf(GFP_KERNEL, "%02x%s-dsp1",
913+
cs35l56->base.rev,
914+
cs35l56->base.secured ? "-s" : "");
915+
if (!cs35l56->dsp.fwf_name)
916+
goto err;
917+
}
918+
919+
dev_dbg(cs35l56->base.dev, "DSP fwf name: '%s' system name: '%s'\n",
920+
cs35l56->dsp.fwf_name, cs35l56->dsp.system_name);
921+
910922
/*
911923
* When the device is running in secure mode the firmware files can
912924
* only contain insecure tunings and therefore we do not need to
@@ -926,7 +938,7 @@ static void cs35l56_dsp_work(struct work_struct *work)
926938
* on the DAPM mutex.
927939
*/
928940
queue_work(cs35l56->dsp_wq, &cs35l56->mux_init_work);
929-
941+
err:
930942
pm_runtime_mark_last_busy(cs35l56->base.dev);
931943
pm_runtime_put_autosuspend(cs35l56->base.dev);
932944
}
@@ -979,6 +991,9 @@ static void cs35l56_component_remove(struct snd_soc_component *component)
979991

980992
wm_adsp2_component_remove(&cs35l56->dsp, component);
981993

994+
kfree(cs35l56->dsp.fwf_name);
995+
cs35l56->dsp.fwf_name = NULL;
996+
982997
cs35l56->component = NULL;
983998
}
984999

@@ -1330,12 +1345,6 @@ int cs35l56_init(struct cs35l56_private *cs35l56)
13301345
if (ret)
13311346
return ret;
13321347

1333-
/* Populate the DSP information with the revision and security state */
1334-
cs35l56->dsp.part = devm_kasprintf(cs35l56->base.dev, GFP_KERNEL, "cs35l56%s-%02x",
1335-
cs35l56->base.secured ? "s" : "", cs35l56->base.rev);
1336-
if (!cs35l56->dsp.part)
1337-
return -ENOMEM;
1338-
13391348
if (!cs35l56->base.reset_gpio) {
13401349
dev_dbg(cs35l56->base.dev, "No reset gpio: using soft reset\n");
13411350
cs35l56->soft_resetting = true;

0 commit comments

Comments
 (0)