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 <[email protected]> Signed-off-by: Richard Fitzgerald <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent c61115b commit e2d7ad7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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)