summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/cs35l56-test.c
AgeCommit message (Collapse)AuthorFilesLines
2026-03-09ASoC: cs35l56-test: Remove pointless duplicate loop countersRichard Fitzgerald1-6/+5
In cs35l56_test_parse_xu_onchip_spkid() the first two loops used local i to index an array and num_gpios/num_pulls to count how many entries it had seen. But both i and num_* started at 0 and incremented on each loop so were identical. Remove i from these loops. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20260309115651.1090368-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-06ASoC: cs35l56: More KUnit tests for speaker IDMark Brown1-0/+80
Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>: The first 3 patches in this series add some more KUnit testing for fetching speaker ID and combining it with the system name to create part of the qualifier for a firmware filename. Patch #4 enables GPIOLIB in KUnit 'alltests' builds. This can be taken separately from the first 3 patches. The GPIO tests will skip if GPIOLIB is not enabled, but obviously it would be ideal for 'kunit.py --alltests' runs to include these new test cases.
2026-03-05ASoC: cs35l56: KUnit tests for setting dsp.system_nameRichard Fitzgerald1-0/+80
Add KUnit tests for setting the dsp.system_name string. There are two sources of the string: 1. PCI SSID from struct snd_soc_card. 2. "cirrus,firmware-uid" property. Either of these can then be qualified by a speaker ID integer. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20260304162402.1714759-2-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-03ASoC: cs35l56-test: Add test cases without onchip pulls definedRichard Fitzgerald1-0/+10
Add parameters to cs35l56_test_onchip_spkid_cases[] for the ACPI defining onchip GPIOs but not defining any pull settings. Pull settings are optional because the pull should normally be provided by an external resistor. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20260303131440.574690-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-02-05ASoC: cs35l56: KUnit tests for parsing and using onchip GPIOsRichard Fitzgerald1-0/+273
Add KUnit test cases for: - cs35l56_process_xu_properties() which reads the onchip GPIO definitions. - cs35l56_set_fw_name() calls functions to configure and set the GPIOs. - cs35l56_set_fw_name() saves the ID value in cs35l56_priv.speaker_id. - cs35l56_set_fw_name() does not overwrite a speaker ID that was already found some other way. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20260205164838.1611295-4-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-01-23ASoC: cs35l56-test: Fix missing module namespace importRichard Fitzgerald1-0/+1
The test must import namespace "EXPORTED_FOR_KUNIT_TESTING". Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Fixes: d0ab89951197 ("ASoC: cs35l56: Add KUnit testing of cs35l56_set_fw_suffix()") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202601221843.kS9IMZ0E-lkp@intel.com/ Link: https://patch.msgid.link/20260123111354.1931986-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-01-21ASoC: cs35l56: Add KUnit testing of cs35l56_set_fw_suffix()Richard Fitzgerald1-0/+365
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>