summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/cirrus_scodec_test.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ALSA: hda: cirrus_scodec: fix an error codeDan Carpenter2023-09-301-2/+2
| | | | | | | | | | The "ret" variable is zero but we should return -EINVAL. Fixes: 2144833e7b41 ("ALSA: hda: cirrus_scodec: Add KUnit test") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/5eea7fd5-67c8-4ed4-b5b3-b85dfb7572cc@moroto.mountain Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hda: cirrus_scodec: Add KUnit testRichard Fitzgerald2023-09-181-0/+370
Add a KUnit test for cirrus_scodec_get_speaker_id(). It is impractical to have enough hardware with every possible permutation of speaker id. So use a test harness to test all theoretically supported options. The test harness consists of: - a mock GPIO controller. - a mock struct device to represent the scodec driver - software nodes to provide the fwnode info that would normally come from ACPI. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230918095129.440-3-rf@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>