ASoC: cs35l56: Firmware file must match the version of preloaded firmware
authorRichard Fitzgerald <rf@opensource.cirrus.com>
Mon, 29 Jan 2024 16:27:31 +0000 (16:27 +0000)
committerMark Brown <broonie@kernel.org>
Thu, 1 Feb 2024 12:57:24 +0000 (12:57 +0000)
commitf4ef5149953f2fc04907ca5b34db3df667dcddef
tree6b48ebb17859049a8126075767f8a03404be1916
parentf6c967941c5d6fa526fdd64733a8d86bf2bfab31
ASoC: cs35l56: Firmware file must match the version of preloaded firmware

Check during initialization whether the firmware is already patched.
If so, include the firmware version in the wm_adsp fwf_name string.

If the firmware has already been patched by the BIOS the driver
can only replace it if it has control of hard RESET.

If the driver cannot replace the firmware, it can still load a wmfw
(for ALSA control definitions) and/or a bin (for additional tunings).
But these must match the version of firmware that is running on the
CS35L56.

The firmware is pre-patched if FIRMWARE_MISSING == 0.

Including the firmware version in the fwf_name string will
qualify the firmware file name:

Normal (unpatched or replaceable firmware):
  cs35l56-rev-dsp1-misc[-system_name].[wmfw|bin]

Preloaded firmware:
  cs35l56-rev[-s]-VVVVVV-dsp1-misc[-system_name].[wmfw|bin]

Where:
   [-s] is an optional -s added into the name for a secured CS35L56
   VVVVVV is the 24-bit firmware version in hexadecimal.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Fixes: 608f1b0dbdde ("ASoC: cs35l56: Move DSP part string generation so that it is done only once")
Link: https://msgid.link/r/20240129162737.497-13-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/cs35l56.h
sound/soc/codecs/cs35l56-shared.c
sound/soc/codecs/cs35l56.c