]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ASoC: cs-amp-lib: Add helpers for factory calibration
authorRichard Fitzgerald <rf@opensource.cirrus.com>
Tue, 21 Oct 2025 10:50:13 +0000 (11:50 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 27 Oct 2025 14:07:42 +0000 (14:07 +0000)
commitcdd27fa3298ad2f39788804f7d09ab31af2b416c
tree8cb34ef0009e62252bd846e9df0272dad76b4b4a
parent1afc05996299b4546e8be9b13c89f78e19912c7d
ASoC: cs-amp-lib: Add helpers for factory calibration

Add helper functions for performing factory calibration.

cs_amp_read_cal_coeffs() reads the results of a calibration into a
struct cirrus_amp_cal_data. The calTime member is also filled in with
the current time (which is defined to be in Windows format).

cs_amp_write_ambient_temp() writes a given temperature value to the
firmware control for ambient temperature.

The cs_amp_cal_target_u64() has been moved into the header file so
that it can be used by the calling code and by KUnit tests.

cs_amp_create_debugfs() creates a debugfs directory to contain
debugfs files related to calibration. This is placed in a directory
in debugfs root, named "cirrus_logic". The purpose of this is to
make it easier for tooling to find the files it needs by keeping
control of the layout under this directory. By contrast the ASoC
debugfs can vary between kernel releases and doesn't have a strictly
stable naming convention. HDA does not have a debugfs directory at all
and enabling the general ALSA debugfs (which is normally disabled) has
other side-effects.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20251021105022.1013685-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/cs-amp-lib.h
sound/soc/codecs/cs-amp-lib.c