Skip to content

Commit e2d7ad7

Browse files
simontrimmerbroonie
authored andcommitted
ASoC: cs-amp-lib: Check for no firmware controls when writing calibration
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>
1 parent c61115b commit e2d7ad7

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

sound/soc/codecs/cs-amp-lib.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ static int _cs_amp_write_cal_coeffs(struct cs_dsp *dsp,
5656
dev_dbg(dsp->dev, "Calibration: Ambient=%#x, Status=%#x, CalR=%d\n",
5757
data->calAmbient, data->calStatus, data->calR);
5858

59+
if (list_empty(&dsp->ctl_list)) {
60+
dev_info(dsp->dev, "Calibration disabled due to missing firmware controls\n");
61+
return -ENOENT;
62+
}
63+
5964
ret = cs_amp_write_cal_coeff(dsp, controls, controls->ambient, data->calAmbient);
6065
if (ret)
6166
return ret;

0 commit comments

Comments
 (0)