firmware: cs_dsp: Add KUnit testing of control parsing
authorRichard Fitzgerald <rf@opensource.cirrus.com>
Thu, 12 Dec 2024 14:37:20 +0000 (14:37 +0000)
committerMark Brown <broonie@kernel.org>
Fri, 13 Dec 2024 13:14:43 +0000 (13:14 +0000)
commit83baecd92e7c2a44ac963fab8fd4476c71e19ddd
tree38896446cb7bdada98cc03809df39919c10edd0e
parenta2b2f2c1cd2a8b21c23bd1ec33131d2266c7568a
firmware: cs_dsp: Add KUnit testing of control parsing

Add KUnit test cases for parsing of firmware controls out of the
wmfw. These test cases are only testing that the data in the wmfw
is correctly interpreted and entered into the list of controls.

The test cases can be roughly divided into three types:
1) The correct values are extracted from the wmfw.
2) Variable-length strings are handled correctly.
3) Controls are correctly identified as unique or identical.

There are multiple test suites to cover:
- V1 and V2 format files on 16-bit and 32-bit ADSP2.
- V3 format files on Halo Core DSPs.

V1 format does not have named controls, and the strings in the
coefficient descriptor are fixed-length fields. On V2 and V3 format
the controls are named and all strings are variable-length.

The obsolete V0 format does not have controls, so no testing of
that format is needed.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20241212143725.1381013-8-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/firmware/cirrus/test/Makefile
drivers/firmware/cirrus/test/cs_dsp_test_control_parse.c [new file with mode: 0644]