Skip to content

Commit

Permalink
ASoC: cs-amp-lib: Check for no firmware controls when writing calibra…
Browse files Browse the repository at this point in the history
…tion

When a wmfw file has not been loaded the firmware control descriptions
necessary to write a stored calibration are not present. In this case
print a more descriptive error message.

The message is logged at info level because it is not fatal, and does
not necessarily imply that anything is broken.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://msgid.link/r/20240325144450.293630-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Simon Trimmer authored and Mark Brown committed Mar 25, 2024
1 parent c61115b commit e2d7ad7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sound/soc/codecs/cs-amp-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ static int _cs_amp_write_cal_coeffs(struct cs_dsp *dsp,
dev_dbg(dsp->dev, "Calibration: Ambient=%#x, Status=%#x, CalR=%d\n",
data->calAmbient, data->calStatus, data->calR);

if (list_empty(&dsp->ctl_list)) {
dev_info(dsp->dev, "Calibration disabled due to missing firmware controls\n");
return -ENOENT;
}

ret = cs_amp_write_cal_coeff(dsp, controls, controls->ambient, data->calAmbient);
if (ret)
return ret;
Expand Down

0 comments on commit e2d7ad7

Please sign in to comment.