Skip to content

Commit d0ab899

Browse files
rfvirgilbroonie
authored andcommitted
ASoC: cs35l56: Add KUnit testing of cs35l56_set_fw_suffix()
Add a new KUnit test for testing the creation of firmware name qualifiers in the cs35l56 driver. The initial set of test cases are for cs35l56_set_fw_suffix(). Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20260121132243.1256019-6-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 3f086a4 commit d0ab899

6 files changed

Lines changed: 391 additions & 1 deletion

File tree

sound/soc/codecs/Kconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -933,6 +933,19 @@ config SND_SOC_CS35L56_CAL_SET_CTRL
933933
On most platforms this is not needed.
934934

935935
If unsure select "N".
936+
937+
config SND_SOC_CS35L56_TEST
938+
tristate "KUnit test for Cirrus Logic cs35l56 driver" if !KUNIT_ALL_TESTS
939+
depends on SND_SOC_CS35L56 && KUNIT
940+
default KUNIT_ALL_TESTS
941+
select SND_SOC_CS_AMP_LIB_TEST_HOOKS
942+
help
943+
This builds KUnit tests for the Cirrus Logic cs35l56
944+
codec driver.
945+
For more information on KUnit and unit tests in general,
946+
please refer to the KUnit documentation in
947+
Documentation/dev-tools/kunit/.
948+
If in doubt, say "N".
936949
endmenu
937950

938951
config SND_SOC_CS40L50

sound/soc/codecs/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ snd-soc-cs35l56-shared-y := cs35l56-shared.o
8181
snd-soc-cs35l56-i2c-y := cs35l56-i2c.o
8282
snd-soc-cs35l56-spi-y := cs35l56-spi.o
8383
snd-soc-cs35l56-sdw-y := cs35l56-sdw.o
84+
snd-soc-cs35l56-test-y := cs35l56-test.o
8485
snd-soc-cs40l50-y := cs40l50-codec.o
8586
snd-soc-cs42l42-y := cs42l42.o
8687
snd-soc-cs42l42-i2c-y := cs42l42-i2c.o
@@ -516,6 +517,7 @@ obj-$(CONFIG_SND_SOC_CS35L56_SHARED) += snd-soc-cs35l56-shared.o
516517
obj-$(CONFIG_SND_SOC_CS35L56_I2C) += snd-soc-cs35l56-i2c.o
517518
obj-$(CONFIG_SND_SOC_CS35L56_SPI) += snd-soc-cs35l56-spi.o
518519
obj-$(CONFIG_SND_SOC_CS35L56_SDW) += snd-soc-cs35l56-sdw.o
520+
obj-$(CONFIG_SND_SOC_CS35L56_TEST) += snd-soc-cs35l56-test.o
519521
obj-$(CONFIG_SND_SOC_CS40L50) += snd-soc-cs40l50.o
520522
obj-$(CONFIG_SND_SOC_CS42L42_CORE) += snd-soc-cs42l42.o
521523
obj-$(CONFIG_SND_SOC_CS42L42) += snd-soc-cs42l42-i2c.o

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -806,6 +806,9 @@ const char *cs_amp_devm_get_vendor_specific_variant_id(struct device *dev,
806806
int ssid_vendor,
807807
int ssid_device)
808808
{
809+
KUNIT_STATIC_STUB_REDIRECT(cs_amp_devm_get_vendor_specific_variant_id,
810+
dev, ssid_vendor, ssid_device);
811+
809812
if ((ssid_vendor == PCI_VENDOR_ID_DELL) || (ssid_vendor < 0))
810813
return cs_amp_devm_get_dell_ssidex(dev, ssid_vendor, ssid_device);
811814

0 commit comments

Comments
 (0)