summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/Kconfig
diff options
context:
space:
mode:
authorRichard Fitzgerald <rf@opensource.cirrus.com>2024-03-04 17:37:05 +0300
committerMark Brown <broonie@kernel.org>2024-03-04 23:27:35 +0300
commit177862317a98adde284233aee074fc6e6a51cf95 (patch)
tree20e472c8ebfff2ea1d2600340391254f5dec992f /sound/soc/codecs/Kconfig
parent9e6f39535c794adea6ba802a52c722d193c28124 (diff)
downloadlinux-177862317a98adde284233aee074fc6e6a51cf95.tar.xz
ASoC: cs-amp-lib: Add KUnit test for calibration helpers
Add a KUnit test for the cs-amp-lib library. This has test cases for cs_amp_get_efi_calibration_data() and cs_amp_write_cal_coeffs(). A KUNIT_STATIC_STUB_REDIRECT() has been added to cs_amp_get_efi_variable() and cs_amp_write_cal_coeff() so that the KUnit test can redirect these to test harness functions. Much of the testing involves invoking the same function with different parameters, i.e. the number of amps and the amp index within the array. This uses parameterization rather than looping. The idea is to avoid looping over configurations within one test case as that has a higher chance of having a bug that doesn't actually test all the expected cases. Having the test run exactly one configuration, and then tear-down, is less prone to accidentally skipped configurations. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://msgid.link/r/20240304143705.26362-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/Kconfig')
-rw-r--r--sound/soc/codecs/Kconfig13
1 files changed, 13 insertions, 0 deletions
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 15f287784d8b..f78ea2f86fa6 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -732,6 +732,19 @@ config SND_SOC_CROS_EC_CODEC
config SND_SOC_CS_AMP_LIB
tristate
+config SND_SOC_CS_AMP_LIB_TEST
+ tristate "KUnit test for Cirrus Logic cs-amp-lib"
+ depends on KUNIT
+ default KUNIT_ALL_TESTS
+ select SND_SOC_CS_AMP_LIB
+ help
+ This builds KUnit tests for the Cirrus Logic common
+ amplifier library.
+ For more information on KUnit and unit tests in general,
+ please refer to the KUnit documentation in
+ Documentation/dev-tools/kunit/.
+ If in doubt, say "N".
+
config SND_SOC_CS35L32
tristate "Cirrus Logic CS35L32 CODEC"
depends on I2C